all groups > flash actionscript > march 2005 >
You're in the

flash actionscript

group:

Goto a random scene?



Goto a random scene? FuzzMasterX
3/27/2005 6:23:04 PM
flash actionscript: Alright, I'm using the NG Loader, and I know my coding is totally wrong, but...
on (release) { GoToAndPlay('1',random(4)+1); } I'm trying to make it goto a
random scene (Got five or so) And that doesn't work. What's the correct way?
Re: Goto a random scene? kglad
3/27/2005 6:30:26 PM
scene information only exists in the authoring environment so you can't use
scene info for navigation. to remedy, give your frames labels and use those
labels for navigation. for example:

frameA=["scene1_frame1","scene2_frame1",...,"scene4_frame1"];
yourBtn.onRelease=function(){
_root.gotoAndPlay(frameA[Math.floor(frameA.length*Math.random())]);
}

p.s. case counts (usually) in flash.
Re: Goto a random scene? FuzzMasterX
3/27/2005 6:33:56 PM
Re: Goto a random scene? kglad
3/27/2005 8:35:29 PM
AddThis Social Bookmark Button