how to edit adobe flash height and width

833 views Asked by At

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 ?

2

There are 2 answers

0
poke On BEST ANSWER

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.

1
antpaw On

try this

var l:Loader = new Loader();
addChild(l);

l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);

l.load(new URLRequest("1.swf"));

function done(e:Event):void{
     l.width = this.width;
     l.height = this.height;
      // OR
     l.width = 100;
     l.height = 100;
}

this script will not help you if your flash is fullscreen and the user resizes the stage