-
Dreamshock Design
Defining variables from an XML file.....
Hi There,
I am currently stating each and every variable I retrieve via an xml document, like the following:
_root.questionT = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
_root.answerA= xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
_root.answerB = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
_root.answerC = xmlNode.childNodes[i].childNodes[3].firstChild.nodeValue;
Is there anyway to automate this so it simply reads in the name of the surrounding text?
<frontText>Welcome to our website</frontText>
So it would know that this variable was frontText without me specifying it? Is that possible?
-
Flashmatics
have a look at using XPath if you are trying to grab hold of particular nodes... heres an explanation:
http://tutorials.lastashero.com/2005..._in_flash.html
-
Dreamshock Design
that is perfect, just what the doctor ordered
thanks heaps for this
-
Flashmatics
your welcome, glad i could help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|