Im getting a data binding error when trying to embed flash into Flex 3
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;
精彩评论