views:

19

answers:

1

So good so far in ActionScript language I actually haven't fell in bad condition but still I have one good issue that I can't do!

In order at the root timeline everything is Ok when I call the XML childNodes or write the XML class everything its true, but when I call the XML childNodes from root within a movieclip XML gives me undefined can anyone help me ?

A: 

The XML document is this

What is lorem ipsum ? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

The ActionScript code is this function loadXML(loaded) { if (loaded) { xmlNode = this.firstChild; _root.simple_title = []; _root.simple_description = []; total = xmlNode.childNodes.length; for (i = 0; i < total; i++) { xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue; xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue; } } else { trace("XML is not loaded!"); } }

xmlData = new XML(); xmlData.ignoreWhite = true; xmlData.onLoad = loadXML; xmlData.load("simple.xml");

Now everything it's okay in the root timeline actually it's work for example I've one movieclip called content and inside them I have 2 textfields the title and description text now I try to call in root and that's work

content.titleID.text = simple_title[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue; content.descriptionID.text = simple_description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;

Now I try to call from content movieclip the childNodes from root for example:

titleID.text = _root.simple_title[0] descriptionID.text = _root.simple_description[0]

Now the XML gives undefined result, yes that's the issue which I can't do!

Alexander