I am looking for help modifying an xml menu.
The menu was horizontal, but changing it to vertical.
Have it vertical, but can’t get the on state indicator to update to a new _y position based on the text postion in the menu. (menu_line_mc)
Here’s the code, any help would be appreciated:
//Create Menu Items
function createMenu() {
menu_item_mc._visible = false;//Set invisible first menu item
var xcoor = 0;//Menu item X coordinate
var ycoor = 0;//Menu item Y coordinate
var widths = 0;//Menu item width
var heights = 0;//Menu item height
for (i=0; i<_root.menuItems.length; i++) {
//Item
var menu_item_mcx = “menu_item_mc”+i;
duplicateMovieClip(menu_item_mc, menu_item_mcx, (i+10000));
with (this[menu_item_mcx]) {
with (menu_item_name_mc) {
name_txt.autoSize = true;
name_txt.text = _root.menuItems*.name;
widths = Math.floor(name_txt._width);
heights = Math.floor(name_txt._height);
}
with (menu_item_holder_mc) {
_width = widths;
_height = heights;
}
}
this[menu_item_mcx].i = i;
this[menu_item_mcx].heights = heights;
this[menu_item_mcx].widths = widths;
setProperty(menu_item_mcx, _x, xcoor);
setProperty(menu_item_mcx, _y, ycoor);
setProperty(menu_item_mcx, _visible, true);
//Line
if (i == _root.currentMenuItem) {
//Import transition effects of flash
import mx.transitions.Tween;
import mx.transitions.easing;
//Change line color
var color:Color = new Color(menu_line_mc);
color.setRGB(_root.menuItems*.lineColor);
//Tween Y coordinate of bottom line
new Tween(menu_line_mc, “_y”, Regular.easeOut, menu_line_mc._y, ycoor, 0.2, true);
new Tween(menuItems*, “_y”, Regular.easeOut, menu_line_mc._y, ycoor, 0.2, true);
//Change line width
menu_line_mc._height = 20;
menu_line_mc._width = widths+20;
}
xcoor += 0;
ycoor += heights+20;
}
}
createMenu();
stop();