Posted By

chrisaiv on 03/09/09


Tagged

mxml


Versions (?)

Flex: Accessing the stage


 / Published in: MXML
 

URL: http://www.alwaysgetbetter.com/blog/2008/11/09/accessing-the-stage-in-flex/

There are times when you need to access the stage property before onCreationComplete. Here are two ways to do it.

  1. /***********************
  2. Method 1: On Added handler
  3. ***********************/
  4. addEventListener( Event.ADDED_TO_STAGE, function( e:Event ):void
  5. {
  6. stage.addEventListener( MouseEvent.MOUSE_MOVE, myMouseMoveEvent );
  7. });
  8.  
  9. /***********************
  10. Method 2: The system manager parents all displayable elements within the Flex application.
  11. ***********************/
  12. systemManager.stage.addEventListener( MouseEvent.MOUSE_MOVE, myMouseMoveEvent );

Report this snippet  

You need to login to post a comment.