# \[help\] Running and firing

**URL:** https://forum.kirupa.com/t/help-running-and-firing/155047
**Category:** Uncategorized
**Created:** [July 14, 2005, 12:14pm UTC](https://forum.kirupa.com/t/help-running-and-firing/155047 "2005-07-14T12:14:02Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![the\_crowbar\_kid](https://avatars.discourse-cdn.com/v4/letter/t/f07891/32.png) [@the\_crowbar\_kid](https://forum.kirupa.com/u/the_crowbar_kid)
#### Post date: [July 14, 2005, 12:14pm UTC](https://forum.kirupa.com/t/help-running-and-firing/155047/1 "2005-07-14T12:14:02Z")

</div>

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
