# gotoAndPlay

**URL:** <https://forum.kirupa.com/t/gotoandplay/298817>\
**Category:** Uncategorized\
**Created:** [October 26, 2009, 1:13am UTC](https://forum.kirupa.com/t/gotoandplay/298817 "2009-10-26T01:13:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dan\_Woodbury](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@Dan\_Woodbury](https://forum.kirupa.com/u/Dan_Woodbury)\
**Post date:** [October 26, 2009, 1:13am UTC](https://forum.kirupa.com/t/gotoandplay/298817/1 "2009-10-26T01:13:34Z")

</div>

i have setup some frame labels so that i can pass a variable into the swf and the animation plays from that label.

i have put the gotoAndPlay code in the first frame so that it can get the variable sent in and then jump to the desired label, except it dosnt work. whatever value i put into the function it goes to the same frame. if i put in frame 10 or frame 100 it will always go to the same point.

firstly i tried this:

```auto
gotoAndPlay("teaching");

```

then did some research and tried this:

```auto
addEventListener(Event.ENTER_FRAME,myFunction);  
function myFunction(event:Event) { 
     gotoAndPlay("teaching");  
}  

```

when i use the latter one it jumps to the right frame but dosnt play it just stops

any ideas to why this is happening would be great

thanks
