Hola a todos
Estoy haciendo una actividad de arrastrar y soltar con varios clip de películas todos colocados en la misma capa y mismo fotograma, pues al arrastrar un clip de película cualquiera, me doy cuenta de que pasa por debajo de los otros clip de película lo que quiero es que al seleccionar cualquiera de ellos debería pasar por encima de los demás y no lo hace.
Código HTML:
stop();
_global.cont = 0;
_global.desc = 0;
if (cont == 5)
{
_global.aciertos++;
gotoAndPlay(61);
this._parent.btn_siguiente.enabled = true;
pieza1_mc.enabled = false;
pieza2_mc.enabled = false;
pieza3_mc.enabled = false;
pieza4_mc.enabled = false;
pieza5_mc.enabled = false;
} // end if
if (desc == 5)
{
_global.malos++;
gotoAndPlay(61);
this._parent.btn_siguiente.enabled = true;
pieza1_mc.enabled = false;
pieza2_mc.enabled = false;
pieza3_mc.enabled = false;
pieza4_mc.enabled = false;
pieza5_mc.enabled = false;
} // end if
if(_global.ini==undefined) iniciar(); // como la función no esta definida se ejecutara "iniciar()"
function iniciar(){
_global.ini = true; // se define variable para no ejecutar mas esta función
posX = pieza1_mc._x;
posY = pieza1_mc._y;
posX1 = pieza2_mc._x;
posY1 = pieza2_mc._y;
posX2 = pieza3_mc._x;
posY2 = pieza3_mc._y;
posX3 = pieza4_mc._x;
posY3 = pieza4_mc._y;
posX4 = pieza5_mc._x;
posY4 = pieza5_mc._y;
}
posX = pieza1_mc._x;
posY = pieza1_mc._y;
pieza1_mc.onPress = function (mouseDown)
{
this.startDrag();
};
pieza1_mc.onRelease = function (mouseUp)
{
this.stopDrag();
if (this.hitTest(dropZone1))
{
cont+=1;
gotoAndPlay(2);
sonido = new Sound();
sonido.attachSound("muy_bien");
sonido.start();// reproducir sonido
pieza1_mc._x = dropZone1._x;
pieza1_mc._y = dropZone1._y;
pieza1_mc.enabled = false;
}
else
{
desc+=1;
gotoAndPlay(31);
trace("regresando a "+posX+"/"+posY);
sonido = new Sound();
sonido.attachSound("vamos_amiguito");
sonido.start();// reproducir sonido
pieza1_mc._x = posX;
pieza1_mc._y = posY;
} // end else if
};
posX1 = pieza2_mc._x;
posY1 = pieza2_mc._y;
pieza2_mc.onPress = function (mouseDown)
{
this.startDrag();
};
pieza2_mc.onRelease = function (mouseUp)
{
this.stopDrag();
if (this.hitTest(dropZone2))
{
cont+=1;
gotoAndPlay(2);
sonido = new Sound();
sonido.attachSound("muy_bien");
sonido.start();// reproducir sonido
pieza2_mc._x = dropZone2._x;
pieza2_mc._y = dropZone2._y;
pieza2_mc.enabled = false;
}
else
{
desc+=1;
gotoAndPlay(31);
sonido = new Sound();
sonido.attachSound("vamos_amiguito");
sonido.start();// reproducir sonido
pieza2_mc._x = posX1;
pieza2_mc._y = posY1;
} // end else if
};
posX2 = pieza3_mc._x;
posY2 = pieza3_mc._y;
pieza3_mc.onPress = function (mouseDown)
{
this.startDrag();
};
pieza3_mc.onRelease = function (mouseUp)
{
this.stopDrag();
if (this.hitTest(dropZone3))
{
cont+=1;
gotoAndPlay(2);
sonido = new Sound();
sonido.attachSound("muy_bien");
sonido.start();// reproducir sonido
pieza3_mc._x = dropZone3._x;
pieza3_mc._y = dropZone3._y;
pieza3_mc.enabled = false;
}
else
{
desc+=1;
gotoAndPlay(31);
sonido = new Sound();
sonido.attachSound("vamos_amiguito");
sonido.start();// reproducir sonido
pieza3_mc._x = posX2;
pieza3_mc._y = posY2;
} // end else if
};
posX3 = pieza4_mc._x;
posY3 = pieza4_mc._y;
pieza4_mc.onPress = function (mouseDown)
{
this.startDrag();
};
pieza4_mc.onRelease = function (mouseUp)
{
this.stopDrag();
if (this.hitTest(dropZone4))
{
cont+=1;
gotoAndPlay(2);
sonido = new Sound();
sonido.attachSound("muy_bien");
sonido.start();// reproducir sonido
pieza4_mc._x = dropZone4._x;
pieza4_mc._y = dropZone4._y;
pieza4_mc.enabled = false;
}
else
{
desc+=1;
gotoAndPlay(31);
sonido = new Sound();
sonido.attachSound("vamos_amiguito");
sonido.start();// reproducir sonido
pieza4_mc._x = posX3;
pieza4_mc._y = posY3;
} // end else if
};
posX4 = pieza5_mc._x;
posY4 = pieza5_mc._y;
pieza5_mc.onPress = function (mouseDown)
{
this.startDrag();
};
pieza5_mc.onRelease = function (mouseUp)
{
this.stopDrag();
if (this.hitTest(dropZone5))
{
cont+=1;
gotoAndPlay(2);
sonido = new Sound();
sonido.attachSound("muy_bien");
sonido.start();// reproducir sonido
pieza5_mc._x = dropZone5._x;
pieza5_mc._y = dropZone5._y;
pieza5_mc.enabled = false;
}
else
{
desc+=1;
gotoAndPlay(31);
sonido = new Sound();
sonido.attachSound("vamos_amiguito");
sonido.start();// reproducir sonido
pieza5_mc._x = posX4;
pieza5_mc._y = posY4;
} // end else if
};
use el this.swapDepths(); pero los parámetros que les he colocado me generan muchos errores.
De antemano gracias por sus aportes.