Interactive nav AS question

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.swf

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

  • R :tie:

Failed to open document
MX2004???

scotty(-:

sorry scotty, it was in 2004 format, but i just re-saved and uploaded in MX. I’m publishing to flash 6, and using as 1.0

-Rolla

The registrationpoint was not in the middle, it was a bit tricky with the pixelfont, but it’s working now:)

scotty(-:

Awesome scotty, a quick fix indeed!

3 cheers,
-r

You’re welcome:)