View Fullscreen
try {
stage.displayState = StageDisplayState.FULL_SCREEN;
}catch (e:Error) {
trace("#", e.message);
}
Resize and object to fit the screen
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener(Event.RESIZE, resizeListener);
stage.displayState = StageDisplayState.FULL_SCREEN;
redraw();
function resizeListener (e:Event):void {
redraw();
}
function redraw(){
mcBackground.width = stage.stageWidth;
mcBackground.height = stage.stageHeight;
mcContentInner.width = stage.stageWidth;
mcContentInner.scaleY = mcContentInner.scaleX;
mcContentInner.x = stage.stageWidth/2 - mcContentInner.width/2;
mcContentInner.y = stage.stageHeight/2 - mcContentInner.height/2;
}
Categories:
Flash AS3