# Loadmovie prob

**URL:** <https://forum.kirupa.com/t/loadmovie-prob/19762>\
**Category:** Uncategorized\
**Created:** [May 1, 2003, 9:54am UTC](https://forum.kirupa.com/t/loadmovie-prob/19762 "2003-05-01T09:54:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JuXtA](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@JuXtA](https://forum.kirupa.com/u/JuXtA)\
**Post date:** [May 1, 2003, 9:54am UTC](https://forum.kirupa.com/t/loadmovie-prob/19762/1 "2003-05-01T09:54:58Z")

</div>

The first prob I had was when i used the load movie command the swf file was loading in the wrong position, it kept loading down and across the page. I had

```php

_root.myemp.loadMovie("banner.swf", 0);

```

I dont know why this is happening but I just fixed this by doing:  
\_root.myemp.\_x = 0  
\_root.myemp.\_y = 0

The next problem Im having is that I want to change the frame depending on which button was pressed. If button two was pressed I wanted to load “banner.swf” and gotoAndStop(“pg2”), If button three is pressed gotoAndStop(“pg3”)  
Ive tried some things but cant get this part right such as:  
\_root.myemp.gotoAndStop(“pg2”)  
“banner.swf”.gotoAndPlay

I just dont know the syntax… any help is greatly appriciated

---

<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:** [May 1, 2003, 10:18am UTC](https://forum.kirupa.com/t/loadmovie-prob/19762/2 "2003-05-01T10:18:47Z")

</div>

Hi JuXtA,  
Couple of things, if myemp is an mc on the \_root timeline, your swf will load into where ever you place, it manually or with code. Second, where is the code:

[AS]\_root.myemp.loadMovie(“banner.swf”, 0);[/AS]

coming from, if it is on the \_root, no need to use \_root.

With regards to your problem, try this :  
First on the \_root timeline declare a var, call it anything you like

[AS]var pg[/AS]  
sounds OK, then when you click a button to load the movie in, increase the var accordingly, like this :

[AS] on(release){  
pg = 1;  
myemp.loadMovie("banner.swf"1);  
}  
//second button  
on(release){  
pg = 2;  
myemp.loadMovie(“banner.swf”,1)  
}  
//and so on depending on how many buttons and frames  
//you have[/AS]

on frame1 of the \_root of banner.swf put this code

[AS] gotoAndStop(“framelabel” +\_root.pg);[/AS];

Hope that helps

SteveD

---

<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:** [May 1, 2003, 10:37am UTC](https://forum.kirupa.com/t/loadmovie-prob/19762/3 "2003-05-01T10:37:59Z")

</div>

thanks SteveD helps a lot, worked perfectly. Now onto reducing my code a bit.
