Hi,
Im trying to alter the XML menu from Kirupa in a way so that i does all i want to.
Instead of using multiple dropdown menu’s i will only use the first one, but adding the textfield text to all buttons.
So i just want the menu, and the textfield.
But i want to add an extra textfield, do 1 menu button, 1 header textfield, and 1 content textfield.
I’ve tried to add a var. to load in a second part of text but with no succes.
The code used to load the vars is the following:
curr_node = node_xml.childNodes*;
curr_item.action = curr_node.attributes.action;
curr_item.variables = curr_node.attributes.variables;
curr_item.name.text = curr_node.attributes.name;
The code to parse the text into the textfields:
/ load XML, when done, run CreateMainMenu to interpret it
menu_xml = new XML();
menu_xml.ignoreWhite = true;
menu_xml.onLoad = function(ok){
// create main menu after successful loading of XML
if (ok){
CreateMainMenu(10, 10, 0, this);
message_txt.text = "message area";
message_txt2.text = "message area";
}else{
message_txt.text = "error: XML not successfully loaded";
}
And the XML file were to text will be put:
<?xml version="1.0" encoding="UTF-8"?>
<menu name="example">
<item name="Figuranten gezocht" action="message" variables="waarom"/>
<item name="Kop2" action="message" variables="Kop2"/>
<item name="Kop3" action="message" variables="Kop3"/>
<item name="Kop4" action="message" variables="Kop4"/>
<item name="Kop5" action="message" variables="Kop5"/>
</menu>
</menu>
</xml>
Thanks in advance