tags:

views:

404

answers:

2

Hi,

I have loaded swf using following code,

var loader:Loader = new Loader();
loader.load(new URLRequest("XYZ.swf"));
addChild(loader);

How do I control height and width of this loaded swf.

I tried

var mc = MovieClip(loader.loaderContentInfo.content);
mc.width = 320;
mc.height = 240;

this gives null object error.

A: 

What Flash Loader are you using?

anyway you can do something like this to insert and control flash movie size

HTML code:

<object width="550" height="400">
<param name="movie" value="somefilename.swf">
<embed src="somefilename.swf" width="550" height="400">
</embed>
</object>

you can just change the width and height values, but if you want to do it with code you can use jquery to make this even easier

$("object").attr("width", 100).attr("height", 100);

obviously you can play with the selector if you have other object tags within your document

GerManson
A: 

In cases when you have loading swf created with lager flat. images 700x600 movement on stage size 300x250, that swf when loaded in the main swf size 950x700 these images are visible in full size at 700x600.

Draw an shape with 300x250 in layer over the loader and set it as mask over the loader component. Loader component have registration point on left up corner, so move it even out of the stage borders to set the loaded content center where you need on the main stage and position the mask over where you need visible 300x250 area. Mask area will be only visible content on the main stage.

prijatel-MKD