flash code question making a platform game, Why doesn't this work?

kiwilimejuice

New member
Making a Platform game. I want the character to show a running animation when i click either left or right on the keyboard, and stand still when nothing is pressed. This Action is placed in the timeline.
Whats wrong with it? All of the locations should be right....
stop();
var speed: Number = 8;

if (Key.isDown( Key.RIGHT))
{
_xscale = 100;
_x += speed;
this.gotoAndPlay("this.Player.running");
} else {
if (Key.isDown( Key.LEFT))
{
_xscale = -100;
_x -= speed;
this.gotoAndPlay("this.Player.running");
}
else{
this.gotoAndPlay("_root.Player.still")
}
}
 
Back
Top