Hi,
I'm currently passing the following XML into flash:
Code:
<users>
<user>
<user_id>1</user_id>
<full_name>Shaun McAleer</full_name>
<email>michael@pmpak.com</email>
</user>
<user>
<user_id>9</user_id>
<full_name>Gerard Kelly</full_name>
<email>camcim@gmail.com</email>
</user>
</users>
My actionscript looks like this:
Code:
function loadXML(loaded) {
if (loaded) {
_root.company_name.text = this.firstChild;
for (var j = 0; j<this.firstChild.childNodes.length; j++) {
_root.user_id = this.firstChild.childNodes[j].childNodes[0];
_root.full_name = this.firstChild.childNodes[j].childNodes[1];
_root.email = this.firstChild.childNodes[j].childNodes[2];
attachMovie("dynamic_id", "newClip_mc"+j, j,
{
user_id:_root.user_id,
name_str:_root.full_name,
email_str:_root.email,
_x:0, _y:j*90
}
);
}
} else {
trace("file not loaded!");
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("index.php");
How would i go about adding a generic value, lets say company_name for all output in the XML so i can call it in the actionscript here:
Code:
_root.company_name.text = company_name;
Cheers