package{ import flash.display.Stage; public class GlobalStage { //---------------------------------------------------------------------- // // Private Properties // //---------------------------------------------------------------------- private static var instance:GlobalStage = null; private static var stage:Stage = null; //---------------------------------------------------------------------- // // Constructor // //---------------------------------------------------------------------- public function GlobalStage( stageRef:Stage ) { if( instance != null ) { throw new Error( "..." ); } instance = this; stage = stageRef; } //---------------------------------------------------------------------- // // Getters/Setters // //---------------------------------------------------------------------- public static function get align():String { return stage.align; } public static function set align( value:String ):void { stage.align = value; } public static function get scaleMode():String { return stage.scaleMode; } public static function set scaleMode( value:String ):void { stage.scaleMode = value; } }}
import GlobalStage; ... new GlobalStage( stage );
import GlobalStage; ... GlobalStage.align = "topLeft";GlobalStage.scaleMode = "noScale";