Hi there,
I am trying to put two menus on one frame in my document, how ever i can’t seem to get it to work.
Below is my code.
//fades in the background image
import mx.transitions.Tween;
import mx.transitions.easing.*;
new Tween(beach, "_alpha", Strong.easeIn, 0, 100, 1, true);
//orginal code
button_space=0
var MenuXML:XML = new XML();
MenuXML.ignoreWhite = true;
MenuXML.load("menu.xml");
MenuXML.onLoad = function(load_status:Boolean):Void {
if (load_status) {
Make_Menu();
}
};
var vertical:Boolean = true;
Make_Menu = function ():Void {
_root.menu_mc.menu_txt.text = MenuXML.firstChild.childNodes[0].attributes.text;
_root.menu_mc.page_label = MenuXML.firstChild.childNodes[0].attributes.label;
_root.menu_mc.url_adress = MenuXML.firstChild.childNodes[0].attributes.url_adress;
for (var i:Number = 0; i<MenuXML.firstChild.childNodes.length-1; i++) {
_root.menu_mc.duplicateMovieClip("menu"+i+"_mc", i+100);
if (vertical) {
_root["menu"+i+"_mc"]._x = _root.menu_mc._x;
_root["menu"+i+"_mc"]._y = _root.menu_mc._y+(_root.menu_mc._height)*(i+1);
} else {
_root["menu"+i+"_mc"]._x = _root.menu_mc._x+(_root.menu_mc._width)*(i+1);
_root["menu"+i+"_mc"]._y = _root.menu_mc._y;
}
_root["menu"+i+"_mc"].menu_txt.text = MenuXML.firstChild.childNodes[i+1].attributes.text;
_root["menu"+i+"_mc"].page_label = MenuXML.firstChild.childNodes[i+1].attributes.label;
_root["menu"+i+"_mc"].url_adress = MenuXML.firstChild.childNodes[i+1].attributes.url_adress;
}
};
//code for second menu
button_space=1
var Menu2XML:XML = new XML();
Menu2XML.ignoreWhite = true;
Menu2XML.load("menu2.xml");
Menu2XML.onLoad = function(load_status1:Boolean):Void {
if (load_status1) {
Make_Menu2();
}
};
var vertical:Boolean = true;
Make_Menu2 = function ():Void {
_root.menu2_mc.menu2_txt.text = Menu2XML.firstChild.childNodes[0].attributes.text1;
_root.menu2_mc.page_label = Menu2XML.firstChild.childNodes[0].attributes.label1;
_root.menu2_mc.url_adress = Menu2XML.firstChild.childNodes[0].attributes.url_adress1;
for (var i:Number = 0; i<Menu2XML.firstChild.childNodes.length-1; i++) {
_root.menu_mc2.duplicateMovieClip("menu2"+i+"_mc", i+100);
if (vertical) {
_root["menu2"+i+"_mc"]._x = _root.menu2_mc._x;
_root["menu2"+i+"_mc"]._y = _root.menu2_mc._y+(_root.menu2_mc._height)*(i+1);
} else {
_root["menu2"+i+"_mc"]._x = _root.menu2_mc._x+(_root.menu2_mc._width)*(i+1);
_root["menu2"+i+"_mc"]._y = _root.menu2_mc._y;
}
_root["menu2"+i+"_mc"].menu_txt.text = Menu2XML.firstChild.childNodes[i+1].attributes.text1;
_root["menu2"+i+"_mc"].page_label = Menu2XML.firstChild.childNodes[i+1].attributes.label1;
_root["menu2"+i+"_mc"].url_adress = Menu2XML.firstChild.childNodes[i+1].attributes.url_adress1;
}
};
I’ve tried to change all the code that I think would get in the way. Does anyone have any ideas? I uploaded the files if someone can be so kind to take a peep. thanks!!!