How do u rotate 360?

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

yes there is an easier way, you get swish

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

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

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.

hmmm. about the

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

*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 :wink:

well, that sure got me. lol.

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

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 :wink:

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.

[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]

yay!

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

okie dokie, thank you guys.

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

Thx for the tip senocular
:slight_smile: