# Check condition problem

**URL:** <https://forum.kirupa.com/t/check-condition-problem/106106>\
**Category:** Uncategorized\
**Created:** [April 2, 2004, 10:16am UTC](https://forum.kirupa.com/t/check-condition-problem/106106 "2004-04-02T10:16:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hsadan](https://avatars.discourse-cdn.com/v4/letter/h/7bcc69/32.png) [@hsadan](https://forum.kirupa.com/u/hsadan)\
**Post date:** [April 2, 2004, 10:16am UTC](https://forum.kirupa.com/t/check-condition-problem/106106/1 "2004-04-02T10:16:35Z")

</div>

i’m trying to create a game that has a similar concept as Dance Dance Revolution - if shown is a down arrow then press down, if up arrow is shown then press up …

i’m having problems with the “if shown is a … arrow” part - i managed to get pressed key check working, so if you press the correct key you’ll progress but if you press the wrong one the appropriate action will execute.

in frame 1 i have the movieclip that contains the arrow display with the following code:

onClipEvent(keyDown){  
if (\_global.x = “up”) {  
if (Key.isDown(Key.UP)){  
gotoAndStop(“down”);  
\_global.x = “down”;  
\_root.wrong.text=“ok”;  
}else if (Key.isDown(Key.DOWN)){  
\_root.wrong.text=“wrong!”;  
}else if (Key.isDown(Key.LEFT)){  
\_root.wrong.text=“wrong!”;  
}else if (Key.isDown(Key.RIGHT)){  
\_root.wrong.text=“wrong!”;  
}  
} else {  
\_root.wrong.text=“wrong!”;  
}  
}

then for the actions for frame 1 itself:  
\_root.instructions.gotoAndStop(“up”);  
\_global.x =" up";  
stop();  
_instructions is the name of my mc_

looks ok to me, but when i tested by changing the if condition for the mc action to if (\_global.x = “down”) the thing still executed as if \_global.x = “up” .

anyone can help?
