# AS2: reusable rollOver functions

**URL:** <https://forum.kirupa.com/t/as2-reusable-rollover-functions/247511>\
**Category:** flash\
**Created:** [December 25, 2007, 12:03am UTC](https://forum.kirupa.com/t/as2-reusable-rollover-functions/247511 "2007-12-25T00:03:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![monkeyhead](https://avatars.discourse-cdn.com/v4/letter/m/74df32/32.png) [@monkeyhead](https://forum.kirupa.com/u/monkeyhead)\
**Post date:** [December 25, 2007, 12:03am UTC](https://forum.kirupa.com/t/as2-reusable-rollover-functions/247511/1 "2007-12-25T00:03:35Z")

</div>

i’m stumped, i want to create 2 types of button functions… a “onRollOver” and a “onRollOut” function.

…that way my Btn script will look like this:

\*\*navMain.about\_btn.onRollOver = function(){  
rollOn();  
}  
\*\*

FYI: the buttons i want to effect are nested inside navMain

so, this what i have so far:

import mx.transitions.Tween;  
import mx.transitions.easing.\*;

function rollOn(){  
var rollOnBTN:Object = new Tween(_I DON’T KNOW WHAT TO PUT HERE_, “\_xscale”, Elastic.easeOut, 100, 140, 1, true);  
var rollOnBTN:Object = new Tween(_I DON’T KNOW WHAT TO PUT HERE_, “\_yscale”, Elastic.easeOut, 100, 140, 1, true);  
}
