# Buttons

**URL:** <https://forum.kirupa.com/t/buttons/186490>\
**Category:** Uncategorized\
**Created:** [April 21, 2006, 4:55pm UTC](https://forum.kirupa.com/t/buttons/186490 "2006-04-21T16:55:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Icy\_Penguin](https://avatars.discourse-cdn.com/v4/letter/i/f6c823/32.png) [@Icy\_Penguin](https://forum.kirupa.com/u/Icy_Penguin)\
**Post date:** [April 21, 2006, 4:55pm UTC](https://forum.kirupa.com/t/buttons/186490/1 "2006-04-21T16:55:05Z")

</div>

hi,  
i was looking for the tutorial that shows you how to make a button that you clicked go to a different frame while all the others are different (and once you click a different button, the other button goes back to ‘normal’ and the other button whose movie is loaded goes to the other frame)?

(sort of like the external .swf transitions im assuming but for buttons

:pirate3:

edit: also, if i have an external swf that i have buttons that load movies in my main .fla, how do i change the paths on the buttons? (heres the code)

on (release) {  
if (\_root.currMovie == undefined) {  
\_root.currMovie = “main”;  
container.loadMovie(“main.swf”);  
} else if (\_root.currMovie != “main”) {  
if (container.\_currentframe \>= container.midframe) {  
\_root.currMovie = “main”;  
container.play();  
}  
}  
}

what do i put instead of “main” and “main.swf”?

---

<div class="post-metadata">

**Author:** ![jdesign](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@jdesign](https://forum.kirupa.com/u/jdesign)\
**Post date:** [April 22, 2006, 12:51am UTC](https://forum.kirupa.com/t/buttons/186490/2 "2006-04-22T00:51:59Z")

</div>

i don’t get your Question 100% but this is what i understand:  
The code  
on (release) {  
if (\_root.currMovie == undefined) {  
\_root.currMovie = “main”;  
container.loadMovie(“main.swf”);  
} else if (\_root.currMovie != “main”) {  
if (container.\_currentframe \>= container.midframe) {  
\_root.currMovie = “main”;  
container.play();  
}  
}  
}

is a code in a button placed in different swf?  
I think this code only loads main.swf

//after button is pressed  
on (release) {  
// if no movie is loaded  
if (\_root.currMovie == undefined) {  
//set the path of your movie to \_root.main  
\_root.currMovie = “main”;  
//Load main.swf to \_root.main. (so it’s \_root.main.main.swf)  
container.loadMovie(“main.swf”);  
// if \_root.main is not \_root.main  
} else if (\_root.currMovie != “main”) {  
// if \_root.container is something else and playing in the mid frame  
if (container.\_currentframe \>= container.midframe) {  
// set \_root. to \_root.main  
\_root.currMovie = “main”;  
// play main.swf  
container.play();  
}  
}  
}

If you just want to load movie with each button the code doesn’t need to be that complicated

EG.  
//on button release  
on (release) {  
// load movie in mianswf, in a Movieclip with an instance name of main  
loadMovie(“main.swf”, \_root.main);  
}

---

<div class="post-metadata">

**Author:** ![Icy\_Penguin](https://avatars.discourse-cdn.com/v4/letter/i/f6c823/32.png) [@Icy\_Penguin](https://forum.kirupa.com/u/Icy_Penguin)\
**Post date:** [April 22, 2006, 2:10am UTC](https://forum.kirupa.com/t/buttons/186490/3 "2006-04-22T02:10:17Z")

</div>

actually i thinks i got it now

that code is actually for the transitions anyway

but tahnks :dog:
