是否有可能创造的ActionScript3动态嵌入功能
Is it possible to create dynamic embed function in ActionScript3
例如像这样
public function embedImage(path:String):Bitmap{
[Embed(source = path, mimeType = "image/png")]
var NewBitmapClass:Class;
var image:Bitmap=new NewBitmapClass();
return image;
}// tried it, it doesnt work
或者以某种其他方式,或即使它是在所有可能的?
or maybe in some other way, or even if it is at all possible?
嵌入式元件嵌入在编译时。你不能动态地嵌入一些在编译的时候......如果你要动态加载资源,使用 装载机
。
Embedded elements are embedded at compile time. You can't dynamically embed something at compile time... If you want to load resources dynamically, use the Loader
.