New to XML. This is probably basic. Trying to load titles of lessons from an XML file to individual dynamic text fields without using a component. Any quick solves?
MORZ
tomeanand@hotmail.com - 28 Apr 2005 05:32 GMT
hi MORZ
try this out
/*********XML *************/
<?xml version="1.0" encoding="iso-8859-1"?>
<books id="2" name="Type">
<title id="1">one</title>
<title id="2">two</title>
<title id="3">three</title>
<title id="4">four</title>
<title id="5">five</title>
</books>
/*********actions***********/
var myXML:XML = new XML()
var title_array:Array = new Array()
myXML.ignoreWhite = true
myXML.load("title.xml")
myXML.onLoad = function(success) {
if(success) {
child_length = this.firstChild.childNodes
for(var i=0; i<child_length.length; i++) {
title_array.push(child_length.firstChild)
}
}
}
/***************************************************/
you will get all the title in the title_array
show the elements of arrys in your textfield
i guess this will help you
Anand