Forum Moderators: open
The issue is, it grabs the information I need from the XML file but goes no further when I click on the buttons.
ActionScript 2.0
<font size="1">//hide the flash right click menu items:
Stage.showMenu = false;
Stage.scaleMode = "noScale";
Stage.align = "TL";
//hide the flash menu until the XML loads
_parent._visible = true;
// xml processing
menu_cfg_xml = new XML();
menu_cfg_xml.load(String(_url.slice(0, (_url.length-3)))+"xml");
menu_cfg_xml.ignoreWhite = 1;
//
menu_cfg_xml.onLoad = function(ok) {
// create main menu after successful loading of XML
if (ok) {
create_menu();
} else {
trace("XML not loaded");
}
};
//
counter = 1;
function create_menu() {
while (counter<menu_cfg_xml.firstChild.childNodes.length) {
attachMovie("button_type", "btn"+counter, counter);
set("btn"+counter+"._y", counter*26-26);
btn1._y = 0;
// set the buttons text
set("btn"+counter+".the_text", menu_cfg_xml.firstChild.childNodes[counter].attributes.text);
set("btn"+counter+".the_scene", menu_cfg_xml.firstChild.childNodes[counter].attributes.scene);
set("btn"+counter+".the_frame", menu_cfg_xml.firstChild.childNodes[counter].attributes.framenr);
this["btn"+counter].onRollOver = this["btn"+counter].onDragOver=function () {
this.effect.gotoAndPlay(2);
this.textul1.textColor = "0x"+menu_cfg_xml.firstChild.childNodes[0].attributes.text_color2;
};
this["btn"+counter].onRollOut = this["btn"+counter].onDragOut=function () {
this.textul1.textColor = "0x"+menu_cfg_xml.firstChild.childNodes[0].attributes.text_color1;
this.effect.gotoAndPlay(9);
};
this["btn"+counter].onRelease = function() {
if (this.the_scene != undefined and this.the_scene != "") {
_root.gotoAndPlay(this.the_scene, this.the_frame);
trace(this.the_scene);
trace(this.the_frame);
}
};
//set buttons color
this["button_color"+counter] = new Color("btn"+counter+".btn_color");
this["button_color"+counter].setRGB("0x"+menu_cfg_xml.firstChild.childNodes[0].attributes.button_color);
//set button effect color
this["effect_color"+counter] = new Color("btn"+counter+".effect");
this["effect_color"+counter].setRGB("0x"+menu_cfg_xml.firstChild.childNodes[0].attributes.effect_color);
//set button text color
this["btn"+counter].textul1.textColor = "0x"+menu_cfg_xml.firstChild.childNodes[0].attributes.text_color1;
counter++;
}
_parent._visible = true;
info_clip._visible = false;
}</font>
And the buttons all look linke this in the XML file:
<button text="Main Menu" scene="Main Menu" framenr="Menu_start"></button>
About rdy to pull my hair out! Anyone have any ideas? Thanks!
MM
[senocular.com...] Unless you have any ideas? LOL