In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

Display Stage Size

Get Adobe Flash player
by Zahurdias.Calimero 21 Nov 2012
    Embed
package {
    import flash.display.*;
    import flash.text.*;
    import flash.system.*;
    
    public class HelloWorld extends Sprite {
        
        public function HelloWorld() {
            stage.align=StageAlign.TOP_LEFT;
            stage.scaleMode=StageScaleMode.NO_SCALE;
            
            var display_txt1:TextField = new TextField();
            var display_txt2:TextField = new TextField();
            display_txt1.autoSize=TextFieldAutoSize.LEFT;
            display_txt2.autoSize=TextFieldAutoSize.LEFT;
            display_txt1.text = "stageWidth " + stage.stageWidth + " stageHeight "+ stage.stageHeight;

            display_txt2.text = "X " +  Capabilities.screenResolutionX + " Y "+  Capabilities.screenResolutionY;


            addChild(display_txt1);
            addChild(display_txt2);            
            display_txt2.y=20;
        }
    }
}