# "jolting" continuous movement

**URL:** https://forum.kirupa.com/t/jolting-continuous-movement/254617
**Category:** flash
**Created:** [March 13, 2008, 4:35pm UTC](https://forum.kirupa.com/t/jolting-continuous-movement/254617 "2008-03-13T16:35:27Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kpxnamja](https://avatars.discourse-cdn.com/v4/letter/k/7c8e57/32.png) [@kpxnamja](https://forum.kirupa.com/u/kpxnamja)
#### Post date: [March 13, 2008, 4:35pm UTC](https://forum.kirupa.com/t/jolting-continuous-movement/254617/1 "2008-03-13T16:35:27Z")

</div>

Hi there, I’m having a little trouble creating a **true** continuous movement in AS1.0 syntax.  
The syntax,

```auto

on (keyPress "<Down>"){
    hero._y += speed;
}

```

_Does achieve a continuous motion_, but begins with a “jolt.” I hate the jolt, as it ruins a few mechanics of the game.

I tried, doing the following,

```auto

on (keyPress "<Down>"){
     dir = 1;
 }
if (dir == 1){
     tellTarget("hero"){
          _x += speed;
     }
}

```

That code _does the job of not “jolting,”_ but\*\* continues to move after the key is released.

I can easily achieve this effect using AS2.0 syntax by the

```auto

if (Key.isDown(Key.DOWN)) {
        dir = "duck";    
}
if (dir == "duck"){
        hero.gotoAndStop("duck");
}

```

However, my question is how to do this effect using the AS 1.0 syntax…  
note: I can’t simply use AS2, unfortunately…

thanks guys,  
kpxnamja
