Yep. You will have to instantiate a point object with the x and y properties
of your sprite, apply any localToGlobal/globalToLocal changes*, and then set
your sprite's x (and y) to the new point's x and y.

Once you do this a few times it might be time to write yourself a few helper
functions - ex. a function that takes a sprite and global x and global y and
positions the sprite, for example.

-jonathan

*The way I'm writing this makes it sound like the localToGlobal() function
alters the point it's passed, when actually I think it returns a new altered
point. Don't get caught by this.

On Thu, Feb 25, 2010 at 7:04 AM, Lehr, Theodore
<[email protected]>wrote:

> hmmm unless I am misunderstanding localToGlobal seems to relate to points -
> not sprites....
>
> ________________________________________
> From: [email protected] [
> [email protected]] On Behalf Of Henrik Andersson [
> [email protected]]
> Sent: Tuesday, February 23, 2010 4:03 PM
> To: Flash Coders List
> Subject: Re: [Flashcoders] Using parent Sprites coordinates
>
>  Lehr, Theodore wrote:
> > Is there a way to have a child sprite reference the parent sprite when
> seeting it's x and y.... say I have a Sprite:
> >
>
> You must have missed localToGlobal and globalToLocal.
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>



-- 
-jonathan howe
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to