NaN:NaN
NaN:NaN
--:-- / --:--
Newgrounds Background Image Theme

JabBear42 just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

help with some as Nov 1, 2007


ok... i have some script making my character move left and right, and while he moves left and right he looks in the respective direction and goes into his walk animation.
but once the walk animation starts, it wont stop, even if he stops moving.

how do i make the walking animation stop.

the walk animation is in frame 2 and the standing animation is in frame 1

onClipEvent (load) {
gravity = 10;
walkSpeed = 6;
maxJump = 4;
scale = _xscale;

}
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
_xscale = -scale;
_x -= walkSpeed;
this.gotoAndStop(2);

}

if (Key.isDown(Key.RIGHT)) {
_xscale = +scale;
_x += walkSpeed;
this.gotoAndStop(2);
}

}

can someone help me?

Response to help with some as Nov 1, 2007


onClipEvent (load) { gravity = 10; walkSpeed = 6; maxJump = 4; scale = _xscale; } onClipEvent (enterFrame) { if (Key.isDown(Key.LEFT)) { _xscale = -scale; _x -= walkSpeed; this.gotoAndStop(2); } else if (Key.isDown(Key.RIGHT)) { _xscale = +scale; _x += walkSpeed; this.gotoAndStop(2); } else { gotoAndStop(1); } }

You don't need the 'this' word because you already have the movieclip targeted.