View Full Version : Problem with actionscript
Silverbullet
11-09-2005, 11:07 AM
My apologises if this is in the wrong forum.
I'm having a problem with the action script for flashmxpro. I'm trying to make my buttons go to random scenes. Like press the button go to scene 5 ect.
I understand how to go forward and back between scenes.
As the pro version doesn’t have a drop down menu, which you can use to make buttons go to, a certain scene (it wrote the action script for you) like in the previous version. Can any one help me?
saumya
11-09-2005, 12:35 PM
Hi Silverbullet,
welcome to the forum. You are absolutely on the right forum.
Now, as far as your problem goes, you can not do that at one go.I mean to say there is not a method on flash which will take you to different scenes.Because scenes are now history.All you have to do is play with movieclips.Well, but for now what to do?i have already scenes in place!!!!Ok.the good news is you can play with labels.So just add differents labels at the beginning of a new scene.Now put all those names inside an array and chose a random number between 0 and the max length of that array.Depending upon that number send your play head to that particular label.That way you will be moving arround to all your scenes.
hope you got me :)
Silverbullet
11-09-2005, 12:46 PM
What I really need to know is the action script.
on (release) '{'
gotoAndPlay("scene 5" 1);
}
I believe I got this wrong here, can you give me an example of how it should be? It's just so I can do all the 5 scenes and you can press all the different buttons to get to each. :)
Should've put this in the top post, sorry about that.
saumya
11-09-2005, 12:56 PM
on (release) '{'
gotoAndPlay(myRandomLabel );
}
now "myRandomLabel" will be getting values from an array of labelslike
myLabels=["firstScene","secondScene","thirdScene"]
all these labels must be labeled in your scenes' first frame.I hope, you know, how to label a frame.
then make a variable which will get random number from 0 to 2.According to that get the value from "myLabels"array.
vBulletin v3.5, Copyright ©2000-2010, Jelsoft Enterprises Ltd.