/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
stage.addEventListener(Event.RESIZE, resizeHandler); stage.dispatchEvent(new Event(Event.RESIZE)); // force stage resize event for normal cases function resizeHandler(event:Event):void { if (stage.stageHeight > 0 && stage.stageWidth > 0) { stage.removeEventListener(Event.RESIZE, resizeHandler); // only execute once // your initialization code here } }