# How to define this function without onRelease?

**URL:** <https://forum.kirupa.com/t/how-to-define-this-function-without-onrelease/82756>\
**Category:** flash\
**Created:** [March 13, 2005, 3:01am UTC](https://forum.kirupa.com/t/how-to-define-this-function-without-onrelease/82756 "2005-03-13T03:01:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aam](https://avatars.discourse-cdn.com/v4/letter/a/13edae/32.png) [@aam](https://forum.kirupa.com/u/aam)\
**Post date:** [March 13, 2005, 3:01am UTC](https://forum.kirupa.com/t/how-to-define-this-function-without-onrelease/82756/1 "2005-03-13T03:01:57Z")

</div>

I need the following script to run as soon the as the play head comes on the frame. Right now it is activated through an onRelease…need to replace that:

myButton\_btn.onRelease = function() {  
tweenBall(mx.transitions.easing.Strong.easeOut);  
};  
function tweenBall(easeType) {  
var begin = -50;  
var end = 100;  
var time = 20;  
var mc = ball\_mc;  
ballTween = new mx.transitions.Tween(mc, “\_y”, easeType, begin, end, time);  
}
