mi consulta es como hago para que el boton principal del menu tenga un link, y no solo el sub-menu que se desplega.
Código:
gracias por la ayuda! baseMC.useHandCursor = false; var my_xml:XML = new XML(); my_xml.load("data/menus.xml"); my_xml.ignoreWhite = true; var menues:Array = new Array(); var _this = this; var submenu; my_xml.onLoad = function(success) { if (success) { // trace(this) menues = this.childNodes; for (var i = 0; i<menues.length; i++) { _this.attachMovie("menu_mc", "menumc_"+i, i); _this["menumc_"+i].menutxt.text = menues[i].attributes.label; _this["menumc_"+i]._y = 38; if (i == 0) { _this["menumc_"+i]._x = 280; } else { _this["menumc_"+i]._x = _this["menumc_"+(i-1)]._x+_this["menumc_"+(i-1)]._width+2; } _this["menumc_"+i].onRollOver = function() { menu_rollover(this); }; _this["menumc_"+i].onRollOut = function() { menu_rollout(this); }; } } else { trace("no xml loaded"); } }; function menu_rollover(mc) { removeSubmenues(); mc.gotoAndStop(2); var menu_num = mc._name; menu_num = substring(menu_num, menu_num.lastIndexOf("_")+2, menu_num.length); submenu = menues[menu_num].childNodes; for (var i = 0; i<submenu.length; i++) { _this.attachMovie("menu_mc", "submenu_"+i, i+menues.length); _this["submenu_"+i].menutxt.text = submenu[i].attributes.label; _this["submenu_"+i].link = submenu[i].attributes.link; _this["submenu_"+i]._x = _this["menumc_"+menu_num]._x; if (i == 0) { _this["submenu_"+i]._y = _this["menumc_"+menu_num]._y+_this["menumc_"+menu_num]._height-2; } else { _this["submenu_"+i]._y = _this["submenu_"+(i-1)]._y+_this["submenu_"+(i-1)]._height-2; } _this["submenu_"+i].onRollOver = function() { this.gotoAndStop(2); }; _this["submenu_"+i].onRollOut = _this["submenu_"+i].onDragOut = function() { this.gotoAndStop(1); }; _this["submenu_"+i].onRelease = function() { _root.gotoAndStop(this.link); }; } } function menu_rollout(mc) { mc.gotoAndStop(1); } function removeSubmenues() { for (var i = 0; i<submenu.length; i++) { removeMovieClip(_this["submenu_"+i]); } } baseMC.onRollOver = function() { removeSubmenues(); };