Automatically resize bootloader and loaded SWF

Is there any way to set the loaded height and width of the SWF so that I always use 100% of the height and width of the loader? pretty much when you embed swf in an HTML page ... I know you can do this by setting the loader width and height at each step of the resizing, but is there any other way in which you can simply specify the height and width is 100%, and then the loaded SWF automatically resizes to fit the size of the scene and the load of the loader?

try downloading a SWF file with coordinates based on listeners, and it seems that the loaded SWF does not correctly change its listeners, even if the stage has already been changed ... take this SWF, for example http://www.mofunzone.com/online_games/the_simple_game.shtml , I tried using SWFLoader in flex, which scales the content, as well as the usual AS3 flash.display.Loader, and it seems that both cannot properly move listeners. Any comments?

+3
source share
2 answers

For this reason, you do not need to automatically resize, you can set width=100%and height=100%. Take a look here , for example.

0
source

swf .

, swf 100% , . , 100%, swf:

import flash.events.Event

addEventListener (Event.ADDED_TO_STAGE, onAddedToStage);

function onAddedToStage (e:Event):void{
    removeEventListener (Event.ADDED_TO_STAGE, onAddedToStage)
    this.width = stage.stageWidth;
    this.height = stage.stageHeight;
}
0

All Articles