How to rotate a figure without moving around the stage(actionscript)

Posted by Mister PHP on Stack Overflow See other posts from Stack Overflow or by Mister PHP
Published on 2012-07-05T00:16:13Z Indexed on 2012/07/05 3:16 UTC
Read the original article Hit count: 130

Filed under:
|
package  {
    import flash.display.MovieClip;
    import flash.events.Event;
    public class Bullet extends MovieClip {
        private var mc:MovieClip;
        public function Bullet() {

            mc = new MovieClip();
            mc.graphics.beginFill(0);
            mc.graphics.drawRect(120, 120, 40, 40);
            mc.graphics.endFill();
            addChild(mc);
            addEventListener(Event.ENTER_FRAME, onEnterFrame);
        }

        private function onEnterFrame(e:Event):void{

            mc.rotation += 10;

        }

    }

}

how can i make the rotation of the circle without moving him around the stage, just staying in the place he was before and just rotate, not moving anywhere is that posible??

if you try this code you'll see that the circle is rotating and moving around the stage, so that i don't want, how can i change this?

© Stack Overflow or respective owner

Related posts about flash

Related posts about actionscript