Here's a quick and easy example of time-line usage. Here's the idea: create a movie tween of the wheel with a CW rotation of 10 times over ~70 frames.
By the time that finishes create a string with a random number concatenated on the end of it. This string will be the flag to the frame with the corresponding ending animation.
At the end of the initial animation place this code on the last frame in the actions layer:
var ran:Number = Math.floor(Math.random() * 16) + 1; var frame:String = "prize" + ran; //trace(frame); // observability gotoAndPlay(frame);
The timeline is setup as follows: each animation will have a CW rotation of 1 time over ~24 frames. At the end of each animation the ending key frame will be where the wheel stops - corresponding prize flag - and a stop(); command so the time line will not progress into the next animation.
Here's what a piece of the time line will look like when a few animations are setup:
When you're finished with the animation installments, in order to play the game continuously just add a button to the stage (on every keyframe) and on the keyframe of where the button first appears(should be frame 1) just add this code:
Thank you for this!
I've edited it and it will be a great help to me.
I'm basically using it for a game like Dungeons and Dragons and we don't have any dice, so I'm just using this