Hi,
I have a actionscript code below. Its not working as expected, please check and let me know where I could be wrong.
////////////////////////Code in class file ////////////////////////////////
class XMLRead {
public var xread:XML;
var xmlInfo:Array;
var xmlCount:Number = 0;
function XMLRead () {
xread = new XML ();
xmlInfo = new Array ();
trace ("Constructor");
xread.ignoreWhite = true;
xread.onLoad = function () {
trace ("XML read and loaded");
trace ("Lenght "+this.firstChild.childNodes[0].childNodes.length);
for (var i:Number = 0; i<this.firstChild.childNodes[0].childNodes.length; i++) {
trace ("direct "+this.firstChild.childNodes[0].childNodes*.childNodes);
xmlInfo* = i;
trace ("xmlInfo["+i+"]"+xmlInfo*);
}
};
xread.load ("slideShow.xml");
}
}
////////////////////////////code in the fla file////////////////////
var xr:XMLRead=new XMLRead();
////////////////////////output I see using trace/////////////////
Constructor
XML read and loaded
Lenght 11
direct 1.jpg
xmlInfo[0]undefined
direct Image caption
xmlInfo[1]undefined
direct 1500
xmlInfo[2]undefined
direct Fade
xmlInfo[3]undefined
direct 1
xmlInfo[4]undefined
direct Regular
xmlInfo[5]undefined
direct easeOut
xmlInfo[6]undefined
direct
xmlInfo[7]undefined
direct 3
xmlInfo[8]undefined
direct
xmlInfo[9]undefined
direct
xmlInfo[10]undefined
From the output I assume the array is not working as expected.
What could be the reason?
Thanks in advance
James