-
Wheel Rotation
how do you rotate a wheel from fast then slowly stops?
-
The ActionScript Master
Hoi
code: wheel.speed = 50;
wheel.onEnterFrame = function() {
this._rotation += wheel.speed;
wheel.speed--;
if (wheel.speed == 0) {
delete this.onEnterFrame;
}
};
Master64
useing:XP,MX
don't send me PM's because i never check it so if you what to contact me use Email
-
thanks man! how about rotating the wheel again by using a button. what should be the script on the button?
-
The ActionScript Master
hoi
don't under understand!
code:
wheel.speed = 50;
button_btn.onPress = function() {
_root.wheel._rotation += wheel.speed;
_root.wheel.speed--;
};
Master64
useing:XP,MX
don't send me PM's because i never check it so if you what to contact me use Email
-
didnt work, when i press the button, it should rotate like the one on the enterframe.. but it seems that it only rotates the wheel one by one while pressing..thanks again.. =) im newbie
-
it's like spinning a wheel/roulette.. click the button and let the wheel spin until it stops...
-
The ActionScript Master
ooh you what some thing like the
code:
wheel_mc.speed = 50;
_root.rotation = function() {
this._rotation += wheel_mc.speed;
wheel_mc.speed--;
if (wheel_mc.speed == 0) {
delete this.onEnterFrame;
}
};
button_btn.onPress = function() {
wheel.onEnterFrame = _root.rotation
}
just make a button called button_btn
and a movieClip wheel_mc
Master64
useing:XP,MX
don't send me PM's because i never check it so if you what to contact me use Email
-
-
hhmmm
Hi, if ur making a spinning wheel/roulette, i think u cant use only this script, cause it will allways stop at the same point...u need a ramdom action..
-
Maybe
Maybe adding that to the original Master64 code, u can get a ramdom speed at press, if u want it
----------------------------------------------------
wheel.speed = Math.round(Math.random()*30+ 50);
_root.rotation = function() {
this._rotation += wheel_mc.speed;
wheel_mc.speed--;
if (wheel_mc.speed == 0) {
delete this.onEnterFrame;
}
};
button_btn.onPress = function() {
wheel.onEnterFrame = _root.rotation
}
----------------------------------------------------
-
The ActionScript Master
Hoi
Your right but the wheel starts slowing down when the user clicks a button and unless the user can click at the same time ever time it is random!
Master64
useing:XP,MX
don't send me PM's because i never check it so if you what to contact me use Email
-
Hmm thats true, i didnt look at that..i was thinking on a button that starts a Stoped wheel, that rotates and stops again....(didnt check all the code, soz about that)...cause i imagined like those roullets things
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
|