<item title="home" href= "uno.swf">
donde title es el titulo del boton y href me trae el swf asignado
les paso el codigo de mi fla:
import mx.transitions.easing.*;
import gs.TweenMax;
function addButtons() {
pushOverY = 0;
for (i=0; i<totalButtons; i++) {
menu.attachMovie("rectangle","rectangle",-1,{_x:0, _y:rY});
btn = menu.attachMovie("button", "btn"+i, i, {_x:0, _y:pushOverY, id:i});
btn.initialY = btn._y;
btn.textMC.t.autoSize = "left";
btn.textMC.t.text = obj.buttons[i].attributes.title;
btn.textMC.t.textColor = iC;
pushOverY += 42;
_root.contenedor_mc.loadMovie= obj.buttons[i].attributes.url;
setBtnEvents(btn);
}
Mouse.addListener(mouseListener);
}
function setBtnEvents(btn:MovieClip) {
btn.back.onRollOver = function() {
overBtn = this._parent;
if(this != pressedBtn){
if(pressedBtn != undefined){
tweenBtn(pressedBtn,100,iC,42,.8);
}
tweenBtn(this,160,iROC,90,.8);
tweenRectangle(this._parent.initialY,.8);
}
};
btn.back.onRollOut = function() {
if(this != pressedBtn){
if(pressedBtn != undefined){
tweenBtn(pressedBtn,160,iROC,90,.8);
tweenRectangle(pressedBtn._parent.initialY,.8);
}else{
tweenRectangle(rY,.8);
}
tweenBtn(this,100,iC,42,.8);
}
};
btn.back.onPress = function() {
//AQUI ES DONDE CREO QUE IRIA EL LLAMADO AL XML PARA INSERTAR EL SWF
}
}
function tweenBtn(mc:MovieClip,textScale:Number,textTint:Number,backHeight:Number,sec:Number){
mc.lastHeight = mc._height;
TweenMax.to(mc._parent.textMC,sec,{_xscale:textScale, _yscale:textScale, tint:textTint, ease:Strong.easeOut});
TweenMax.to(mc,sec,{_height:backHeight, ease:Strong.easeOut, onUpdate:moveButtons, onUpdateParams:[mc]});
}
function tweenRectangle(newY:Number,sec:Number){
TweenMax.to(menu.rectangle,sec,{_y:newY, ease:Strong.easeOut});
}
function moveButtons(btn:MovieClip) {
btn.currentHeight = btn._height;
for (i=btn._parent.id+1; i<totalButtons; i++) {
menu["btn"+i]._y += btn.currentHeight-btn.lastHeight;
}
btn.lastHeight = btn._height;
}
var iC:Number = new Number();
var iROC:Number = new Number();
var totalButtons:Number = new Number();
var overBtn:MovieClip = new MovieClip();
var pressedBtn:MovieClip = undefined;
var pressedSubItem:MovieClip = new MovieClip();
var mouseListener:Object = new Object();
var obj:Object = new Object();
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function(succes) {
if (succes) {
iC = Number(this.firstChild.attributes.itemColor);
iROC = Number(this.firstChild.attributes.itemRollOverColor);
obj.buttons = this.firstChild.childNodes;
totalButtons = obj.buttons.length;
addButtons();
} else {
trace("xml could not load");
}
};
xml.load("menu.xml");
//ojala alguien pueda ayudarme desde ya muchas gracias!!