-1

I want that my button randomly goes to any frame between the frames 640 and 700 ?

This my code :

on (press){

    gotoAndPlay(random(700)+641);

}
akmozo
  • 9,829
  • 3
  • 28
  • 44
ITstud
  • 1
  • 3

1 Answers1

1

For that you can generate a random number between 0 and 60 and then add 640 :

var frame:Number;

on (press){

    frame = Math.floor(Math.random() * 61) + 640; 
    gotoAndPlay(frame);

}

Hope that can help.

akmozo
  • 9,829
  • 3
  • 28
  • 44