Lo que puedo hacer:
Conseguí que cambiara de sprite al apretar la flechita.
Conseguí que cuando suelto la flechita se posisionara en una posición de estar quieto.
Conseguí que se moviese por la pantalla.
Lo que no puedo hacer:
Si dejo la flechita apretada que se mueva como si estuviese caminando, pero se me queda como conjelado.
El SWF con lo que tengo:
Y este es mi codigo:
Código ActionScript :
onClipEvent(load)
{
step=5;
movieWidth=300;
movieHeight=300;
movieheight1=0;
this.stop();
}
onClipEvent(enterFrame)
{
if (Key.isDown (Key.RIGHT) && this._x < movieWidth)
{
this.attachMovie("hero1", "hero2", 10);
this._x+=step;
}
if (Key.isDown (Key.LEFT) && this._x > 0)
{
this.attachMovie("hero3", "hero4", 10 );
this._x+=-step;
}
if (Key.isDown (Key.DOWN) && this._y < movieHeight)
{
this.attachMovie("hero5", "hero6", 10 );
this._y+=step;
}
if (Key.isDown (Key.UP) && this._y > 0)
{
this.attachMovie("hero7", "hero7", 10 );
this._y+=-step;
}
}
