Thanks Mike,
i am realising this but i haven't found a way of stopping everything else from happening until my loadVars is complete.

Michael Boski wrote:

trace(myTxt[3]); <== this trace returns undefined

returns undefined because it is not loaded yet.

you have to access the load after the onLoad event.

this could be a couple seconds later or even a whole minute depending
on how long it takes to load the file.

Mike

On 5/27/07, John Trentini <[EMAIL PROTECTED]> wrote:

Hi there,

(my second try at this, I was really hoping on some help with this one)

I am sure this has an easy answer but i can't get my head around it.
I have even put the code into an #include file to see if it would init
the loadVars before anything else but, no luck..

On Eric's early suggestion I have placed the .load aftert the onLoad
function but that did not resolve my problem.

I am getting data from an external text 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.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");
   }
};
myMenuData.load(myFile);
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