Hi all,
I’ve read today the tutorial - Introduction to XML in Flash //which is awesome!!
Though I’ve failed to develop a code based on this tutorial - just for check if I succeed to grab a “end” value and insert it inside a Textbox.
I’m getting the error:
TypeError: Error #1006: value is not a function.
at xml2txt_Scene1_fla::MainTimeline/frame1()
And If Im removing the .load command I’m not getting any output at all…
I’ve attached the content of the FLA & XML files.
Please assist me.
The FLA content:
function XML2TXT(my_xml){
var path = my_xml.firstChild.childNodes;
for (var i=0; i<path.length; i++) {
if(path*.attributes.type == "count"){
//Textbox1.text = path*.childNodes.nodeValue;
Textbox1.text = "Yes!";
}
else Textbox1.text = "No!";
}
}
var global_xml = new XML();
global_xml.ignoreWhite = true;
global_xml.onLoad = function(success){
if(success) XML2TXT(this);
else trace("Error loading XML file"); // no success? trace error (wont be seen on web)
}
global_xml.load("files.xml");
The excel file content:
<PhotosGallery>
<item type="pic">
<image>DSC_0500.jpg</image>
<image>DSC_0564.jpg</image>
<image>DSC_5121.jpg</image>
<image>DSC_5169.jpg</image>
<image>DSC_5216.jpg</image>
</item type="pic">
<item type="count">
<value>5</value>
</item type="count">
</PhotosGallery>