views:

20

answers:

2

My script is:

[Bindable]
[Embed(source="loader.swf")]
public 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?

A: 

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;
quoo
A: 

Change it to this:

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