Hi
Is there a way to centre or for that matter change the registration point of a dynamically loaded movieClip.
It is pretty simple to do it on stage, but in pure as3, there seems to be no obvious way.
Thanks
you can use changeRegPt to change the registration point of any displayobject:
changeRegPt(mc,mc.width/2,mc.height/2);
function changeRegPt(dobj:DisplayObjectContainer,x:Number,y:Number){
var r:Rectangle = dobj.getBounds(dobj);
for(var i:uint=0;i<dobj.numChildren;i++){
dobj.getChildAt(i).x -= r.x+x;
dobj.getChildAt(i).y -= r.y+y;
}
dobj.x += r.x+x;
dobj.y += r.y+y;
}
North America
Europe, Middle East and Africa
Asia Pacific