# Loading into target!

**URL:** <https://forum.kirupa.com/t/loading-into-target/5277>\
**Category:** flash\
**Created:** [September 6, 2002, 11:04am UTC](https://forum.kirupa.com/t/loading-into-target/5277 "2002-09-06T11:04:44Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerry](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@jerry](https://forum.kirupa.com/u/jerry)\
**Post date:** [September 6, 2002, 11:04am UTC](https://forum.kirupa.com/t/loading-into-target/5277/1 "2002-09-06T11:04:44Z")

</div>

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!?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 6, 2002, 11:22am UTC](https://forum.kirupa.com/t/loading-into-target/5277/2 "2002-09-06T11:22:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 6, 2002, 11:49am UTC](https://forum.kirupa.com/t/loading-into-target/5277/3 "2002-09-06T11:49:05Z")

</div>

Yeah…

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 6, 2002, 11:57am UTC](https://forum.kirupa.com/t/loading-into-target/5277/4 "2002-09-06T11:57:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 6, 2002, 1:17pm UTC](https://forum.kirupa.com/t/loading-into-target/5277/5 "2002-09-06T13:17:11Z")

</div>

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!..?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 6, 2002, 1:21pm UTC](https://forum.kirupa.com/t/loading-into-target/5277/6 "2002-09-06T13:21:58Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 6, 2002, 3:08pm UTC](https://forum.kirupa.com/t/loading-into-target/5277/7 "2002-09-06T15:08:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 6, 2002, 7:22pm UTC](https://forum.kirupa.com/t/loading-into-target/5277/8 "2002-09-06T19:22:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 6, 2002, 7:24pm UTC](https://forum.kirupa.com/t/loading-into-target/5277/9 "2002-09-06T19:24:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 6, 2002, 8:07pm UTC](https://forum.kirupa.com/t/loading-into-target/5277/10 "2002-09-06T20:07:05Z")

</div>

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](http://www.lysten.nu/tests/test.htm)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 6, 2002, 8:12pm UTC](https://forum.kirupa.com/t/loading-into-target/5277/11 "2002-09-06T20:12:19Z")

</div>

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.
