# gotoAndStop problem

**URL:** <https://forum.kirupa.com/t/gotoandstop-problem/325766>\
**Category:** flash\
**Created:** [November 3, 2011, 7:33am UTC](https://forum.kirupa.com/t/gotoandstop-problem/325766 "2011-11-03T07:33:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![raphaelle](https://avatars.discourse-cdn.com/v4/letter/r/7bcc69/32.png) [@raphaelle](https://forum.kirupa.com/u/raphaelle)\
**Post date:** [November 3, 2011, 7:33am UTC](https://forum.kirupa.com/t/gotoandstop-problem/325766/1 "2011-11-03T07:33:45Z")

</div>

hi to evryone,

im a newbie in flash game dev, i hope you guys can help.

i have a problem about using gotoandstop, i used in an .as file,

it has the frames of walking, idle, and attack for my side scroll game.

heres my code :

private function keyDownHandler(e:KeyboardEvent):void  
{  
switch (e.keyCode)

```
		{

			case 37:
                             hero.scaleX = -1;
                            hero.gotoAndStop('walking');
			gravityx = -2;
			
			break;
			
			case 38:
                            gravityy = -15;
			break;
			
			case 39:
                            hero.gotoAndStop('walking');
			gravityx = 2;
			break;
			
			default:
		}
	}
	
	private function keyUpHandler(e:KeyboardEvent):void
	{
		switch (e.keyCode)
		{
			case 37:
			case 39:
			gravityx = 0;
			break;
			
			default:
		}
	}

```

the error was :

call to a possibly undefined method gotoAndStop through a reference with static type class.

i hope you can help me.

thanks in advance .
