Mr.Pancake
February 13th, 2005, 09:02 AM
Sorry for the many treads if posted, but im a hard worker ;).
ok now i need to know is:
I have a moviclip that contains a guy that is walking, i made a stop(); action
In the first frame. on the movieclip actions i wrote:
onClipEvent (load) {
speed = 10;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
_rotation += 20;
}
if (Key.isDown(Key.LEFT)) {
_rotation -= 20;
}
if (Key.isDown(Key.UP)) {
_y -= speed*Math.cos(_rotation*(Math.PI/180));
_x += speed*Math.sin(_rotation*(Math.PI/180));
}
if (Key.isDown(Key.DOWN)) {
_y += speed*Math.cos(_rotation*(Math.PI/180));
_x -= speed*Math.sin(_rotation*(Math.PI/180));
}
}
if i put a gotoAndPlay() action like this:
if (Key.isDown(Key.UP)) {
_y -= speed*Math.cos(_rotation*(Math.PI/180));
_x += speed*Math.sin(_rotation*(Math.PI/180));
gotoAndPlay(2)}
if (Key.isDown(Key.DOWN)) {
_y += speed*Math.cos(_rotation*(Math.PI/180));
_x -= speed*Math.sin(_rotation*(Math.PI/180));
gotoAndPlay(2)}
}
it wil play the animation but if u hold the (key UP) it wil stop at the first frame
How can i make it so it will loop without releasing the up key?
Thnx in advance Pancake
ok now i need to know is:
I have a moviclip that contains a guy that is walking, i made a stop(); action
In the first frame. on the movieclip actions i wrote:
onClipEvent (load) {
speed = 10;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
_rotation += 20;
}
if (Key.isDown(Key.LEFT)) {
_rotation -= 20;
}
if (Key.isDown(Key.UP)) {
_y -= speed*Math.cos(_rotation*(Math.PI/180));
_x += speed*Math.sin(_rotation*(Math.PI/180));
}
if (Key.isDown(Key.DOWN)) {
_y += speed*Math.cos(_rotation*(Math.PI/180));
_x -= speed*Math.sin(_rotation*(Math.PI/180));
}
}
if i put a gotoAndPlay() action like this:
if (Key.isDown(Key.UP)) {
_y -= speed*Math.cos(_rotation*(Math.PI/180));
_x += speed*Math.sin(_rotation*(Math.PI/180));
gotoAndPlay(2)}
if (Key.isDown(Key.DOWN)) {
_y += speed*Math.cos(_rotation*(Math.PI/180));
_x -= speed*Math.sin(_rotation*(Math.PI/180));
gotoAndPlay(2)}
}
it wil play the animation but if u hold the (key UP) it wil stop at the first frame
How can i make it so it will loop without releasing the up key?
Thnx in advance Pancake