# Code for my character amination please help

**URL:** <https://forum.kirupa.com/t/code-for-my-character-amination-please-help/320835>\
**Category:** Uncategorized\
**Created:** [April 2, 2011, 11:53pm UTC](https://forum.kirupa.com/t/code-for-my-character-amination-please-help/320835 "2011-04-02T23:53:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kociaku](https://avatars.discourse-cdn.com/v4/letter/k/f6c823/32.png) [@kociaku](https://forum.kirupa.com/u/kociaku)\
**Post date:** [April 2, 2011, 11:53pm UTC](https://forum.kirupa.com/t/code-for-my-character-amination-please-help/320835/1 "2011-04-02T23:53:32Z")

</div>

Hi Guys,

I am trying to write code for my char animation. in the scene I have 4 layers: character, sky, ground and actions. all are to symbols(except actions of course)

For my character symbol(movieclip) I have one still frame as default, 2 walk cycles, and a jump. all done on a timeline. the main problem im having is that it doesnt stop, as it is supposed to, on the first default frame.

i put stop(); in the first frame of the movieclip and wanted to do my code in the actions layers in my scene but this stubborn character will not stop and I dont know what to do…

Has anyone any ideas why it is not working for me? Please help if you can  
here’s the little code i have in my scene  
import flash.events.KeyboardEvent;  
import flash.display.MovieClip;

stop();  
stage.addEventListener(KeyboardEvent.KEY\_DOWN, stage\_walkRight);  
stage.addEventListener(KeyboardEvent.KEY\_UP, stage\_walkRightStop);

function stage\_walkRight(event:KeyboardEvent):void

{  
if(event.keyCode==39)  
{  
myAlien.x +=50;  
}  
}

function stage\_walkRightStop(event:KeyboardEvent):void

{  
if(event.keyCode==39)  
{  
gotoAndPlay(2);  
myAlien.x +=0;  
}  
}
