Forum Topic: Rotation Help!

(257 views • 8 replies)

This topic is 1 page long.

<< < > >>
None

artville

Reply To Post Reply & Quote

Posted at: 7/12/06 06:40 AM

artville EVIL LEVEL 13

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...

None

Albert-93

Reply To Post Reply & Quote

Posted at: 7/12/06 06:42 AM

Albert-93 NEUTRAL LEVEL 07

Sign-Up: 03/30/06

Posts: 136

Key.idToggled think so


None

artville

Reply To Post Reply & Quote

Posted at: 7/12/06 06:42 AM

artville EVIL LEVEL 13

Sign-Up: 10/28/05

Posts: 1,808

At 7/12/06 06:42 AM, Albert_93 wrote: Key.idToggled think so

What does that mean???


None

Albert-93

Reply To Post Reply & Quote

Posted at: 7/12/06 06:45 AM

Albert-93 NEUTRAL LEVEL 07

Sign-Up: 03/30/06

Posts: 136

or
onEnterFrame(enterFrame){
if(Key.isDown(Key.LEFT)){
RotLeft = true;
RotRight = false;
}
if(RotLeft == true){
_rotation-=10;
}
}


None

artville

Reply To Post Reply & Quote

Posted at: 7/12/06 06:53 AM

artville EVIL LEVEL 13

Sign-Up: 10/28/05

Posts: 1,808

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...


None

DJStatika

Reply To Post Reply & Quote

Posted at: 7/12/06 07:12 AM

DJStatika NEUTRAL LEVEL 04

Sign-Up: 04/19/05

Posts: 43

onEnterFrame(enterFrame){
if(Key.isDown(Key.LEFT)){
_rotation-=10;
}
if(Key.isDown(Key.RIGHT)){
_rotation+=10;
}
}


None

Albert-93

Reply To Post Reply & Quote

Posted at: 7/12/06 07:23 AM

Albert-93 NEUTRAL LEVEL 07

Sign-Up: 03/30/06

Posts: 136

ohh, I readed wrong


None

icarus

Reply To Post Reply & Quote

Posted at: 7/12/06 07:30 AM

icarus EVIL LEVEL 12

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.


None

artville

Reply To Post Reply & Quote

Posted at: 7/12/06 08:17 AM

artville EVIL LEVEL 13

Sign-Up: 10/28/05

Posts: 1,808

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

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!