View Full Version : variable problems
i want to save a list of words from an external text file into an array, but when i trace my array after loading the external text file, the output window just says undefined.
i don't know how i should do it
:(
any help would be so much appreciated
Billy T
04-08-2003, 11:55 PM
using MX? post the code you have so far...
this is probably embarressingly incorrect...
frame 1 actionscript:
first i wrote this:
var GroupA;
loadVariables("data.txt");
trace(GroupA);
then i tried this:
GroupA = new Array();
loadVariables("data.txt");
trace(GroupA);
oh yeah, and i'm using MX
Billy T
04-09-2003, 12:21 AM
nah you are processing the text before it has loaded
myVars=new LoadVars();
myVars.onLoad=function(ok){
if(ok){
GroupA=this.theText.split("|");
}else{
trace("****!!!");
}
}
myVars.load("data.txt");
your text file should look something like
&theText=val1|val2|val3
cheers
thanks a whole bunch billy t!
:p
Billy T
04-09-2003, 02:08 AM
no worries
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.