USERNAME:
PASSWORD:
Save Info!
Logging in…
This topic is 1 page long.
[ Profile | Posts | Contact ]
Posted at: 7/12/06 06:40 AM
Sign-Up: 10/28/05
Posts: 1,808
So I have this movieclip which i want to rotate when i press a key.. Let's say i'm using left.. So when i press left i want it to continously rotate when i'm pressing the key.. How can i do this.. This is my old code:
onClipEvent (enterFrame) { if(Key.isDown(Key.LEFT)) this._rotation=-5; }
I know i'm a noob...
Posted at: 7/12/06 06:42 AM
Sign-Up: 03/30/06
Posts: 136
Key.idToggled think so
At 7/12/06 06:42 AM, Albert_93 wrote: Key.idToggled think so
What does that mean???
Posted at: 7/12/06 06:45 AM
or onEnterFrame(enterFrame){ if(Key.isDown(Key.LEFT)){ RotLeft = true; RotRight = false; } if(RotLeft == true){ _rotation-=10; } }
Posted at: 7/12/06 06:53 AM
At 7/12/06 06:45 AM, Albert_93 wrote: or onEnterFrame(enterFrame){ if(Key.isDown(Key.LEFT)){ RotLeft = true; RotRight = false; } if(RotLeft == true){ _rotation-=10; } }
Well, thanks Albert.. that code worked pretty well.. But how do i get it to stop... I can't seem to figure it out...
Posted at: 7/12/06 07:12 AM
Sign-Up: 04/19/05
Posts: 43
onEnterFrame(enterFrame){ if(Key.isDown(Key.LEFT)){ _rotation-=10; } if(Key.isDown(Key.RIGHT)){ _rotation+=10; } }
Posted at: 7/12/06 07:23 AM
ohh, I readed wrong
Posted at: 7/12/06 07:30 AM
Sign-Up: 01/10/05
Posts: 712
I'm prettey sure it's as simple as changing: this._rotation=-5; to: this._rotation-=5;
That should work fine.
AS2:Main AS3:Main
Posted at: 7/12/06 08:17 AM
Yep.. Everythings alright now... Thanks for your help guys..
love the bbs!
All times are Eastern Standard Time (GMT -5) | Current Time: 08:27 AM
<< Back