all groups > flash actionscript > november 2007 >
You're in the

flash actionscript

group:

Please help for Registration point to a movieclip/sprite



Re: Please help for Registration point to a movieclip/sprite kglad
11/2/2007 12:00:00 AM
flash actionscript: to appear to control the registration point of line, make it a child or an
empty display object and offset it by -x,-y where x,y is your choice for the
apparent registration point. you can then control the parent object and it
will behave like your line with changed registration point.
Please help for Registration point to a movieclip/sprite IamRaj
11/2/2007 6:05:30 AM
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()
addChild(line);

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;

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

Re: Please help for Registration point to a movieclip/sprite IamRaj
11/3/2007 3:47:07 AM
Re: Please help for Registration point to a movieclip/sprite kglad
11/3/2007 6:49:05 AM
AddThis Social Bookmark Button