Frame 1
function spinWheel(myTarget) {
rotation = 0;
myRandom = 0;
_root.onEnterFrame = function () {
myTarget._rotation = myTarget._rotation + rotation;
};
slowdown = function () {
myTarget.onEnterFrame = function () {
rotation = rotation - _root.myRandom;
trace(_root.myRandom);
if (rotation <= 0) {
rotation = 0;
_root.clicker.gotoAndStop(1);
}
};
};
speedup = function () {
myTimer = getTimer();
myTarget.onEnterFrame = function () {
rotation++;
_root.clicker.gotoAndPlay("clickStart");
if (rotation >= 10) {
rotation = 10;
pauseTimer = getTimer();
timeTrace = pauseTimer - myTimer;
trace(timeTrace);
if (timeTrace > 4000) {
slowDown();
}
}
};
};
}
spinWheel(_root.box);
myButton1.onRelease = function () {
myRandom = Math.random() * 0.3;
if (myRandom <= 0.1) {
myRandom = 0.1;
}
trace(myRandom);
speedup();
};
Symbol 10 MovieClip Frame 1
stop();
Symbol 10 MovieClip Frame 3
gotoAndPlay (2);