# Error

**URL:** <https://forum.kirupa.com/t/error/138443>\
**Category:** Uncategorized\
**Created:** [February 22, 2005, 6:57pm UTC](https://forum.kirupa.com/t/error/138443 "2005-02-22T18:57:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cardjorg](https://avatars.discourse-cdn.com/v4/letter/c/a183cd/32.png) [@cardjorg](https://forum.kirupa.com/u/cardjorg)\
**Post date:** [February 22, 2005, 6:57pm UTC](https://forum.kirupa.com/t/error/138443/1 "2005-02-22T18:57:45Z")

</div>

hi,  
can anyone tell me why this script works on flash player 6 but not in flash player 7  
The fla is also attached  
thanks 😉🙂

[AS]  
oldx = this.\_x;  
oldy = this.\_y;  
this.onPress = function() {  
this.startDrag();  
this.onEnterFrame = undefined;  
};  
this.onRelease = function() {  
snap();  
};  
snap = function () {  
for (var j = 0; j\<=\_parent.nDrags; j++) { // \_parent.nDrags determines the number of draggables  
if (this.hitTest(\_parent[“hit”+j])) { // \_parent[“hit”+j] are the target Clips  
this.onEnterFrame = undefined;  
this.\_x = \_parent[“hit”+x].\_x;  
this.\_y = \_parent[“hit”+x].\_y;  
break;  
} else {  
// if target clips are not hit, then go back to its orginal position  
this.onEnterFrame = function() {  
this.\_x += (oldx-this.\_x)/3;  
this.\_y += (oldy-this.\_y)/3;  
if ((this.\_x\>=(oldx-1)) && (this.\_x\<=(oldx+1)) && (this.\_y\>(oldy-1)) && (this.\_y\<(oldy+1))) {  
this.\_x = oldx;  
this.\_y = oldy;  
this.onEnterFrame = undefined;  
}  
};  
}  
}  
stopDrag();  
};

[/AS]
