# Google earth effect in flash

**URL:** <https://forum.kirupa.com/t/google-earth-effect-in-flash/222120>\
**Category:** Uncategorized\
**Created:** [April 11, 2007, 12:39am UTC](https://forum.kirupa.com/t/google-earth-effect-in-flash/222120 "2007-04-11T00:39:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![indiasfinest](https://avatars.discourse-cdn.com/v4/letter/i/5e9695/32.png) [@indiasfinest](https://forum.kirupa.com/u/indiasfinest)\
**Post date:** [April 11, 2007, 12:39am UTC](https://forum.kirupa.com/t/google-earth-effect-in-flash/222120/1 "2007-04-11T00:39:01Z")

</div>

so i have a project for school that i am trying to get the “wow” effect for, im trying to make a virtual poster board with movies and sound files and all, but the real problem (at least for now) is to get the google earth. i used the distance formula and the calculating distance tutorial. i used the Pythagorean thyreom and for some reason it still does not work, i know the x and y axis is different in flash, and that is seriously throwing me off also, im confused a little bit on the fact that when im testing the movie, shouldnt by default \_root.\_x and \_root.\_y be the center? so anyways here is the script, if someone wouldnt mind helping it would be greatly appreciated.

```php

onClipEvent (enterFrame) {
    xdist = (_root._x - _root.cir2._x)
    ydist = (_root._y - _root.cir2._y)
    totaldistance = Math.round(Math.sqrt((xdist*xdist) + (ydist*ydist))) 
    }
onClipEvent (enterFrame) {
        if (_root._x - _root.cir2._x < 0) {this._x += totaldistance/35} else
    (_root._x -= totaldistance/35)
    {
        if (this._y - _root.cir2._y < 0) {this._x += totaldistance/70} else
    (this._y -= totaldistance/35)
    }
}

```
