# Action script on a button problem

**URL:** <https://forum.kirupa.com/t/action-script-on-a-button-problem/190354>\
**Category:** Uncategorized\
**Created:** [June 10, 2006, 10:11pm UTC](https://forum.kirupa.com/t/action-script-on-a-button-problem/190354 "2006-06-10T22:11:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gh\_](https://avatars.discourse-cdn.com/v4/letter/g/ecc23a/32.png) [@gh\_](https://forum.kirupa.com/u/gh_)\
**Post date:** [June 10, 2006, 10:11pm UTC](https://forum.kirupa.com/t/action-script-on-a-button-problem/190354/1 "2006-06-10T22:11:51Z")

</div>

I am trying to adapt the //code below  
to a button directly  
Can anyone see my problem?

thanks

on (release) = function() {  
var startFrame = \_imageLoader.main\_03.\_currentframe  
gotoAndPlay(\_imageLoader.main\_03.\_currentframe+1)  
\_imageLoader.main\_03.onEnterFrame = function() {  
if(\_imageLoader.main\_03.\_currentframe == startFrame+19) {  
stop()  
imageLoader.main\_03.gotoAndPlay(11);  
;  
;  
}  
}  
}

//stop();  
//button\_btn.onRelease = function() {  
// var startFrame = \_root.\_currentframe  
// gotoAndPlay(\_root.\_currentframe+1)  
// \_root.onEnterFrame = function() {  
// if(\_root.\_currentframe == startFrame+10) {  
// stop();  
// }  
// }  
//}
