Posted By

damarev on 04/14/09


Tagged


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

themill
toxin20
loric
tspitzr
albertomori


root in AS3 (TopLevel )


 / Published in: ActionScript 3
 

URL: http://www.senocular.com/flash/actionscript.php?file=ActionScript_3.0/TopLevel.as

  1. package {
  2.  
  3. import flash.display.DisplayObject;
  4. import flash.display.MovieClip;
  5. import flash.display.Stage;
  6.  
  7. /*
  8. * TopLevel class
  9. * have all document classes extend this
  10. * class instead of Sprite or MovieClip to
  11. * allow global stage and root access through
  12. * TopLevel.stage and TopLevel.root
  13. */
  14. public class TopLevel extends MovieClip {
  15.  
  16. public static var stage:Stage;
  17. public static var root:DisplayObject;
  18.  
  19. public function TopLevel() {
  20. TopLevel.stage = this.stage;
  21. TopLevel.root = this;
  22. }
  23. }
  24. }

Report this snippet  

You need to login to post a comment.