Embedding Resource with AS 3.0

2009-04-23
哇,用了ActionScript那么久,现在才发现原来Embed那么有用~~可以直接嵌入外部图片,或是外部SWF内的元件,直接用嵌入的资源作为类来创建实例,例如:
[Embed(source="....jpg")]
private var MyImage:Class;
....
var img:Bitmap = new MyImage();

[Embed(source="....swf", symbol="SomeSymbolId")]
private var MySymbol:Class;
....
var sym:Sprite = new MySymbol()

M-OSCAR | Powered by Blogger | Entries (RSS) | Comments (RSS) | Designed by MB Web Design | XML Coded By Cahayabiru.com