# Interactive nav AS question

**URL:** <https://forum.kirupa.com/t/interactive-nav-as-question/104139>\
**Category:** Uncategorized\
**Created:** [March 12, 2004, 7:30pm UTC](https://forum.kirupa.com/t/interactive-nav-as-question/104139 "2004-03-12T19:30:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rollala](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@rollala](https://forum.kirupa.com/u/rollala)\
**Post date:** [March 12, 2004, 7:30pm UTC](https://forum.kirupa.com/t/interactive-nav-as-question/104139/1 "2004-03-12T19:30:57Z")

</div>

Hi, if anyone knows where I’ve gone wrong here please help me out… It’s a navigation effect that follows and resizes a mc on rollovers/outs. I’ve gotten this to work before, but when i change the button width to suit the site it starts skrewing up.

The buttons are named but1, but2… here’s the AS in the main timeline:  
[AS]

for (i=1; i\<5; i++) {  
this[“but”+i].onRollOver = function() {  
tarw = this.\_width;  
tarx = this.\_x;  
follow(tarx, tarw);  
};  
}  
function follow(x, w) {  
slide.onEnterFrame = function() {  
this.\_x += (x-this.\_x)/2;  
this.\_width += (w-this.\_width)/2;  
if (this.\_x\>x-1 && this.\_x\<x+1 && this.\_width\>w-1 && this.\_width\<w+1) {  
delete this.onEnterFrame;  
}  
};  
}

[/AS]

here’s a link to the fla and swf:

[http://www.loftymedia.com/beta/insidex.fla](http://www.loftymedia.com/beta/insidex.fla)  
[http://www.loftymedia.com/beta/insidex.swf](http://www.loftymedia.com/beta/insidex.swf)

If there’s anything else I’ve left out that might help, then please let me know! Thanks

- R :tie:
