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
2010-03-05 11:54:50
You can use `(event.target as DisplayObject).rotation` instead of referring to a specific object.
nikc
2010-03-05 12:05:42
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
2010-03-11 14:30:31