For example, the following MXML script attaches a listener to a Button class:
<mx:Button id="STACK" label="OVERFLOW" click="doStuff()"/>
I have a custom action script class which fires an event when a value is updated and I wish to be able to listen for that event in an MXML class:
ActionScript Class:
public function set currentPage(newCurrentPage: Number) : void {
_currentPage = newCurrentPage;
dispatchEvent(new DataEvent(PAGE_CHANGED, true, false, _currentPage));
}
And I wish to be able to do the following in MXML:
<myClass:Class <...> pageChanged="doMoreStuff()" />
How would I do this? Cheers :)