l'errore è nell'utilizzo della variabile rx nel test
if (!(ry<=offset)) {

e quindi
Codice PHP:

MovieClip
.prototype.sposta = function(endYspeed) {
    
this.onEnterFrame = function() {
        var 
offset 0.5;
        var 
ry Math.abs(endY-this._y);
        
//Muovo il mc finche nn raggiunge la sua posizione finale e lo scalaggio desiderato
        
if (!(ry<=offset)) {
            var 
dy ry/speed;
            (
this._y<endY) ? this._y += dy this._y -= dy;
        } else {
            
//A spostamento completato e scalaggio desiderato elimino l'enterframe
            
delete this.onEnterFrame;
        }
    };
};