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

how i can display a symbol from the .swf on canvas.. i have exproted the .fla file from the flash CS3 as .swf file...

Upvotes: 0

Views: 327

Answers (1)

DirtyKalb
DirtyKalb

Reputation: 391

[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);

Upvotes: 1

Related Questions