Foros del Web » Creando para Internet » Flash y Actionscript »

Menu link xml as2

Estas en el tema de Menu link xml as2 en el foro de Flash y Actionscript en Foros del Web. hola buenos dias, tengo un menu en flash. mi consulta es como hago para que el boton principal del menu tenga un link, y no ...
  #1 (permalink)  
Antiguo 17/05/2011, 08:06
 
Fecha de Ingreso: abril-2003
Mensajes: 260
Antigüedad: 21 años
Puntos: 1
Menu link xml as2

hola buenos dias, tengo un menu en flash.

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:
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();
};
gracias por la ayuda!
__________________
Bye!

Etiquetas: flash
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 07:57.