String to Array

Hi.

When importing a variable from an external .txt file, I know that it will not properly import an array. I rember seeing a way to convert the string to an array, but I can’t find it. Does anyone know the code?

I have used the search button to attempt to find the answer, however that proved fruitless. I know i have seen it somewhere around here, but I just can’t find it again.

P.S. Does anyone know if you can import a .txt file from the net if it is imported into a .exe file running on a computer? The computer would have a connection to the internet at the time. would I just put an absolute path into the file parameter? Like:
loadVariablesNum(“http://www.whatever.com/bla/whatever.txt”, 0);

Thanks

what is the format of your text file?


temp = "playa...jubba...marz...h88";
newArray = temp.split ("...");
trace (newArray);

That separates the values of the text file at the “…” and makes them a value in an array. That works, but I’m sure there are other ways…

Sorry that code I added before had some extra steps…

I’m sleepy, so maybe I am wrong…

loadVariablesNum(“http://www.whatever.com/bla/whatever.txt”, 0);

Isn’t there a security thing involved which won’t let you load the text file from other server rather than the server the Flash movie resides???

offline flash files (running off the harddrive) can grab info from other domains

so, is it true that you can’t import arrays from external files? please tell me more about this.

thanks.

havent tried it, but try something like

myArray[0]=ahmed&myArray[1]=relish&myArray[2]=b-dawg

well, i don’t think that will work in this situation. see my recent post here:

arrays interpreted as string values

http://www.kirupaforum.com/forums/showthread.php?s=&threadid=18442&highlight=arrays+strings

oh… yeah… thats how its done :slight_smile:

hey, i figured out a solution! if you’re interested, i explained it on a different thread:

http://64.207.155.38/forums/showthread.php?s=&postid=147035#post147035