是否有可能创建动态嵌入功能?有可能、功能、动态

2023-09-08 12:59:32 作者:泡椒凤爪

是否有可能创造的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.