# Button / actionscript help

**URL:** https://forum.kirupa.com/t/button-actionscript-help/20948
**Category:** Uncategorized
**Created:** [May 15, 2003, 1:49am UTC](https://forum.kirupa.com/t/button-actionscript-help/20948 "2003-05-15T01:49:32Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![luthadageek](https://avatars.discourse-cdn.com/v4/letter/l/e56c9b/32.png) [@luthadageek](https://forum.kirupa.com/u/luthadageek)
#### Post date: [May 15, 2003, 1:49am UTC](https://forum.kirupa.com/t/button-actionscript-help/20948/1 "2003-05-15T01:49:32Z")

</div>

Is there a way to take a button, tell it to goto a specific scene, play the frames in that scene, then goto another specific scene… not in linear order… this way i can use the same transition scene for multiple buttons and still go to the scene i want the button to goto in the end ???

some thing like

if “button a” is pressed it goes to the “transition scene” then to “scene a”

if “button b” is pressed it goes to the “transition scene” then to “scene b”

so on and so forth…

I’m a reletive newbie at this … and i’m having trouble thinking up a solution based on my knowledge.

thanks

Lutha:skull: :skull: :skull:

---

<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 15, 2003, 2:04am UTC](https://forum.kirupa.com/t/button-actionscript-help/20948/2 "2003-05-15T02:04:50Z")

</div>

I think it would be better to use a “transition movieclip” instead of a scene.

Run a search in this section for “transitions”

---

<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 15, 2003, 2:09am UTC](https://forum.kirupa.com/t/button-actionscript-help/20948/3 "2003-05-15T02:09:27Z")

</div>

I don’t know if this is the best way to do it, but I just used something of that nature and it worked for me. In your actions, define a variable. At the end of your ‘transition scene’, put if statements on your timeline to tell it where to go:  
on your first button:  
[AS]  
on(press){  
var loc=1;  
gotoAndPlay(“transition scene”);  
}  
[/AS]  
then on your timeline at the end of the transition scene:  
[AS]  
if(loc==1){  
gotoAndPlay(“scene a”);  
}  
if(loc==2){  
gotoAndPlay(“scene b”);  
}  
[/AS]

If that’s wrong, I hope someone chimes in so I can fix mine (teehee). I’m sure you could also do it with an array somehow.  
Hope that helps!  
(-:

---

<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 15, 2003, 2:09am UTC](https://forum.kirupa.com/t/button-actionscript-help/20948/4 "2003-05-15T02:09:28Z")

</div>

i ddint find anything that looked like it would help me … nothing about transition movie clips …

---

<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 15, 2003, 2:10am UTC](https://forum.kirupa.com/t/button-actionscript-help/20948/5 "2003-05-15T02:10:41Z")

</div>

so the variablie would be the name of the button instance ?

---

<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 15, 2003, 2:17am UTC](https://forum.kirupa.com/t/button-actionscript-help/20948/6 "2003-05-15T02:17:41Z")

</div>

No, the buttons wouldn’t need instance names. Make a button, select it, right click on it and select actions. The actions window will open, that’s where you put the code. That ‘loc’ variable can be whatever you want. It’s just set so when the movie gets to the actions on the frame in the timeline, Flash will know where to go depending on what button was pressed (and what loc equals). This should help too, it’s a little different than what I did, but it’s a little better and there’s a tut:

[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=19107&highlight=mask](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=19107&highlight=mask)

---

<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 15, 2003, 2:23am UTC](https://forum.kirupa.com/t/button-actionscript-help/20948/7 "2003-05-15T02:23:25Z")

</div>

ok i think i understand now… im going ot test it out tommorw.  
sicne its late for me to really do this and think. thanks for hte help ill let u know how it works out. if anyone else has ideas still, lemme knwo !

---

<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 15, 2003, 3:31am UTC](https://forum.kirupa.com/t/button-actionscript-help/20948/8 "2003-05-15T03:31:42Z")

</div>

OH yeah!! I forgot. I helped someone with that problem before. I didn’t do exactly what he was talking about, but the fla that I posted does something remarkably simular to what you want. It’s in here:

[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=21414](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=21414)

Boom  
:beam:

---

<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 15, 2003, 5:41pm UTC](https://forum.kirupa.com/t/button-actionscript-help/20948/9 "2003-05-15T17:41:52Z")

</div>

Freddy ! worked out marvelously t hanks !

---

<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 15, 2003, 10:04pm UTC](https://forum.kirupa.com/t/button-actionscript-help/20948/10 "2003-05-15T22:04:05Z")

</div>

Bueno - glad I could help!  
(-:
