Error

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 :wink: :slight_smile:

[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]