Component not listening to MainApp's state change
- by tag
I don't know if this is too difficult or too easy. My custom component is trying to listen to the main application's state changes using StateChangeEvent.CURRENT_STATE_CHANGE
private function init(){
addEventListener(StateChangeEvent.CURRENT_STATE_CHANGE, function():void{
Alert.show("parent state changed");
});
}
but as expected, it's reporting its own state changes not the main application's.
I have 2 options:
figure a way to tell it that I really mean the main application's state change not its own
or configure the main application to dispatch a specific custom event that the component would listen for
Any idea how I could do the first? or do I need the second option in this case?