Skip to main content
June 2, 2017
Question

Referencing objects inside of tweens x,y

  • June 2, 2017
  • 1 reply
  • 241 views

Okay, here's the problem.

I have a motion tween with a symbol inside of it.

I need to know the x and y of the symbol inside without setting a name for the symbol inside.

How do I do this?

This topic has been closed for replies.

1 reply

Colin Holgate
Inspiring
June 2, 2017

Does the tween symbol have a name? Is this AS3 or Canvas?

I'll assume it's AS3, because motion tweens in Canvas is a bad idea. And I'll assume your tween symbol does have a name, say "mytweener". This would give you the x of the first symbol inside the tween symbol:

trace(mytweener.getChildAt(0).x);

Colin Holgate
Inspiring
June 2, 2017

By the way, if the inner symbol is not animating itself, its x and y won't change, even with the tweened symbol moving all over the place. If you need to know the stage x and y of the inner symbol, read up about localToGlobal(). With that you can find the stage x and y from the inner symbol's local x and y.

DisplayObject - Adobe ActionScript® 3 (AS3 ) API Reference