dommega
10-13-2001, 10:04 PM
I am building a mainmenu with a dynamic text field that is duplicated -menuNames.length- times.
1) I need to be able to the adjust the size of the textbox dynamically for each button. The textbox is one size and when the words are longer than the button they disappear. Also, If I make the textbox one size to accomodate all words then the rollOver will be to big and fit on white space.
2)How would I run *** spacing for this? (The words plus -spacer- of 11 on each side consists of the button.)
var menuNames = new Array();
var spacer = 22;
// main menu items
menuNames = ['home', 'team', 'news', 'sponsorship', 'car', 'schedule/ results'];
// duplicate the main menu
for (i=0; i<=menuNames.length; i++) {
maintext0.duplicateMovieClip("maintext"+i, i);
***//_root.bar.mainmenu["maintext"+i]._x = ["maintext"+i]._width+spacer);
/* manual spacing for testing
maintext1._x = -178;
maintext2._x = -122;
maintext3._x = -64;
maintext4._x = 52;
maintext5._x = 96;
*/
}
// attach textfield "headers" to menuNames
for (k=0; k<=menuNames.length; k++) {
_root.bar.mainmenu["maintext"+k].headers = menuNames[k];
}
How do other people get around this problem?
1) I need to be able to the adjust the size of the textbox dynamically for each button. The textbox is one size and when the words are longer than the button they disappear. Also, If I make the textbox one size to accomodate all words then the rollOver will be to big and fit on white space.
2)How would I run *** spacing for this? (The words plus -spacer- of 11 on each side consists of the button.)
var menuNames = new Array();
var spacer = 22;
// main menu items
menuNames = ['home', 'team', 'news', 'sponsorship', 'car', 'schedule/ results'];
// duplicate the main menu
for (i=0; i<=menuNames.length; i++) {
maintext0.duplicateMovieClip("maintext"+i, i);
***//_root.bar.mainmenu["maintext"+i]._x = ["maintext"+i]._width+spacer);
/* manual spacing for testing
maintext1._x = -178;
maintext2._x = -122;
maintext3._x = -64;
maintext4._x = 52;
maintext5._x = 96;
*/
}
// attach textfield "headers" to menuNames
for (k=0; k<=menuNames.length; k++) {
_root.bar.mainmenu["maintext"+k].headers = menuNames[k];
}
How do other people get around this problem?