开发者

How to access a graphic that has been added to the stage in Adobe Flash Pro (CS5)

开发者 https://www.devze.com 2023-04-08 06:40 出处:网络
I added a graphic to the stage and I need to access it from actionscript开发者_C百科, any idea how to do that?You need to convert your graphic to a MovieClip:

I added a graphic to the stage and I need to access it from actionscript开发者_C百科, any idea how to do that?


You need to convert your graphic to a MovieClip:

  • Click on your graphics
  • Press F8
  • Click OK
  • Click on the newly created MovieClip, then assign an instance name to it in the Properties dialog

You can then access the MovieClip from ActionScript.

Edit:

To convert the graphic to a BitmapData, just use the draw function:

var bmpData:BitmapData = new BitmapData(yourMc.width, yourMc.height);
bmpData.draw(yourMc);

var bmp:Bitmap = new Bitmap(bmpData);
addChild(bmp);
0

精彩评论

暂无评论...
验证码 换一张
取 消