问题描述
有链接的象征一类闪光灯CS5中的GUI设计的简单方法。但我怎么做同样的事情在动作单独使用code,因为IAM不使用闪光灯CS5。亚姆使用记事本+ +和Flex编译器。
There is a simple method of linking a symbol to a class in flash cs5 in the gui designer. But how can i do the same thing in actionscript alone using code because iam not using flash cs5. Iam using notepad++ and flex compiler.
推荐答案
希望这个链接将回答你的问题:http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/MovieClip.html
Hopefully this link will answer your question: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/MovieClip.html
的本质是这样的:
[Embed(source="logo.gif")]
[Bindable]
public var imgCls:Class;
和这样做是告诉编译器中添加 logo.gif
作为它的类名称的符号将被 imgCls
。
and what this does is tell the compiler to add logo.gif
as a symbol whose class name will be imgCls
.
要那么使用这个在code,你只需要创建它的一个实例并正常工作:
To then use this in your code, you just have to create an instance of it and work as normal:
var myImg:BitmapAsset = new imgClass() as BitmapAsset;
addChild(myImg);
这篇关于连接符号类的动作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!