PDA

View Full Version : variables and else ifs


wsteveb
09-03-2001, 04:54 PM
This must be dead simple for most of you but I just cannot get this simple routine to work.
I have a variable named "go". At frame 20 I have 5 buttons and clicking each one changes the variable "go" to one of 5 different values i.e.:
Button 1: "mm"
Button 2: "corp"
Button3: "mz"
Button4: "mu"
Button5: "mo"

On releasing any of the buttons the movie moves on to a short animation and at the end of the animation I have a frame script that uses the if else statement to check the value of the variable go and then to play the appropriate scene (there are 5 scenes, each one named with one of the 5 names above ie "mm" etc.

What is the correct way to accomplish this?

Jesse
09-04-2001, 08:35 AM
You can't dynamically call a scene. But you can with labels. So make the first frame of each scene a label with the names above. Then you don't need to use if else. you just make the last frame say:
_root.gotoAndStop(_root.go);
remember label names can only begin with lower-case letters.. no numbers of anything.