Help needed

dynamic class Crawler
{

public var filename;

function Crawler(filename:String)
{
this.filename = filename;

    //trace(filename);
}

function init()
{

view(filename);

createTextField("scroller_txt", 1, -500,100, 2000, 50);

            trace(filename);

        
            //xmlFile = new XML(filename);    
            
            
            
            
            
            

            
            
            //content += "<font size='+2' color='#3366cc'><a href='"+URL+"'>"+lead+"</a></font>"+body+"";
            //txt.htmlText=content;
            
            
        





trace(myTextFormat.font = "Arial");

    
     trace(filename);
    var obj:Object = new Object();
        filename(obj);
    var myArray:Array = obj.firstChild.childNodes;
    trace(myArray.length);

for(var i=0; i<9;i++)
{ 
//trace(i);
            
    if(i%2 == 1)
{
    //trace(i);
    
    var sped = 1;

scroller_txt.spacebuffer = " ";
scroller_txt.border = true;
scroller_txt.speed = sped;

myTextFormat = new TextFormat();
myTextFormat.font = “Verdana”; //this should be a string
myTextFormat.color = 0xffcc00; // the color should hav a 0 before
myTextFormat.size = 12;
scroller_txt.html = true
scroller_txt.html = true
scroller_txt.setTextFormat(myTextFormat);
scroller_txt.setTextFormat(myTextFormat);
scroller_txt.setTextFormat(myTextFormat);

//var m = 1;
scroller_txt.text = myArray[1].firstChild.nodeValue;
for( m=0; m< 9-2; m++)
{
trace(“hi”);
if(m%2 == 1)
{
trace(m);
scroller_txt.text += " "+ myArray[m+2].firstChild.nodeValue;

//trace(t);
}

}

scroller_txt.spaceSize = scroller_txt.getNewTextFormat().getTextExtent(" ").width;
scroller_txt.spacesRequired = Math.ceil(scroller_txt._width/scroller_txt.spaceSize);
for (var p = 0; p<scroller_txt.spacesRequired; p++) {
scroller_txt.spacebuffer += " ";

}
scroller_txt.setTextFormat(myTextFormat);
scroller_txt.text = scroller_txt.spacebuffer+scroller_txt.text+scroller_txt.spacebuffer;
scroller_txt.hscrollInterval = function() {
if (this.hscroll == this.maxhscroll) {
this.hscroll = 0;
}
this.hscroll += this.speed;
};
setInterval(scroller_txt, “hscrollInterval”, 20);
//ToDo
//putmyArray* into the label and crawl it.
}
}

}

function you (filename)
{
var i:String = filename;
trace(i);
}

public function view (filename) {

//trace(filename)
    xmlFile.load(filename);
    
    // check if loaded
    
    xmlFile.onLoad = function(bSuccess:Boolean):Void{

if (bSuccess){
trace(“loading successful”);

}
else {
trace(“Doc failed to load or parse”);
}
};

var xmlFile:XML = new XML();
xmlFile.onLoad = init;
xmlFile.load(filename);

}
}

Hiya fellas out there,

I need some help. Im trying to crawl some messages using the code snippet above. the dynamic class Crawler is an actionscript file which reads the contents of an xml file and crawls it. The file is run with the help of the .fla file below. The problem is that the contents are not crawling. What crawls now is the text undefined. from the analyais i have made i observed that the array that contains the xml nodes (i.e the data) is undefined in the init function and as such has nothing in it. Please help me out here cos im freaking out.

.flafile

var filename:String = “E:\Helena’s Game 10-23-2006\flash\datta.xml”;
var craw:Crawler = new Crawler(filename);
craw.view(filename);