views:

354

answers:

2

how to rotate an object 360 degree in as3 is any solution

+1  A: 

Your question is very unspecific, but this is a way to animate a full rotation for a sprite:

// in your contstructor or somewhere equivalent
addEventListener(Event.ENTER_FRAME, handleEnterFrame);

// then add this function somewhere suitable
private function handleEnterFrame(e:Event):void{
    objectToRotate.rotation += 1;
}
grapefrukt
You can use `(event.target as DisplayObject).rotation` instead of referring to a specific object.
nikc
A: 

(event.target as DisplayObject).rotation

This should really be ev.currentTarget.rotation as at times ev.target can refer to alternative object and cause errors. Plus this way, you correctly collecting the object 'as is' rather than trying to cast it to something it may not be.

For example - you could cast is as a DisplayObject (of which it is) but it may be a MovieClip.

Glycerine