# \[FMX04\] Need help with a Key.isDown problem

**URL:** https://forum.kirupa.com/t/fmx04-need-help-with-a-key-isdown-problem/178381
**Category:** flash
**Created:** [February 10, 2006, 12:30am UTC](https://forum.kirupa.com/t/fmx04-need-help-with-a-key-isdown-problem/178381 "2006-02-10T00:30:53Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![fourthsword](https://avatars.discourse-cdn.com/v4/letter/f/958977/32.png) [@fourthsword](https://forum.kirupa.com/u/fourthsword)
#### Post date: [February 10, 2006, 12:30am UTC](https://forum.kirupa.com/t/fmx04-need-help-with-a-key-isdown-problem/178381/1 "2006-02-10T00:30:53Z")

</div>

I am making a little demonstration of a key triggering a gotoAndPlay on another movieclip and it seems that the script wont work like I need it to. Ive been tryin for about 30 minutes to figure it out myself and nothing is working.

Here is the code for the “main character”.

```
ActionScript Code:
[FONT=Courier New][LEFT][COLOR=#0000FF]onClipEvent[/COLOR][COLOR=#000000]([/COLOR]enterFrame[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]if[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#0000FF]Key[/COLOR].[COLOR=#0000FF]isDown[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]Key[/COLOR].[COLOR=#0000FF]SPACE[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
    [COLOR=#0000FF]_root[/COLOR].[COLOR=#000080]hero[/COLOR].[COLOR=#0000FF]gotoAndPlay[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000080]2[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR] [COLOR=#0000FF]else[/COLOR] [COLOR=#000000]{[/COLOR]
    [COLOR=#0000FF]_root[/COLOR].[COLOR=#000080]hero[/COLOR].[COLOR=#0000FF]gotoAndStop[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000080]1[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]
    [COLOR=#000000]}[/COLOR]

```

[/LEFT]  
[/FONT]
