# AS2 Multiple Key Presses Question

**URL:** <https://forum.kirupa.com/t/as2-multiple-key-presses-question/332200>\
**Category:** programming\
**Created:** [February 28, 2014, 3:46am UTC](https://forum.kirupa.com/t/as2-multiple-key-presses-question/332200 "2014-02-28T03:46:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SilkyPop](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@SilkyPop](https://forum.kirupa.com/u/SilkyPop)\
**Post date:** [February 28, 2014, 3:46am UTC](https://forum.kirupa.com/t/as2-multiple-key-presses-question/332200/1 "2014-02-28T03:46:57Z")

</div>

Hey all,  
I’m new to Flash and this forum. I’ve been scouring the internet through tutorials and guides but I still have a question about multiple key presses.  
Here is my (noob) situation,  
I made my character walk around using the directional keypad. Now I want my character to run by pressing shift and directional keypad. I have a different animation for run so I can’t just change the speed.

**My main question is, how do I code two key presses to play an animation?**

This is what I have,

```php
var walkspeed:Number=5
var runspeed:Number=10
onEnterFrame=function(){
    if(Key.isDown(Key.DOWN)){
        _root.characterMc._y+=walkspeed;
        _root.characterMc.gotoAndStop("characterWalkDown");

```

I tried to do,

```php

    if(Key.isDown(Key.DOWN) && Key.isDown(Key.SHIFT)){
        _root.characterMc._y+=runspeed;
        _root.characterMc.gotoAndStop("characterRunDown");

```

It didn’t work. I tried different variations of it but couldn’t get it. Is there a way to do it somewhat this way? If there is a better way, I’m open to new advice and direction but my knowledge of Flash is very limited. Also, I would like to know how to code two key presses at the same time so I can play different animations (not to just make a run button).

Thank you for your time.
