Marek Schubert
Marek Schubert

Reputation: 105

AS3 find x and y of a point in a rotated movieclip

I have movieclip with a point in it: .x = 20 .y = 20 when I do trace("x="_root.movieclip.point.x) it will trace x=20.

But if I rotate movieclip to 90 degres, x have to be -20, but it still traces x=20.

Is it possible to do that?

Thanks

Upvotes: 0

Views: 486

Answers (1)

Corey
Corey

Reputation: 5818

The point object is local to the MovieClip. If you change attributes of the MovieClip, the child Objects do not change in their "local" space. Much like if you moved the MovieClip to (100,100), the point Object will still be (20,20). You may be able to use the localToGlobal and/or globalToLocal methods to determine the point's modified position.

Upvotes: 3

Related Questions