bueno, con respecto a esto de
Código :
[_root+"pcia_gris_"+i]
de la unica forma que me funciona es como te lo muestro mas abajo, aparte que lo voy comprobando mediante " trace". osea, cuando publico la pelicula, al hacer release sobre la pieza 23(por poner un ejemplo) me devuelve "_level0.pcia_23". El problema de mi duda es que al publicar, todas las piezas se pegan en el sector 25 y no se porqué, o es que tengo que ponerle algun "level" ,o un "ID", algo hace conflico, o no se que mas puede ser.
Esta dificil el tema, te mando todo el script para que lo veas y te mando el script del modo "principiante" tal vez te sirve para ver mi forma de pensar.
y aca esta el ejemplo de lo que quiero hacer:
http://www.gbanner.com.ar/inter.htm
(es el ultimo juego)
muchas gracias!!! por tu tiempo!!!
codigo actual:
Código :
armar();
function armar() {
for (var i = 0; i<=24; i++) {
var provincia = _root["pcia_"+i];
var gris = _root["pcia_gris_"+i];
provincia.onPress = function() {
this.startDrag();
};
provincia.onRelease = function() {
this.stopDrag();
//EL problema es que las piezas se "sobrescriben",
//por lo que todas las piezas tendran como nombre de inst: "pcia_gris_25"
if (this.hitTest([_root+"pcia_gris_"+i])) {
trace(this);
this._x = gris._x;
this._y = gris._y;
} else {
trace(this)
this._x = this._x;
this._y = this._y;
}
};
}
}
codigo antiguo (no pienso hacerlo asi, me reuso):
Código :
//DESDE ACA EL CHORRO////////////////
pcia_1.onPress = function() {
this.startDrag();
};
pcia_1.onRelease = function() {
stopDrag();
if (pcia_1.hitTest(pcia_gris_1)) {
pcia_1._x = pcia_gris_1._x;
pcia_1._y = pcia_gris_1._y;
}
pcia_1._x = pcia_1._x;
pcia_1._y = pcia_1._y;
};
pcia_2.onPress = function() {
this.startDrag();
};
pcia_2.onRelease = function() {
stopDrag();
if (pcia_2.hitTest(pcia_gris_2)) {
pcia_2._x = pcia_gris_2._x;
pcia_2._y = pcia_gris_2._y;
}
pcia_2._x = pcia_2._x;
pcia_2._y = pcia_2._y;
};
pcia_3.onPress = function() {
this.startDrag();
};
pcia_3.onRelease = function() {
stopDrag();
if (this.hitTest(pcia_gris_3)) {
this._x = pcia_gris_3._x;
this._y = pcia_gris_3._y;
}
this._x = this._x;
this._y = this._y;
};
pcia_4.onPress = function() {
this.startDrag();
};
pcia_4.onRelease = function() {
stopDrag();
if (this.hitTest(pcia_gris_4)) {
this._x = pcia_gris_4._x;
this._y = pcia_gris_4._y;
}
this._x = this._x;
this._y = this._y;
};
////////Y EL CHORRRO SIGUE!!!////////
gracias por tu tiempo!!
Gaby