Hi Eric,

Try out this code, should do the trick and show that localToGlobal does work
Run it once as is, then uncomment the rotation and see the results.

hth,

Rob



var sprite1:Sprite = new Sprite();
sprite1.graphics.beginFill(0x00ff00);
sprite1.graphics.drawRect(0,0,100,100);
sprite1.graphics.endFill();

var sprite2:Sprite = new Sprite();
sprite2.graphics.beginFill(0x0000ff);
sprite2.graphics.drawRect(0,0,10,10);
sprite2.graphics.endFill();

sprite1.addChild(sprite2);
sprite2.x = 90;
sprite2.y = 90;

addChild(sprite1);
sprite1.x=100;
sprite1.y=100;

//sprite1.rotation = 45;

trace(sprite1.localToGlobal(new Point(sprite2.x, sprite2.y)));


On 18-Jun-08, at 1:27 PM, eric e. dolecki wrote:

AS3. I have a MC I am rotating, and inside the MC I have a Sprite (affixed
to the bottom of the MC).

While rotating, I want to place another MC's x,y (each frame) on that
rotating MC. However the x,y never updates. I tried localToGlobal, but that doesn't seem to change either during the rotation. Can this be easily done?
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to