# How do u rotate 360?

**URL:** <https://forum.kirupa.com/t/how-do-u-rotate-360/26535>\
**Category:** flash\
**Created:** [July 23, 2003, 10:41pm UTC](https://forum.kirupa.com/t/how-do-u-rotate-360/26535 "2003-07-23T22:41:27Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Spirit\_Z3RO](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@Spirit\_Z3RO](https://forum.kirupa.com/u/Spirit_Z3RO)\
**Post date:** [July 23, 2003, 10:41pm UTC](https://forum.kirupa.com/t/how-do-u-rotate-360/26535/1 "2003-07-23T22:41:27Z")

</div>

How do u make something rotate 360? Do you need a keyframe at 180? Or is there an easier way?

While i’m here

Claudio, thanks for everything u’ve helped me with as well as many others in Kirupa ^^

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 23, 2003, 10:42pm UTC](https://forum.kirupa.com/t/how-do-u-rotate-360/26535/2 "2003-07-23T22:42:35Z")

</div>

yes there is an easier way, you get swish

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 23, 2003, 10:43pm UTC](https://forum.kirupa.com/t/how-do-u-rotate-360/26535/3 "2003-07-23T22:43:48Z")

</div>

hahaha, but seriously, its a bit dificult but what you were saying with the keyframe at 180 is right

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 23, 2003, 10:53pm UTC](https://forum.kirupa.com/t/how-do-u-rotate-360/26535/4 "2003-07-23T22:53:46Z")

</div>

[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=29356](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=29356)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 23, 2003, 10:57pm UTC](https://forum.kirupa.com/t/how-do-u-rotate-360/26535/5 "2003-07-23T22:57:18Z")

</div>

if tweening on the timeline (which I suspect you are) select the first frame of the 2 keyframes in the rotation frames range and in the properties panel, select Tween: Motion, Rotation: Either CW (clockwise) or CCW (counter or anti-clockwise) and then next to that select how many times. For 360 degrees, its 1.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 23, 2003, 10:58pm UTC](https://forum.kirupa.com/t/how-do-u-rotate-360/26535/6 "2003-07-23T22:58:22Z")

</div>

hmmm. about the

"  
this.\_rotation = Number.POSITIVE\_INFINITY;  
"  
how do i make it rotate only once?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 23, 2003, 11:00pm UTC](https://forum.kirupa.com/t/how-do-u-rotate-360/26535/7 "2003-07-23T23:00:26Z")

</div>

> \*Originally posted by Spirit-Z3RO \*  
> \*\*hmmm. about the

"  
this.\_rotation = Number.POSITIVE\_INFINITY;  
"  
how do i make it rotate only once? \*\*

that was a joke 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 23, 2003, 11:16pm UTC](https://forum.kirupa.com/t/how-do-u-rotate-360/26535/8 "2003-07-23T23:16:32Z")

</div>

well, that sure got me. lol.

i was thinking, shouldnt it be this.\_rotation+= Number.(whatever positive number)\_Infinity

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 23, 2003, 11:42pm UTC](https://forum.kirupa.com/t/how-do-u-rotate-360/26535/9 "2003-07-23T23:42:24Z")

</div>

Number.POSITIVE\_INFINITY isnt _really_ a number. Its a constant value in Flash that is used to represent what infinity would be if it could be stored in a number. Technically, if you set the rotation of a clip to be infinity it would… well I cant imagine what it would do since infinity is forever. I suppose it would at that point in time try to rotate forever - which I could imagine is hard to do 😉

For scripted rotation, this.\_rotation += speed; is common where speed is just a regular number value for which the rotation is to change every frame. If speed was 1, the rotation of the this clip would only rotate by one degree every frame. You could set speed to 10 to make it rotate faster and more than that for even faster speed! Anything beyond 180 though would make it look like its going backwards since you move more than a half rotation in one frame making it seem like the direction taken (the shortest distance) was the other way around. Anything beyond 360 will start you back at 1 and greater as you are going a full circle and starting back where you started.

Anyway, with that method, to check to see if you’ve rotated a full 360 degrees, you can either use a counter, or just check to see if you’ve landed back on your original \_rotation with an if check. \<- that one might be hard to assume if you use a speed value which is something that when added together wont reach your initial \_rotation. Something like 100. 100+100 is 200. 200+100 is 300. 300+100 is 400. \<- right there you’ve past 360 and never really landed on 360 so it wont reach your orginal value, at least not until going around a couple of more times.

the counter is just finding out how many frames it takes for your speed to rotate a full 360 degrees. Once those number of frames have passed, stop rotation. That number is based on 360/speed. If your speed is 10, for example, it would take 36 frames to rotate a full 360 degrees (10 degrees for 36 frames = 10\*36 = 360). A simple counter variable can be kept to see if 36 frames have passed.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 23, 2003, 11:54pm UTC](https://forum.kirupa.com/t/how-do-u-rotate-360/26535/10 "2003-07-23T23:54:09Z")

</div>

[AS]onClipEvent (load) {  
speed = 18; // make sure 360 is divisible by speed value. Positive value rotates CW, negative CCW  
}  
onClipEvent (enterFrame) {  
this.onEnterFrame = function() {  
if (angle\>=360 || angle\<=-360) {  
delete this.onEnterFrame;  
} else {  
angle += speed;  
this.\_rotation = angle;  
}  
};  
}[/AS]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 24, 2003, 8:57am UTC](https://forum.kirupa.com/t/how-do-u-rotate-360/26535/11 "2003-07-24T08:57:15Z")

</div>

yay!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 24, 2003, 11:26am UTC](https://forum.kirupa.com/t/how-do-u-rotate-360/26535/12 "2003-07-24T11:26:52Z")

</div>

> \*Originally posted by claudio \*  
> \*\*[AS]onClipEvent (load) {  
> speed = 18; // make sure 360 is divisible by speed value. Positive value rotates CW, negative CCW  
> }  
> onClipEvent (enterFrame) {  
> this.onEnterFrame = function() {  
> if (angle\>=360 || angle\<=-360) {  
> delete this.onEnterFrame;  
> } else {  
> angle += speed;  
> this.\_rotation = angle;  
> }  
> };  
> }[/AS] \*\*

^you might want to take the onEnterFrame out of the … enterFrame. You can just define it in load or on the timeline.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 24, 2003, 11:27am UTC](https://forum.kirupa.com/t/how-do-u-rotate-360/26535/13 "2003-07-24T11:27:57Z")

</div>

okie dokie, thank you guys.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 24, 2003, 9:45pm UTC](https://forum.kirupa.com/t/how-do-u-rotate-360/26535/14 "2003-07-24T21:45:12Z")

</div>

oh i get it, i thought you ment like fliping it end over end. with the flip command and such. or what ever you want to call the thing “transform =\> flip horizontal/vertical”

see avatar

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 24, 2003, 11:01pm UTC](https://forum.kirupa.com/t/how-do-u-rotate-360/26535/15 "2003-07-24T23:01:35Z")

</div>

Thx for the tip senocular  
🙂
