Comunidad de diseño web y desarrollo en internet online

Drop de varios MC en un mismo Target

Citar            
MensajeEscrito el 15 Ene 2008 07:00 am
Hola soy nuevo en este foro y tengo una duda , espero alguien pueda resolverme, estoy haciendo un juego para una escuela en flash8 y tengo 4 figuras, triangulo ,rectangulo ,circulo y cuadrado; de estas 4 tengo una especie de caja para cada uno y he hecho un drag and drop de las 4 figuras que regresan a su sitio si no encajan en el lugar y si es correcto les da una felicitacion, espero me entiendan, el chiste es que de estas 4 figuras el objetivo era hacer un pequeño paisaje que contenga las 4 y que los niños arrastren cuantos cuadrados circulos y demas en su caja y al final los feliciten, el problema es que tengo mis 4 targets digamos eje. cuadrtarget_mc que recibe dentro a cuadro_mc , pero el paisaje mentado tendria unos 7 u 8 cuadros entonces cuando hice varias copias del mc y pense que el target recibiria por igual a la copia no fue asi y me la rebota, depues en el AS insterte una nueva cadena con cuadro2_mc que tambien lo recibiera cuadroTarget_mc pero al igual no funciona, queria saber si alguien me puede explicar como soltar varios MC dentro de un mismo target, les anexo mi script para que lo vean:

var counter:Number = 0;
var no:Sound = new Sound();
no.attachSound("again");
var yes1:Sound = new Sound();
yes1.attachSound("amaizing");
var yes2:Sound = new Sound();
yes2.attachSound("good job");
var yes3:Sound = new Sound();
yes3.attachSound("great");

onEnterFrame = function():Void{
if(counter == 4){
reply_txt.text = "Well Done!";
}
};

square_mc.onPress = function():Void {
this.startDrag(true);
reply_txt.text = "";
this.swapDepths(this.getNextHighestDepth());
xstart = this._x;
ystart = this._y;

};
square_mc.onRelease = function():Void {
this.stopDrag();
if (eval(this._droptarget) == squareTarget_mc) {
reply_txt.text="You got it!";
this.enabled = false;
counter++;
yes1.start(0,1);
}
else {
reply_txt.text="No, keep trying!";
this.enabled = true;
this._x = xstart;
this._y = ystart;
no.start(0,1);
}
};
flower_mc.onPress = function():Void {
this.startDrag(true);
reply_txt.text = "";
this.swapDepths(this.getNextHighestDepth());
xstart = this._x;
ystart = this._y;
};
flower_mc.onRelease = function():Void {
this.stopDrag();
if (eval(this._droptarget) == flowerTarget_mc) {
reply_txt.text="You got it!";
this.enabled = false;
counter++;
yes2.start(0,1);
}
else {
reply_txt.text="No, keep trying!";
this.enabled = true;
this._x = xstart;
this._y = ystart;
no.start(0,1);
}
};
triangle_mc.onPress = function():Void {
this.startDrag(true);
reply_txt.text = "";
this.swapDepths(this.getNextHighestDepth());
xstart = this._x;
ystart = this._y;
};
triangle_mc.onRelease = function():Void {
this.stopDrag();
if (eval(this._droptarget) == triangleTarget_mc) {
reply_txt.text="You got it!";
this.enabled = false;
counter++;
yes2.start(0,1);
}
else {
reply_txt.text="No, keep trying!";
this.enabled = true;
this._x = xstart;
this._y = ystart;
no.start(0,1);
}
};
pentagon_mc.onPress = function():Void {
this.startDrag(true);
reply_txt.text = "";
this.swapDepths(this.getNextHighestDepth());
xstart = this._x;
ystart = this._y;
};
pentagon_mc.onRelease = function():Void {
this.stopDrag();
if (eval(this._droptarget) == pentagonTarget_mc) {
reply_txt.text="You got it!";
this.enabled = false;
counter++;
yes3.start(0,1);
}
else {
reply_txt.text="No, keep trying!";
this.enabled = true;
this._x = xstart;
this._y = ystart;
no.start(0,1);
}
};
square_mc2.onPress = function():Void {
this.startDrag(true);
reply_txt.text = "";
this.swapDepths(this.getNextHighestDepth());
xstart = this._x;
ystart = this._y;

};
square_mc2.onRelease = function():Void {
this.stopDrag();
if (eval(this._droptarget) == squareTarget_mc2) {
reply_txt.text="You got it!";
this.enabled = false;
counter++;
yes1.start(0,1);
}
else {
reply_txt.text="No, keep trying!";
this.enabled = true;
this._x = xstart;
this._y = ystart;
no.start(0,1);
}
};

Por mephco666

1 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 15 Ene 2008 06:22 pm
Ok ya pude resolverlo al agregarle al onRelease this._visible = false; gracias por los que respondieron jojojojo, saludos!

Por mephco666

1 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 26 Sep 2008 03:24 am
hey que tal, en que parte del codigo lo has puesto...me sucede lo mismo ...

espero tu respuesta


gracias

Por unasemana

Claber

166 de clabLevel



 

Venezuela

firefox
Citar            
MensajeEscrito el 26 Sep 2008 10:14 am
Lo ha dicho, en el onRelease

Por elchininet

Claber

3921 de clabLevel

17 tutoriales

Genero:Masculino  

Front-end developer at Booking.com

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.