Flex Tip: Error accessing the stage when the app first loads

Long story short use the applicationComplete event.

This is something I struggled with for a while. I don’t use a mouse much and like to code keyboard shortcuts into the applications I build. My code initially looked like this:



4 thoughts on “Flex Tip: Error accessing the stage when the app first loads”

  1. Instead of adding the event listner to the stage object and using the callLater add it to the systemManager object:
    systemManager.addEventListener(_____, _______);

    and get rid of the callLater.

    I hope this works as well!

    Dov

    1. Thanks for the advice, I generally find that when I’m using the callLater it’s a workaround for something I’m doing wrong. Could you give the file name/line number you’re referring to though, I’m having trouble finding it.

  2. Line 12 in the first code box above. Where you add the eventListener. add it to the systemManager object instead of the stage object.

Leave a comment