开发者

how to Display a Symbol from the .SWF file on Canvas?

开发者 https://www.devze.com 2022-12-31 18:25 出处:网络
how i can display a symbol from the .swf on canvas.. i have exprot开发者_高级运维ed the .fla file from the flash CS3 as .swf file...[Embed(source=\'pathToSwf.swf\', symbol=\"ExportForActionscriptSymbo

how i can display a symbol from the .swf on canvas.. i have exprot开发者_高级运维ed the .fla file from the flash CS3 as .swf file...


[Embed(source='pathToSwf.swf', symbol="ExportForActionscriptSymbolName")]
private var MySwfSymbol:Class;

then you can add it to the stage like this:

var swfSymbol:MovieClip = new MySwfSymbol();
canvasId.addChild(swfSymbol);

HOWEVER, this does not work if the symbol has only one frame. In the event that it has only a single frame, you will need to do this:

var swfSymbol:Sprite = new MySwfSymbol();
canvasId.addChild(swfSymbol);
0

精彩评论

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