Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML help

Status
Not open for further replies.

badley

Technical User
Dec 20, 2002
75
GB
Hi All,

I have been going round in circles regarding this topic.

My XML:

<clientconfig>
<global>
<customerid>1001</customerid>
<name>Test</name>
<calltimeout>300</calltimeout>
<timeout>120</timeout>
<globalnotes>Notes field.</globalnotes>
<bgcolor>01AAD3</bgcolor>
</global>
<button>
<buttonposition>1</buttonposition>
<buttontitle>ARTS AND MEDIA</buttontitle>
<buttonnarrative>Text</buttonnarrative>
</button>
<button>
<buttonposition>2</buttonposition>
<buttontitle>CAREERS AND EMPLOYMENT</buttontitle>
<buttonnarrative>Text</buttonnarrative>
</button>
</clientconfig>

My actionscript to parse the XML:

function load_clientconfig(loaded) {
if (loaded) {
_root.buttontitle1 = this.firstChild.childNodes[1].childNodes[2].firstChild.nodeValue;
_root.buttontitle2 = this.firstChild.childNodes[2].childNodes[2].firstChild.nodeValue;
button1.text = _root.buttontitle1;
button2.text = _root.buttontitle2;
} else {
content = "file not loaded!";
}
}
xml_clientconfig = new XML();
xml_clientconfig.ignoreWhite = true;
xml_clientconfig.onLoad = load_clientconfig;
xml_clientconfig.load("../customers/" + id + "/" + id + ".xml");

I'm using 'button1' in the dynamic_text box.

When I run the flash I seem to only see the word 'button1' not 'ARTS AND MEDIA'.

Can anyone point me in the correct direction, thanks in advance.
 
Forgot that Flash starts with [0], thanks but still no output

Any further thought?
 
Yes sorted, it was the symbol name. Always the stupid thing that drive us nuts!!

Many Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top