Hola, estoy intentando hacer un rompecabezas mediante las funciones de arrastrar y pegar, pero no queda bien... son 6 piezas del rompecabezas hasta el momento solo tengo dos con programación porque al agregar una mas marca error, no se a que se deba, además solamente empieza a funcionar si se mueven las piezas en orden, la 1 primero, la dos despues y no de forma aleatoria. :crap:
Este es el codigo que tengo en escena:

clip1inicioX = mc1._x;
clip1inicioY = mc1._y;
//
MovieClip.prototype.mover = function(x, y) {
this.velocidad = 2;
this.x = x;
this.y = y;
this.onEnterFrame = function() {
// movimiento con deceleración
// usando la formula:
// objeto.propiedad=(objeto.propiedad+velocidad*objeto.propiedad)/velocidad+1
this._x = (this.x+this.velocidad*this._x)/(this.velocidad+1);
this._y = (this.y+this.velocidad*this._y)/(this.velocidad+1);
// detener onEnterFrame cuando se aproxima a su destino
// esto lo hago calculando la diferencia entre la posición
// destino y la actual.
if (Math.abs(Math.round(this.x)-Math.round(this._x)) == 1) {
this._x = this.x;
this._y = this.y;
delete this.onEnterFrame;
}
};
};
// -- arrastrar
mc1.onPress = function() {
this._alpha = 50;
this.gotoAndStop("arrastrar");
startDrag(this);
};
// -- soltar
mc1.onRelease = mc1.onReleaseOutside=function () {
stopDrag();
this._alpha = 100;
// si mc1 se encuentra sobre el área de mc2 pegar
if (this.hitTest(_root.mc2)) {
this.mover(mc2._x, mc2._y);
this.gotoAndStop("pegar");
} else {
this.mover(clip1inicioX, clip1inicioy);
this.gotoAndStop("soltar");
}

clip3inicioX = mc3._x;
clip3inicioY = mc3._y;
//
MovieClip.prototype.mover = function(x, y) {
this.velocidad = 2;
this.x = x;
this.y = y;
this.onEnterFrame = function() {
// movimiento con deceleración
// usando la formula:
// objeto.propiedad=(objeto.propiedad+velocidad*objeto.propiedad)/velocidad+1
this._x = (this.x+this.velocidad*this._x)/(this.velocidad+1);
this._y = (this.y+this.velocidad*this._y)/(this.velocidad+1);
// detener onEnterFrame cuando se aproxima a su destino
// esto lo hago calculando la diferencia entre la posición
// destino y la actual.
if (Math.abs(Math.round(this.x)-Math.round(this._x)) == 1) {
this._x = this.x;
this._y = this.y;
delete this.onEnterFrame;
}
};
};
// -- arrastrar
mc3.onPress = function() {
this._alpha = 50;
this.gotoAndStop("arrastrar");
startDrag(this);
};
// -- soltar
mc3.onRelease = mc3.onReleaseOutside=function () {
stopDrag();
this._alpha = 100;
// si mc3 se encuentra sobre el área de mc4 pegar
if (this.hitTest(_root.mc4)) {
this.mover(mc4._x, mc4._y);
this.gotoAndStop("pegar");
} else {
this.mover(clip3inicioX, clip3inicioy);
this.gotoAndStop("soltar");
}
};

};