|
|
|||||||
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Aug 2000
Posts: 473
|
right what it is, i have a circle split into difrent coloured sections with an arrow in the middle....when i click a button i want the arrow to spin and then slow down and randomly stop at a colourd section...
whats the easiest way to do this..?? thanks |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Jul 2000
Location: Not on the dole any more
Posts: 1,040
|
First, in your button (this assumes that your arrow has the instance name 'arrow'):
Code:
on (release) {
if (!_root.arrow.spinning) {
_root.arrow.spinning = 1;
_root.arrow.speed = (math.random()*20)+30;
}
}
Code:
onClipEvent (load) {
friction = 1.1;
rot = 0;
}
onClipEvent (enterFrame) {
if (spinning) {
rot += speed;
this._rotation = rot;
speed /= friction;
if (speed <= .1 && spinning) {
spinning = 0;
// *** Your actions for when the arrow stops spinning go here ***
}
}
}
[Edited by Stickman on 07-05-2001 at 09:16 AM] |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Jul 2000
Location: Not on the dole any more
Posts: 1,040
|
Oops -- just made a minor change to make the initial spin speed random...
|
|
|
|
![]() |
|
||||||
| Thread Tools | |
| Display Modes | |
|
|