开发者

Im getting a data binding error when trying to embed flash into Flex 3

开发者 https://www.devze.com 2022-12-30 12:39 出处:网络
My scriptis: [Bindable] [Embed(source=\"loader.swf\")] pub开发者_如何学JAVAlic static var Icon:Class;

My script is:

[Bindable]
[Embed(source="loader.swf")]
pub开发者_如何学JAVAlic static var Icon:Class;

and my mx is:

<mx:Image source="{Icon}" y="125" x="0"/>

It works but when I try to export it it won't because of:

Data binding will not be able to detect assignments to "Icon"

What am I doing wrong?


Why don't you just do:

<mx:Image source="@Embed(source="loader.swf")" y="125" x="0" /> ?

Also as "Icon" is a variable name, it should be lower case.

If you really want to create a variable for the embedded asset, you just need to switch your meta tags, ie:

[Embed(source="loader.swf")]
[Bindable]
public var iconClass:Class;


Change it to this:

[Embed(source="loader.swf")]
public static const iconClass:Class;
0

精彩评论

暂无评论...
验证码 换一张
取 消