Hola a todos, pues tengo un problema con u puzzle, y como soy nuevo en esto del flash as, pues no se como hacer lo siguiente.
tengo el codigo para un puzzle, que consiste en arrastrar las respuestas a las imagenes que representan la respuesta corecta.
funciona a traves de enlazar instancias mc. El puzzle funciona de maravilla, pero quiero que cuando todas las repuestas estčn en su lugar aparezca un texto como felicidades o bien hecho.
cualquier ayuda se las agradecerč aqui les edj el codigo
[color=#3465A4]clip1inicioX = mc1._x;
clip1inicioY = mc1._y;
//
MovieClip.prototype.mover = function(x, y) {
this.velocidad = 2;
this.x = x;
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.mc31)) {
this.mover(mc31._x, mc31._y);
this.gotoAndStop("pegar");
} else {
this.mover(clip1inicioX, clip1inicioy);
this.gotoAndStop("soltar");
}
};
clip2inicioX = mc12._x;
clip2inicioY = mc12._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
mc12.onPress = function() {
this._alpha = 50;
this.gotoAndStop("arrastrar");
startDrag(this);
};
// -- soltar
mc12.onRelease = mc1.onReleaseOutside=function () {
stopDrag();
this._alpha = 100;
// si mc1 se encuentra sobre el área de mc2 pegar
if (this.hitTest(_root.mc50)) {
this.mover(mc50._x, mc50._y);
this.gotoAndStop("pegar");
} else {
this.mover(clip2inicioX, clip2inicioy);
this.gotoAndStop("soltar");
}
};
clip3inicioX = mc13._x;
clip3inicioY = mc13._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
mc13.onPress = function() {
this._alpha = 50;
this.gotoAndStop("arrastrar");
startDrag(this);
};
// -- soltar
mc13.onRelease = mc13.onReleaseOutside=function () {
stopDrag();
this._alpha = 100;
// si mc1 se encuentra sobre el área de mc2 pegar
if (this.hitTest(_root.mc23)) {
this.mover(mc23._x, mc23._y);
this.gotoAndStop("pegar");
} else {
this.mover(clip3inicioX, clip3inicioy);
this.gotoAndStop("soltar");
}
};
clip4inicioX = mc14._x;
clip4inicioY = mc14._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
mc14.onPress = function() {
this._alpha = 50;
this.gotoAndStop("arrastrar");
startDrag(this);
};
// -- soltar
mc14.onRelease = mc14.onReleaseOutside=function () {
stopDrag();
this._alpha = 100;
// si mc14 se encuentra sobre el área de mc24 pegar
if (this.hitTest(_root.mc22)) {
this.mover(mc22._x, mc22._y);
this.gotoAndStop("pegar");
} else {
this.mover(clip4inicioX, clip4inicioy);
this.gotoAndStop("soltar");
}
};
clip5inicioX = mc15._x;
clip5inicioY = mc15._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
mc15.onPress = function() {
this._alpha = 50;
this.gotoAndStop("arrastrar");
startDrag(this);
};
// -- soltar
mc15.onRelease = mc15.onReleaseOutside=function () {
stopDrag();
this._alpha = 100;
// si mc15 se encuentra sobre el área de mc25 pegar
if (this.hitTest(_root.mc25)) {
this.mover(mc25._x, mc25._y);
this.gotoAndStop("pegar");
} else {
this.mover(clip5inicioX, clip5inicioy);
this.gotoAndStop("soltar");
}
};
clip6inicioX = mc16._x;
clip6inicioY = mc16._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
mc16.onPress = function() {
this._alpha = 50;
this.gotoAndStop("arrastrar");
startDrag(this);
};
// -- soltar
mc16.onRelease = mc16.onReleaseOutside=function () {
stopDrag();
this._alpha = 100;
// si mc16 se encuentra sobre el área de mc26 pegar
if (this.hitTest(_root.mc26)) {
this.mover(mc26._x, mc26._y);
this.gotoAndStop("pegar");
} else {
this.mover(clip6inicioX, clip6inicioy);
this.gotoAndStop("soltar");
}
};
clip7inicioX = mc17._x;
clip7inicioY = mc17._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
mc17.onPress = function() {
this._alpha = 50;
this.gotoAndStop("arrastrar");
startDrag(this);
};
// -- soltar
mc17.onRelease = mc17.onReleaseOutside=function () {
stopDrag();
this._alpha = 100;
// si mc17 se encuentra sobre el área de mc27 pegar
if (this.hitTest(_root.mc27)) {
this.mover(mc27._x, mc27._y);
this.gotoAndStop("pegar");
} else {
this.mover(clip7inicioX, clip7inicioy);
this.gotoAndStop("soltar");
}
};
clip8inicioX = mc18._x;
clip8inicioY = mc18._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
mc18.onPress = function() {
this._alpha = 50;
this.gotoAndStop("arrastrar");
startDrag(this);
};
// -- soltar
mc18.onRelease = mc18.onReleaseOutside=function () {
stopDrag();
this._alpha = 100;
// si mc18 se encuentra sobre el área de mc28 pegar
if (this.hitTest(_root.mc28)) {
this.mover(mc28._x, mc28._y);
this.gotoAndStop("pegar");
} else {
this.mover(clip8inicioX, clip8inicioy);
this.gotoAndStop("soltar");
}
}
clip9inicioX = mc19._x;
clip9inicioY = mc19._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
{
mc19.onPress = function() {
this._alpha = 50;
this.gotoAndStop("arrastrar");
startDrag(this);
};
// -- soltar
mc19.onRelease = mc19.onReleaseOutside=function () {
stopDrag();
this._alpha = 100;
// si mc19 se encuentra sobre el área de mc29 pegar
if (this.hitTest(_root.mc29)) {
this.mover(mc29._x, mc29._y);
this.gotoAndStop("pegar");
} else {
this.mover(clip9inicioX, clip9inicioy);
this.gotoAndStop("soltar");
}
}
};[/color]
