Skip to main content
March 8, 2013
解決済み

Is it possible to make a button go to 1 of 3 scenes?

  • March 8, 2013
  • 返信数 2.
  • 832 ビュー

Is it possible to make a button go to 1 of 3 scenes? I'm making a animation and I need it to when you click the button it go to 1 of the 3 scenes for that button but it chooses 1 of those 3 scenes randomly. I'm new to actionscript, I do not know what I'm doing.

このトピックへの返信は締め切られました。
解決に役立った回答 kglad

label the first frame of each scene (eg, "frame1_scene1", "frame1_scene2" etc);

then you can use:

btn.onRelease=function(){

_root.gotoAndPlay("frame1_scene"+Math.ceil(3*Math.random()));

}

返信数 2

Ned Murphy
Legend
March 8, 2013

You can, but if you have the option of not using scenes you should do it.  Scenes and navigation tend to not mix well.

kglad
Community Expert
kgladCommunity Expert解決!
Community Expert
March 8, 2013

label the first frame of each scene (eg, "frame1_scene1", "frame1_scene2" etc);

then you can use:

btn.onRelease=function(){

_root.gotoAndPlay("frame1_scene"+Math.ceil(3*Math.random()));

}

March 8, 2013

Do I need to put anything into the parenthese?