# Changing Scenes

**URL:** <https://forum.kirupa.com/t/changing-scenes/34808>\
**Category:** flash\
**Created:** [November 6, 2003, 4:32pm UTC](https://forum.kirupa.com/t/changing-scenes/34808 "2003-11-06T16:32:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elracu](https://avatars.discourse-cdn.com/v4/letter/e/a8b319/32.png) [@elracu](https://forum.kirupa.com/u/elracu)\
**Post date:** [November 6, 2003, 4:32pm UTC](https://forum.kirupa.com/t/changing-scenes/34808/1 "2003-11-06T16:32:37Z")

</div>

The animation starts playing automatically (scene 1, frame 1) and then I have it stop on frame 35 (using the stop () ). At that point the viewer is supposed to navigate and click on one of the three buttons. Once that happens I would like for the rest of scene 1 to play out (all the way to frame 75) and then depending on what button was pressed skip to SCENE 2 (button 1), SCENE 3 (button 2) or SCENE 4 (button 3). So in essence what I need is an action script for each button that would have the following logic:

BUTTON 1: if this one is pressed play the rest of SCENE 1 and once you reach the end go to SCENE 2  
BUTTON 2: if this one is pressed play the rest of SCENE 1 and once you reach the end go to SCENE 3  
BUTTON 3: if this one is pressed play the rest of SCENE 1 and once you reach the end go to SCENE 4

[visual aid click here](http://www.lacarpaonline.com/question.gif)

or see attached gif

---

<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:** [November 6, 2003, 5:29pm UTC](https://forum.kirupa.com/t/changing-scenes/34808/2 "2003-11-06T17:29:04Z")

</div>

use this code for your buttons on frame 35.  
button 2:  
[AS]on (release) {  
GOTO = “two”;  
play();  
}[/AS]

button 3:

```auto

on (release) {
	GOTO = "three";
	play();
}

```

on frame 75, make a keyframe, and insert this code:  
[AS]gotoAndStop(GOTO);[/AS]

now, on the first frame of each of your scenes, make a frame label, that corresponds with that scene.

IE:  
scene2 = "two"  
scene3 = "three"  
scene4 = “four”

call them whatever you want, just make sure they are the same thing that you are using in the  
"GOTO = “two”" part of your code.

you could use something like  
GOTO = "links"  
but just make sure you add a frame label of “links” in one of your scenes.

that should do it!!!  
GOTO is just a variable we made in each of the links. When the movie gets to frame 75, it tells the movie to  
go to And Stop @ GOTO.  
it will look for a frame label, of GOTO, well since we made GOTO equal to “two”, or “three”, or “four”. I will look for a frame label called two (or three, or four, depending)

The thing about scenes, is that when flash exports your movie, it flattens all your scenes into one long timeline. IF you want to see this, when you test your movie in flash, go view -\> bandwidth profiler, and you will see your movie layed out. all the frames of all your scenes are there, and frame one of scene two may actually be the 13th frame of you movie.  
SO.  
if you are going to use scenes, make sure that you link to your scenes using frame labels, not (scene 1, frame 3)
