1. place your .load after your onLoad function. Best practice.
2. Your 2nd trace is executing before the Array is created. Once created, you can access it. Not before.


On May 26, 2007, at 5:53 PM, John Trentini wrote:

I am sure this has an easy answer but i can't get my head around it and need help, please?! I am getting data from an external gtext file and using the information tobuild a menu with the following:
//
var myMenuData = new LoadVars;
var myTxt:Array = new Array();'
//
myFile = "../textFiles/menuLabels.txt";
myMenuData.load(myFile);
myMenuData.onLoad = function(success) {
   if (success) {
trace("LoadVars loaded successfully: "+this.loaded); <==this one returns = true
       myTxt = this.myVar.split(",");
       trace(myTxt[3]); <==this trace returns the correct value
   } else {
       trace("Could not get the data");
   }
};
trace(myTxt[3]); <== this trace returns undefined

I am unable to get the info out of the load function, what am i doing wrong? How can I make the info persistent?

Thanks
JohnT

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to