# Why doesn't this code work?

**URL:** <https://forum.kirupa.com/t/why-doesnt-this-code-work/32473>\
**Category:** flash\
**Created:** [October 7, 2003, 9:59am UTC](https://forum.kirupa.com/t/why-doesnt-this-code-work/32473 "2003-10-07T09:59:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phat7](https://avatars.discourse-cdn.com/v4/letter/p/6de8d8/32.png) [@Phat7](https://forum.kirupa.com/u/Phat7)\
**Post date:** [October 7, 2003, 9:59am UTC](https://forum.kirupa.com/t/why-doesnt-this-code-work/32473/1 "2003-10-07T09:59:39Z")

</div>

[AS]on (release) {  
this.onEnterFrame = function() {  
current = 7;  
if (current\<12) {  
gotoAndPlay(current);  
current += 1;  
} else {  
delete this.onEnterFrame;  
gotoAndPlay(1);  
}  
};  
}[/AS]This script is put on a button on the 7th frame, is supposed to play the movie till the frame 12 and then go and play the movie from frame 1. \*\*Or is it? \*\* :h: It’s not working… Any help?
