Loading into target!

I’m using the following AS to load a movie into target:

but.onPress = function () {
_root.createEmptyMovieClip(“container”, 1);
loadMovie(“loaded.swf”, “container”);
container._x = 150 ;
container._y = 20 ;
}

But the loaded.swf ruins my main.swf cause it goes beyond it’s original size - is it possible to define a size for the container, so the loaded.swf stays inside the desired size!?

Hi,

Do u mean :
but.onPress = function () {
_root.createEmptyMovieClip(“container”, 1);
loadMovie(“loaded.swf”, “container”);
container._width = yourwidth;
container._height = yourheight ;
container._x = 150 ;
container._y = 20 ;
}
???

cya

SHO

Yeah…

but the code won’t work if I define the size the way you describe!??

Hi,

This is not a solution,is a patch!!! but instead if creating an empty movie clip why don’t u use a movie clip (container) that’s filled with a transparent color a place off screen. Then just use the same code without the line ‘_root.createEmptyMovieClip(“container”, 1);’

This is the way this kind of things where made before MX

Cya

SHO

OKI!

Mabye I’m not getting this, but let me explain my problem again!
I wan’t my loaded movie to stay inside a box (container) with a size of, let’s say “width = 400 height = 90” like a banner! When I run the loaded.swf in my browser it looks fine, but when I load it into my main movie, the animations goes beyond the 400X90 and ruins my main movie!..?

the size of the movie doesn’t matter…that code _x and _y was setting the posistion of the movie

this sould work

_root.createEmptyMovieClip(“bob”,1);
bob.loadMovie(“mySwf.swf”);

i dunno…wot ever…

Yes, you can not size an empty movie clip. If you load a movie to a target, the upper left hand corner will attach itself to the clip. So move your empty clip coords to where you want the upper left hand corner of your loaded movie to be, and you should be set.

It also helps if you place a rectangle into the empty movie clip with the same dimensions as your movie you wish to load, this helps get an idea of where it will appear. And of course, remove the rectangle once you’ve got the movie clip where you want it.

Yes, good point flex. That is the method I use to align my loaded movies.

Depending on what movie you load, you can even leave a bordered rectangle there and it will look good. This is also good for future reference.

Yo guys, thx for your help - really NICE!..

But take a look at this link of mine, and tell me what I’m doing worng!..

http://www.lysten.nu/tests/test.htm

When you load a movie, it doesn’t count it as a seperate movie anymore. It combines it into your main movie, so the background color will change to the main movie that you are loading, as will the cut off area and other attributes of your movie.

You can use a mask if you want that cut off. Just draw a rectangle in the layer above that and then right click the layer and check “Mask” This will show only the content in the area of that rectangle.