actionscript-3adobe-flash-cs3

how to edit adobe flash height and width


i'm making an swf file that will load another swf file

var myLoader:Loader = new Loader();
addChild(myLoader);
var url:URLRequest = new URLRequest("1.swf");
myLoader.load(url);

i want to edit the main SWF dimensions to be same as the loaded one how can i do that ?


Solution

  • You can access the stage dimensions with Stage.stageWidth and Stage.stageHeight. You might also want to look at Stage.scaleMode as that affects how the stage's size is interpreted when displaying the flash movie inside a bigger container (or fullscreen).

    Otherwise the main movie's size is determined by the actual displaying flash player (being in a browser, standalone or via AIR), so you cannot really change it after then movie is actually loaded. You might want to look at resizing B instead to fit the maximum displayed area of A.