Question

Basically, my problem is that I spawn a movieclip at coordinates where the mouse is clicked, then the movieclip is set to fall to a certain point, which is about to y=400.

The problem is that it takes the point where it spawned as the 0,0 coordinate and does it's actions using it. For an example, if I'd click at coordinates of 250y, it would fall to 650y. Is there a method where I can take the stage coordinates and use them in the movieclip, locally?

Also, I have another problem, which I haven't gotten around at fixing yet. My movieclips are set to highlight when they're hovered over with the mouse, but they are moving to the right at a constant speed. The problem is that the place where I have to hover over to highlight the movieclip doesn't change.

Was it helpful?

Solution

You would be interested in globalToLocal and localToGlobal methods on display object.

where globalToLocal(point) would transform the point to local coordinates. In your case the point is the stage x and stage y of the mouse event.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top