3 Replies Latest reply on Nov 2, 2007 11:49 PM by kglad

    Please help for Registration point to a movieclip/sprite

      I am new to AS3 and have a doubt on Registration point for Movie clip / Sprite. Please help me the sample code for this

      I simply draw a line using AS3 in flash environment. but i used graphics.moveTo for center. but if i run this it is simply taking x,y axis 0,0 and move around the stage. I want to move this from center of the stage. please help.

      below is my code

      var line:Sprite = new Sprite()

      var cx:Number = stage.stageWidth/2;
      var cy:Number = stage.stageHeight/2;

      var radius:Number = 1;
      var increase:Number = 0;

      line.graphics.lineStyle(1, 0xff00ff);

      line.addEventListener(Event.ENTER_FRAME, onEnter);

      function onEnter(event:Event):void
      increase += radius;

      //line.graphics.moveTo(cx, cy);
      line.graphics.lineTo(cx + increase, cy + increase);
      line.rotation += 0.1;