Created
January 4, 2011 22:54
-
-
Save iammerrick/765613 to your computer and use it in GitHub Desktop.
Referencing the stage from inner classes. Singleton method.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
import flash.display.MovieClip; | |
import Pages; | |
public class Main extends MovieClip | |
{ | |
public static var instance:Main; | |
public function Main() | |
{ | |
instance = this; | |
var pages = new Pages(); | |
} | |
static public function getInstance() | |
{ | |
// Beause this is base class, a new Main should never really be created. | |
if(instance == null) instance = new Main(); | |
return instance; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment