# A diffrence from player 6 to 8

**URL:** <https://forum.kirupa.com/t/a-diffrence-from-player-6-to-8/163113>\
**Category:** Uncategorized\
**Created:** [September 19, 2005, 10:28pm UTC](https://forum.kirupa.com/t/a-diffrence-from-player-6-to-8/163113 "2005-09-19T22:28:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zimbot](https://avatars.discourse-cdn.com/v4/letter/z/9e8a1a/32.png) [@zimbot](https://forum.kirupa.com/u/zimbot)\
**Post date:** [September 19, 2005, 10:28pm UTC](https://forum.kirupa.com/t/a-diffrence-from-player-6-to-8/163113/1 "2005-09-19T22:28:48Z")

</div>

## I have this code that will work … when attched to a movie clip … in Flash Player 6 or less BUT it will NOT work if the player is Flash 8.

onClipEvent(load){  
homeX = this.\_x  
homeY = this.\_y  
magnet = 5000  
}  
onClipEvent(enterFrame){  
x0 = this.\_x  
y0 = this.\_y  
x1 = \_root.\_xmouse  
y1 = \_root.\_ymouse

distancex = x1-x0  
distancey = y1-y0  
distance = Math.sqrt((distancex \* distancex) + (distancey \* distancey))

powerx = this.\_x - (distancex / distance) \* magnet / distance  
powery = this.\_y - (distancey / distance) \* magnet / distance  
forcex = (forcex + (homex - x0) / 2) / 1.66  
forcey = (forcey + (homey - y0) / 2) / 1.66  
this.\_x = powerx + forcex  
this.\_y = powery + forcey  
}

* * *

so what in this code fails under 8?
