This content has been marked as final. Show 7 replies
Got the same problem. I can't access stage. I tried using the stage property of all the displayobjects on my app and they all return null.
Hey i didnt get your question..What do you want exactly ? Why are you accessing stage property..If any variables defined in the Script Tag or any id assigned to the component you can access those components with mx.core.Application.application.yourvariablename
Lemme what do you want exactly..?
Exactly. Flex IS Flash, but you build it very differently. Unless you are doing something very unusual, you don't need to access the stage.
Why do I want to access stage?
I want to create a global keyboard event handler.
And that's what the documentation said too - http://livedocs.macromedia.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=L iveDocs_Parts&file=00000479.html
Preventing this, any other suggestions on how to create a global keyboard handler?
Try that on the Application instead of the stage. No warranty, but try it.
You won't find a stage on the application until it has been attached to the display list. If you do need the stage, query it when the "applicationComplete" event is fired and it should have a value.
That did it!!!
Got my global keyboard event handler working! Thanks heaps...
To the Adobe moderators, the doc should be updated to note that stage should be accessed after "applicationComplete" is fired as FlightGuy mentioned.