Hey i have a common code, its running idle and idling firing, i also have a seperate animation for running and firing but it doesnt work, it just stays on one frame. Heres the code…
onClipEvent (load) {
moveSpeed = 8;
shooting=false;
scale = _xscale;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
this.gotoAndstop(2);
this._x += moveSpeed;
_xscale = scale;
}
if (Key.isDown(Key.LEFT)) {
this.gotoAndstop(2);
this._x -= moveSpeed;
_xscale = -scale;
}
if (Key.isDown(Key.CONTROL)) {
shooting=true;
this.gotoAndstop(3);
}
if (Key.isDown(Key.CONTROL)&& Key.isDown(Key.RIGHT)) {
shooting=true;
this.gotoandstop(4);
_xscale = scale;
}
if (Key.isDown(Key.CONTROL)&& Key.isDown(Key.LEFT)) {
shooting=true;
this.gotoandstop(4);
_xscale = -scale;
}
if (!Key.isDown(Key.RIGHT) && !Key.isDown(Key.LEFT) && !Key.isDown(Key.SPACE) && !Key.isDown(Key.CONTROL)) {
this.gotoandstop(1);
}
}
thanks guys