Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

load variables from text file... 1

Status
Not open for further replies.

PaulFynch

IS-IT--Management
May 23, 2002
105
CA
hey all

can i load an array from a text file? and how would i write the syntax in the file?
i dont think i can, but thats why im here
if not....
i would like to load a variable from the text file example

myVar=one+two+three

how, in flash5 can i rip apart the string to make the 3 words separate, which i will be using for 3 other variables?
thanx in advance...
cheers
paul
 

myVar1=one&myVar2=two&myVar2=three





Regards,

cubalibre2.gif

I'm Bill Watson's biggest fan!
 
k...
im back
hopefully you come back to this post...
i am trying to make sense of the code in the url posted above...but i new to working with arrays in flash so i am having trouble with it...

he has on the page this code....
// Split sublevel
for (i = 0; i < noSplits; i++) {
multiD = multiD.split(&quot;!&quot;);
}


does he not mean slice?
i cant find reference to split....
cheers
paul
 
k wait
i found the split function
i like it...its exactly what im looking for.
problem im having is if i define a variable in flash, i can split and trace it no problem...
load the same exact string from a text file and loadvariables....no can do
i know the variable is loading from the txt file because i report it back with a dynamic text box
any suggestions?
cheers
paul
 
i tried loading a variable from the text file and using the slice function on it as well, but it didn't work...
typeof() returns &quot;undefined&quot; for the variable loaded form the text file, would that be the problem, and if so, how do i fix it?
cheers,
paul
 
while everyone is pondering this, also, is there a built in function to get the total number of items in an array, as a number

cheers,
paul
 
well, to answer my own questions, turns out that the text file needs some time to load up, a couple frames or more, although i am trying to find a workaround so i dont have a small pause at the beginning of the movie, and the array's number of items can be found by using myLength=myArray.length;

why thanx paul!
your welcome paul! ;)
cheers
 
Sorry Paul... Saw but forgot about your last questions. Too busy educating Miss Bill!
It's a reference to a film Bill, nothing more!

Regards,

cubalibre2.gif

[bigcheeks] I'm Bill Watson's biggest fan!
[bigcheeks]
 
no worries.....
actually i had a friend in vancouver stay up all night trying to find it out.....
stupid thing is, i was about 10 pages away from the answer to both in my flash bible :p

say, i got another question...but ill start a new thread
cheers!
paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top