# Global Coordinates VS Local Coordinates - Random Points in Movie Clip

**URL:** <https://forum.kirupa.com/t/global-coordinates-vs-local-coordinates-random-points-in-movie-clip/328538>\
**Category:** flash\
**Created:** [May 24, 2012, 1:23pm UTC](https://forum.kirupa.com/t/global-coordinates-vs-local-coordinates-random-points-in-movie-clip/328538 "2012-05-24T13:23:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Antonio\_Pereira](https://avatars.discourse-cdn.com/v4/letter/a/e19b73/32.png) [@Antonio\_Pereira](https://forum.kirupa.com/u/Antonio_Pereira)\
**Post date:** [May 24, 2012, 1:23pm UTC](https://forum.kirupa.com/t/global-coordinates-vs-local-coordinates-random-points-in-movie-clip/328538/1 "2012-05-24T13:23:36Z")

</div>

Hi everyone.

I need some help with a project i’m developing with Flash+ActionScript 3.

I have a map in a MovieClip (mcMapa), and it’s larger than the screen. So I use some functions to navigate throw it (pan) almost like Google Maps.

Then I have another MovieClip (the map marker) associated with a class (PinoJogador), and I want to put 4 markers inside my map in random points. I have a function to give me the points, and I have two type of errors:

1- When I create the marker objects PinoJogador, if I add them to the stage (stage.addChild) I have them inside the map, but when I do the pan they dont go along with the map (I understand why, but …).

2 - When I create the marker objects and add them to the mcMapa (mcMapa.addchild), they will never appear inside the map (they appear at the right of it).

What I want is to put the 4 random markers inside the map and they stay still in the points when i pan the map. I know the problem is in local/global coordinates, but I just cant understand what to do.

Here’s a link of what I’ve done: [http://dl.dropbox.com/u/38177989/Jogo%20NJI.zip](http://dl.dropbox.com/u/38177989/Jogo%20NJI.zip)

Help me please … I’m not used to Flash since 2004.

Thanks in advance.
