|
-
Relaxing
Hello,
Is there a way to make a button go to a random frame? I mean when you click the button, one time you go to frame 20. The next time you run the program and click the same button, you go to frame 23, etc.
-
You can do it using action scripting available in KoolMoves. I will let someone else fill in the blanks or you can investigate simple action scripting commands.
-
Math.floor(Math.random()*x)
or
Math.round(Math.random()*x)
The complete script is
x=10
//x is the top value of the random number in this case we are going from 0-10
frame=Math.round(Math.Random()*x)
// Sets VAR frame as a random Number between o and x
GotoAndPlay(frame)
//Goto and Plays the random Frame
This script can go on a button (needs event handlers) or on a Frame.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|