# I just can't get this globalToLocal!

**URL:** <https://forum.kirupa.com/t/i-just-cant-get-this-globaltolocal/199331>\
**Category:** flash\
**Created:** [September 1, 2006, 2:49pm UTC](https://forum.kirupa.com/t/i-just-cant-get-this-globaltolocal/199331 "2006-09-01T14:49:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevs102](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@stevs102](https://forum.kirupa.com/u/stevs102)\
**Post date:** [September 1, 2006, 2:49pm UTC](https://forum.kirupa.com/t/i-just-cant-get-this-globaltolocal/199331/1 "2006-09-01T14:49:42Z")

</div>

I think this is the answer I’m looking for.

Basically I have a “alert” box that pops up when an error accurs. Now my file is composed of this, basically I have a index.swf that is the shell, it loads in sub pages into a movie clip located say x:100 & y:100 (shouldn’t matter). The dialog box command to place it’s self center in the screen is:

```auto
 
this._x = Math.round((Stage.width-this.width)/2);
this._y = Math.round((Stage.height-this.height)/2);

```

This works fine if the alert box is in the index file, but when it’s in a sub page the location is screwy since it’s the movie is at x:100 y:100. I’m trying to find a way to make it center itself no matter what by converting the x&y coords.
