I would like to know how to load bitmapdata (a gif) and
position it within a movieclip so that I could rotate the bitmap
data around the bitmap data’s center point rather than its 0,0
coordinate in the upper left hand corner. Does anyone have a brief
example or description as to how this could be done? I don’t have a
problem doing this when I create the graphic using actionscript,
but I can’t figure out how to do it with a bitmap. Thanks for any
tips or advice.|||
You might be able to do this with the Matrix object, but I
haven’t been able to figure it out. The Matrix has generally
confused me.

An alternative would be to attach the BitmapData in another
MovieClip, and just center that. So something like this:

createEmptyMovieClip(‘myMovieClip_mc’,getNextHighestDepth());

myMovieClip_mc.createEmptyMovieClip(‘myBitmap_mc’,myMovieClip_mc.getNe xtHighestDepth());

myMovieClip_mc.myBitmap_mc.attachBitmap(myBitmap_bmp,myMovieClip_mc.my Bitmap_mc.getNextHighestDepth(),null,true);

myMovieClip_mc.myBitmap_mc._x = -myBitmap_bmp.width/2;

myMovieClip_mc.myBitmap_mc._y = -myBitmap_bmp.height/2;

//now you can rotate myMovieClip_mc and it will rotate the
bitmap around it’s center

myMovieClip_mc._x = Stage.width/2;

myMovieClip_mc._y = Stage.height/2;

myMovieClip_mc.onEnterFrame = function(){

this._rotation+=5;

}

Related posts:

  1. Rotating with matrix transform
  2. Bitmap mask on Sprite
  3. Converting a movieclip to bitmap data (AS3)
  4. how to edit bitmap which is imported in flash using xml and save the edited bitmap back to xml in flash.
  5. how to edit bitmap which is imported in flash using xml and save the edited bitmap back to xml in flash.

Related posts brought to you by Yet Another Related Posts Plugin.

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

   
© 2012 free icons download Suffusion theme by Sayontan Sinha

Featuring Recent Posts WordPress Widget development by YD