Sulla stessa scena ho un mc che contiene una cartina e 4 pulsanti: su, giù, dx e sx.
Al pulsante di dx ho dato questo codice:
on (press) {
var dx = true;
trace(dx);
}
on (release) {
var dx = false;
trace(dx);
}
e al pulsante di sx, questo:
on (press) {
var sx = true;
trace(sx);
}
on (release) {
var sx = false;
trace(sx);
}
al fotogramma in cui è presente questo
target_item.onEnterFrame = function() {
trace (sx);
if (sx == true) {
speed = 10;
this._x += -speed;
}
};
target_item.onEnterFrame = function() {
trace (dx);
if (dx == true) {
speed = 10;
this._x -= -speed;
}
};
target_item.onEnterFrame = function() {
trace (gx);
if (gx == true) {
speed = 10;
this._y += -speed;
}
};
target_item.onEnterFrame = function() {
trace (sux);
if (sux == true) {
speed = 10;
this._y += -speed;
}
};
Ho notato che esegue il codice relativo al pulsante su, l'ultimo in sequenza nel codice, il precedente codice viene ignorato.
Se sposto il codice relativo al pulsante di destra all'ultimo posto in sequenza esegue correttamente il pulsante di destra, ecc.
Qual è il modo corretto di applicare il quel codice?
Ho provato a inserire, dividendolo, il codice in kf differenti ma non funziona... c'è sempre il problema dell'ordine di sequenza dei kf in cui è posizionato il codice.
es. http://www.ge.camcom.it/tipici/prove tipici.swf
Help
Grazie

Rispondi quotando