views:

291

answers:

2

I am trying to load a swf(as3) into another As3 Swf with the Movieclip loader. After loading however Loader.width/loader.content.width returns an exaggerated value than the actual width of the swf being loaded. Any pointers on where to begin looking for the discrepancy? Thanks in advance.

More Details (if it helps)

The swf being loaded has UI components like dropdowns, input boxes and combo boxes (its a Form to fill up), and a coded one-time tween.

When the child MC loads into the parent movieclip, the Loader.width value returned is exaggerated by about 28 pixels (although the height remains the same). Loader.content.width also returns a 28 pixel exaggerated value. The Exaggerated value is more than even the stage width of the child MC. The extra ~30 px are upsetting subsequent code in the parent movie to scale and center the loaded swf.

update:

stage.stageWidth returns the correct Value.

Code used in the parent MC, to load external SWF:

private var deadURL = "child.swf";
private var deadReq:URLRequest = new URLRequest(deadURL);
private var deadLoader:Loader = new Loader();
deadLoader.load(deadReq);
deadLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onDeadLoad);


public function onDeadLoad(e:Event):void
{
addChild(deadLoader);
trace("content.width: " + deadloader.content.width); //returns exaggerated value
trace("width: " + deadLoader.width); //returns same exaggerated value
}
A: 

Hi Sawrb!

Could you post the code you are using to load the external SWF?
In which method are you reading the width/height value?
Which value do the following code return when executed inside the external swf?

trace(stage.stageWidth);
trace(stage.stageHeight);
jdecuyper
thanks for replying. Updated the original Question with the info you asked for.
Sawrb
A: 

If the parent MC is resized i.e. if in the Transform dialog it reads other than 100% then that transformation is passed on to any children.

chris