# Code isnt working(f8)

**URL:** <https://forum.kirupa.com/t/code-isnt-working-f8/220333>\
**Category:** Uncategorized\
**Created:** [March 25, 2007, 9:00am UTC](https://forum.kirupa.com/t/code-isnt-working-f8/220333 "2007-03-25T09:00:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flashbandit](https://avatars.discourse-cdn.com/v4/letter/f/c2a13f/32.png) [@Flashbandit](https://forum.kirupa.com/u/Flashbandit)\
**Post date:** [March 25, 2007, 9:00am UTC](https://forum.kirupa.com/t/code-isnt-working-f8/220333/1 "2007-03-25T09:00:37Z")

</div>

[LEFT]renji.onEnterFrame = function() {  
var moveSpeed = 5;  
if(Key.isDown(Key.RIGHT)) {  
this.\_x += moveSpeed;  
dir = “right”  
this.gotoAndStop(2);  
this.\_xscale = 100;  
}  
else if(Key.isDown(Key.LEFT)) {  
this.\_x -= moveSpeed;  
dir = “left”  
this.gotoAndStop(2);  
this.\_xscale = -100;  
}  
else if((dir == “right”) && Key.isDown(Key.CONTROL)) {  
this.gotoAndStop(3);  
this.\_xscale = 100;  
}  
else if((dir == “left”) && Key.isDown(Key.CONTROL)) {  
this.gotoAndStop(3);  
this.\_xscale = -100;  
}  
while(\_root.barrierdown1.hitTest(this)) {  
this.\_y --;  
}  
}  
naruto.onEnterFrame = function() {  
var moveSpeed = 5;  
if(Key.isDown(68)) {  
this.\_x += moveSpeed;  
dir = “right”  
this.gotoAndStop(2);  
this.\_xscale = 100;  
}  
else if(Key.isDown(65)) {  
this.\_x -= moveSpeed;  
dir = “left”  
this.gotoAndStop(2);  
this.\_xscale = -100;  
}  
else if((dir == “right”) && Key.isDown(70)) {  
this.gotoAndStop(3);  
this.\_xscale = 100;  
}  
else if((dir == “left”) && Key.isDown(70)) {  
this.gotoAndStop(3);  
this.\_xscale = -100;  
}  
else if(Key.isDown(83)) {  
this.gotoAndStop(4);  
}  
}

```
var keyDet = new KeyDetection();
keyDet.addCombination("ctrl-dwn", Key.CONTROL, DOWN);
myObj = new Object();
myObj.onKeyCombination = function(name:String) {

switch (name) {

case "ctrl-dwn" :
_root.renji.gotoAndPlay(4)
break;

}

};
keyDet.addListener(myObj);

```

can any1 tell me what is wrong with that conde? it isnt doing the affect when i try to hold down control and down.it just does nothing.  
[/LEFT]
