Skip to main content
Participant
December 19, 2015
Question

How do you use buttons to pick random scenes and lock/unlock buttons?

  • December 19, 2015
  • 1 reply
  • 339 views

I'm new to flash and Actionscript and can't figure out how to do a couple of things?

1: How do you make it so if you click a button then it will send you to a random scene?

E.G. Click button on scene 1 to make it pick at random scene 2,3 or 4.

2: How to make is so that a button is locked and unable to be clicked until you have meet a requirement.

E.G. You have a scene with 3 buttons and you have to click button 1 + 2 and watch the scene that each button plays before it goes back to the scene with the 3 buttons and button 3 can now be clicked to view the scene from button 3.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
December 19, 2015

1.

btn.addEventListener(MouseEvent.CLICK,btnF);

function btnF(e:MouseEvent):void{

gotoAndPlay(1,Math.ceil(3*Math.random())+1);

}

2. btn.mouseEnabled=false