# The load movie script in mx

**URL:** https://forum.kirupa.com/t/the-load-movie-script-in-mx/13710
**Category:** Uncategorized
**Created:** [February 17, 2003, 6:32am UTC](https://forum.kirupa.com/t/the-load-movie-script-in-mx/13710 "2003-02-17T06:32:37Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![somdow](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@somdow](https://forum.kirupa.com/u/somdow)
#### Post date: [February 17, 2003, 6:32am UTC](https://forum.kirupa.com/t/the-load-movie-script-in-mx/13710/1 "2003-02-17T06:32:37Z")

</div>

firstly hello. um my ? is this. first i dont have a problem with implementing the loadmovie code in my site. im building a website and ive kept the sites’ size as low as possible but ive just been told that i have to add a gallery. what i did was that i made the gallery section as a seperate swf.(as a separate movie) now my problem is that when the loadmovie script is called, the movie loads through fine but it doesnt end up where i want it to. i want it on the center and it comes out like in the top left. now ive tried the x\_xposition/ y\_pos. under the set property but what i want to know is where should i input this line of code to, on a frame, on a movie clip, or on the actual sites’ swf or on the separate gallery swf.

hope this isnt too confusing and thank you all.

aku

---

<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: [February 17, 2003, 6:53am UTC](https://forum.kirupa.com/t/the-load-movie-script-in-mx/13710/2 "2003-02-17T06:53:34Z")

</div>

You can try something **lostinbeta** taught me that worked for me:

```php
on (release) {
	_root.containerMC.loadMovie("external.swf");
	_root.containerMC._x = Stage.width/2;
	_root.containerMC._y = Stage.height/2;
}

```

Hope it works for you too. =)

---

<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: [February 17, 2003, 5:43pm UTC](https://forum.kirupa.com/t/the-load-movie-script-in-mx/13710/3 "2003-02-17T17:43:11Z")

</div>

so where would i put this line of code. on the main site timeline or on the sep swf timeline???

sorry to bother but im anxious. lol

---

<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: [February 17, 2003, 11:49pm UTC](https://forum.kirupa.com/t/the-load-movie-script-in-mx/13710/4 "2003-02-17T23:49:47Z")

</div>

The above script that I posted is applied to a button or movieclip if that’s what you’re using to load the movie in, but if you want to place it on a certain frame then just remove the onrelease so that it will look like this:

```php
    _root.containerMC.loadMovie("external.swf");
    _root.containerMC._x = Stage.width/2;
    _root.containerMC._y = Stage.height/2;

```

---

<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: [February 18, 2003, 1:30am UTC](https://forum.kirupa.com/t/the-load-movie-script-in-mx/13710/5 "2003-02-18T01:30:07Z")

</div>

aight man, um i think im missing something. um, whats container mc and all that and do i have to change any code on it , and more importantly, like you said i want to add it to a frame but do i add it on the main sites swf or the side swf

im sorry but im now understanding all of it. thanks for helping out

---

<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: [February 18, 2003, 1:41am UTC](https://forum.kirupa.com/t/the-load-movie-script-in-mx/13710/6 "2003-02-18T01:41:22Z")

</div>

ContainerMC is the movieclip you’re gonna load the external swf into, I just used “containerMC” as an example, you can put whatever instance name you used. As for the code, if you’re gonna place it on the frame then it would be on the main movie since you’re loading the external swf into the main swf. I hope that clears it up a bit more.

---

<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: [February 18, 2003, 5:46pm UTC](https://forum.kirupa.com/t/the-load-movie-script-in-mx/13710/7 "2003-02-18T17:46:54Z")

</div>

now its working but now its on the bott right hand side. lol, one ? is the coding going to go on the movie frame or the main timeline frame???

and again thanks.
