# Button rollover effect

**URL:** https://forum.kirupa.com/t/button-rollover-effect/248896
**Category:** Uncategorized
**Created:** [January 13, 2008, 12:53am UTC](https://forum.kirupa.com/t/button-rollover-effect/248896 "2008-01-13T00:53:34Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![b\_arry](https://avatars.discourse-cdn.com/v4/letter/b/9fc29f/32.png) [@b\_arry](https://forum.kirupa.com/u/b_arry)
#### Post date: [January 13, 2008, 12:53am UTC](https://forum.kirupa.com/t/button-rollover-effect/248896/1 "2008-01-13T00:53:34Z")

</div>

[http://img249.imageshack.us/img249/9…angaur5.th.jpg](http://img249.imageshack.us/img249/9066/bamjangaur5.th.jpg)

So when i roll over the button home, I want the blue bar to slide over to the other side of it.  
And when i roll off it slides back, I know how to do that but.  
When i go to archive. How cna i make the blue bar go down to that word then slide over?

this is my code for buttons right now

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

var mc\_arr = [Home\_btn,Me\_btn,Archive\_btn];  
var counter = 0;

function tweenIn\_intro(target\_mc:MovieClip){

var image1\_a:Tween = new Tween(target\_mc, “\_alpha”, Regular.easeIn, 0, 100, .5, true);  
image1\_a.onMotionFinished = function() {  
counter = (counter \< mc\_arr.length-1) ? counter+1 : mc\_arr.length;  
tweenIn\_intro(mc\_arr[counter]);  
};

}

function tweenIn(target\_mc:MovieClip){  
var image\_rollon:Tween = new Tween(target\_mc, “\_alpha”, Regular.easeIn, 100, 20, 1, false);  
}  
Home\_btn.onRollOver = function(){ tweenIn(this); }  
Me\_btn.onRollOver = function(){ tweenIn(this); }  
Archive\_btn.onRollOver = function(){ tweenIn(this); }

function tweenOut(target\_mc:MovieClip){  
var image\_rolloff:Tween = new Tween(target\_mc, “\_alpha”, Regular.easeIn, 20, 100, 1, false);  
}  
Home\_btn.onRollOut = function(){ tweenOut(this); }  
Me\_btn.onRollOut = function(){ tweenOut(this); }  
Archive\_btn.onRollOut = function(){ tweenOut(this); }

```
tweenIn_intro(mc_arr[counter]);
```
