<mx:Label text="{(item1 as INewsItem).displayName}"/>
For the above code in Flex, I get this warning :
: Data binding will not be able to detect assignments to item1.
Why? How to Fix it?
If you define a [Bindable] function get item1()
you'll also need to define a function set item1()
, otherwise Flex wouldn't know when to dispatch a change event. Or you could manually dispatch the change event:
[Bindable(event="item1Change"]
public function get item1() { return ... }
And whenever something on item1 changes you dispatch an event:
dispatchEvent(new Event("item1Change"));