Search code examples
apache-flexactionscript-3adobedispatcher

Component not listening to MainApp's state change


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, but it's reporting its own state changes.

Any idea how I could do this?


Solution

  • Application.application will give you a reference to the main application, thus you should use Application.application.addEventListener(...) to listen to stage changes within the main application.