user2125012
user2125012

Reputation: 3

MovieClip coordinates

I am relatively new to actionscript but here is the dilemma I am currently having issues with. I currently have a large movieclip acting as a container. Inside this movieclip, I have a variety of other movieclips. I currently have my code moving the banner right or left depending on the position of the mouse. What I would like to do is get the coordinates of the child movieclips so I can manipulate certain animations when they reach a specific point on the screen. However, when i try accessing the X and Y variables by doing the following:

trace(movieClip_1.childMovieClip.x)

the values do not change since they are sticking to the local variables within the parent movieclip.

All help is greatly appreciated!

Upvotes: 0

Views: 124

Answers (1)

M4tchB0X3r
M4tchB0X3r

Reputation: 1531

try this!

var point:Point = new Point(childMovieClip.x, childMovieClip.y);
point = localToGlobal(point);
trace('Child coords: ' + point);

and take a look at the documentation -> localToGlobal

Upvotes: 1

Related Questions