是否有可能创建动态嵌入功能? [英] Is it possible to create dynamic embed function?
本文介绍了是否有可能创建动态嵌入功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有可能创造的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?
推荐答案
嵌入式元件嵌入在编译时。你不能动态地嵌入一些在编译的时候......如果你要动态加载资源,使用<一个href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Loader.html?filter_flash=cs5&filter_flashplayer=10.2&filter_air=2.6"相对=nofollow> 装载机
。
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
.
这篇关于是否有可能创建动态嵌入功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文