PDA

View Full Version : Using array to arrange subnav buttons



JustinM
June 14th, 2004, 03:09 PM
I may be making this much harder than it should be. What I'm trying to do is create a navigation system which starts with for example a main navigation button named about us. On rollover, I want it to call a prototype that displays my subnavigation one button following the next. The code I have so far is as follows:


MovieClip.prototype.makemenu = function(thearray) {
for (i=1; i<=thearray.length; i++) {
textdisplay.text = textdisplay.text + thearray[i];
buttonName = this.thearray[i];
buttonName._y = buttonName._y + (30 * i);
}
};
}

The array that I'm passing contains instance the names of the three subnavigation buttons that I want to reposition. So ideally, on rolling over the About Us button, I want to drop down the first subnav button, then the second, then the third. Each one would pop down after the previous has finished moving. Any suggestions would be appreciated!

JustinM
June 14th, 2004, 04:28 PM
Here is the .fla that I'm working on. I've disabled most use of the prototypes and threw some code together to show the effect that I'm after. I know this can be done better. Basically, there are 3 buttons (actually mc's) under about us that have their alpha set to 0. When you roll over about us, it repositions the first and each one repositions the next, also calling the fadeto prototype. Blah, here's the file if anyone can help.