so on my flash, I have parts where you have option which way to choose, and that road you choose should have randomization in them, and I am trying to build it so that when user chooses one road, he is thrown into one of the 3 labeled frames randomly, and I have even considered of adding some of the randomization parts a road that has most least chance to happen.
stop();
road1a.addEventListener(MouseEvent.CLICK, firstroadA);
function firstroadA(e:MouseEvent):void{
if(this.currentFrame == 9){
var randomNumber:Number = Math.floor(Math.random()*3)
if (randomNumer == 0){
gotoAndStop(10);
}
if (randomNumber == 1){
gotoAndStop(11);
}
if (randomNumber == 2){
gotoAndStop(12);
}
}
else{
nextFrame();
}
}
on this test, I have tried to do it so that the user“s choice happens in 9th frame, and when he chooses to click firstroadA he goes to some of the random frames, 10, 11 or 12... so, I hope I have been clear enough; my question is in a nutshell, how do I randomize the gotoAndStop frames, and how do I add some rare frames that has lesser chance to be chosen to gotoAndStop.... thank you!