# Hero "knock down"

**URL:** <https://forum.kirupa.com/t/hero-knock-down/320930>\
**Category:** flash\
**Created:** [April 5, 2011, 11:01pm UTC](https://forum.kirupa.com/t/hero-knock-down/320930 "2011-04-05T23:01:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![woodhall2k](https://avatars.discourse-cdn.com/v4/letter/w/2acd7d/32.png) [@woodhall2k](https://forum.kirupa.com/u/woodhall2k)\
**Post date:** [April 5, 2011, 11:01pm UTC](https://forum.kirupa.com/t/hero-knock-down/320930/1 "2011-04-05T23:01:02Z")

</div>

Hi there, my names matt, I posted on here a bit ago with a few questions regarding the development of my 2.5d as3 beat em up. Im almost done, but i need some ideas as i have hit a road block.

Currently my main character dosent get knocked over, i have triggers for this to happen (enemy kick ect). The problem is i cant seem to get my main character to stay down and complete the “get up” animation.

I beleive the problem is with key presses, as soon as i press a key (left, right, up, down ect) the “get up” animation is broken and the character goes to the “walking animation”

the code I am using to trigger the “knock down sequence is as follows”

\*if (OM.OMabox.hitTestObject(hero))  
{  
{

```
        hero.gotoAndStop("HeroKnockDown");
    }
    

};*

```

the code for walking is as follows

function EnterFrame(event:Event):void  
{  
if (Left)  
{  
hero.x -= speed;  
hero.scaleX = -1.3;

```
    if (hero.currentLabel != ("walking"))
    {
        hero.gotoAndStop("walking");
    }
}
if (Right)
{
    hero.x += speed;
    hero.scaleX = +1.3;

    if (hero.currentLabel != ("walking"))
    {
        hero.gotoAndStop("walking");
    }
}
if (Up)
{
    hero.y -= speed;

    if (hero.currentLabel != ("walking"))
    {
        hero.gotoAndStop("walking");
    }
}
if (Down)
{
    hero.y += speed;

    if (hero.currentLabel != ("walking"))
    {
        hero.gotoAndStop("walking");
    }
}

```

}

any help is much appreciated,

regards Matt!
