# Another button problem. different buttons load same movie!

**URL:** <https://forum.kirupa.com/t/another-button-problem-different-buttons-load-same-movie/186934>\
**Category:** Uncategorized\
**Created:** [April 25, 2006, 1:59pm UTC](https://forum.kirupa.com/t/another-button-problem-different-buttons-load-same-movie/186934 "2006-04-25T13:59:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![will\_roberts](https://avatars.discourse-cdn.com/v4/letter/w/4da419/32.png) [@will\_roberts](https://forum.kirupa.com/u/will_roberts)\
**Post date:** [April 25, 2006, 1:59pm UTC](https://forum.kirupa.com/t/another-button-problem-different-buttons-load-same-movie/186934/1 "2006-04-25T13:59:11Z")

</div>

Hey again,

Ok so now i am having a new problem. i am using this code

```auto

stop();
this.portButton_mc.onRollOver = function() {
 portButton_mc.gotoAndPlay("_over");
}
this.portButton_mc.onRollOut = function() {
 portButton_mc.gotoAndPlay("_out");
}
this.portButton_mc.onPress = function() {
 if (currMovie == undefined) { 
currMovie = "andy"; 
container2.loadMovie("flash1.swf"); 
} else if (currMovie != "andy") { 
if (container2._currentframe >= container2.midframe) { 
currMovie = "andy"; 
container2.play(); 
} 
} 
}
this.portButton_mc2.onPress = function() {
 if (currMovie == undefined) { 
currMovie = "web"; 
container2.loadMovie("flash2.swf"); 
} else if (currMovie != "web") { 
if (container2._currentframe >= container2.midframe) { 
currMovie = "web"; 
container2.play(); 
} 
} 
}
this.portButton_mc2.onRollOver = function() {
 portButton_mc2.gotoAndPlay("_over");
}
this.portButton_mc2.onRollOut = function() {
 portButton_mc2.gotoAndPlay("_out");
}

```

Now for some reason when i test the movie using button 1 it will load the correct movie and then if i press button 2 it loads the same movie again ☹

And if i retest the movie and choose button 2 first it loads the correct movie but button one now repeats the same one!!

Please help, im about to die

---

<div class="post-metadata">

**Author:** ![JoshuaJonah](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joshuajonah/32/1775_2.png) [@JoshuaJonah](https://forum.kirupa.com/u/JoshuaJonah)\
**Post date:** [April 25, 2006, 2:02pm UTC](https://forum.kirupa.com/t/another-button-problem-different-buttons-load-same-movie/186934/2 "2006-04-25T14:02:46Z")

</div>

Use the AS tags, they make it alot easier to read ([as] & [/as] without the spaces)

```auto
stop();
this.portButton_mc.onRollOver = function() {
 portButton_mc.gotoAndPlay("_over");
}
this.portButton_mc.onRollOut = function() {
 portButton_mc.gotoAndPlay("_out");
}
this.portButton_mc.onPress = function() {
 if (currMovie == undefined) { 
currMovie = "andy"; 
container2.loadMovie("flash1.swf"); 
} else if (currMovie != "andy") { 
if (container2._currentframe >= container2.midframe) { 
currMovie = "andy"; 
container2.play(); 
} 
} 
}
this.portButton_mc2.onPress = function() {
 if (currMovie == undefined) { 
currMovie = "web"; 
container2.loadMovie("flash2.swf"); 
} else if (currMovie != "web") { 
if (container2._currentframe >= container2.midframe) { 
currMovie = "web"; 
container2.play(); 
} 
} 
}
this.portButton_mc2.onRollOver = function() {
 portButton_mc2.gotoAndPlay("_over");
}
this.portButton_mc2.onRollOut = function() {
 portButton_mc2.gotoAndPlay("_out");
}

```
