Делаем мувик с 10 кадрами вытаскиваем на сцену и обзываем spin , достаём две кнопки stop_btn и play_btn и в первый кадр рута пихаем код

Код:
F_moveSpin = function () {
spin.onEnterFrame = function() {
if (_root.detect == this._currentframe) {
this.stop();
_root.detect = 0;
delete this.onEnterFrame;
}
};
};
play_btn.onPress = function() {
spin.play();
};
stop_btn.onPress = function() {
detect = random(9)+1;
F_moveSpin();
};