# String to Array

**URL:** https://forum.kirupa.com/t/string-to-array/14991
**Category:** flash
**Created:** [March 5, 2003, 2:51am UTC](https://forum.kirupa.com/t/string-to-array/14991 "2003-03-05T02:51:18Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Big\_Al](https://avatars.discourse-cdn.com/v4/letter/b/dc4da7/32.png) [@Big\_Al](https://forum.kirupa.com/u/Big_Al)
#### Post date: [March 5, 2003, 2:51am UTC](https://forum.kirupa.com/t/string-to-array/14991/1 "2003-03-05T02:51:18Z")

</div>

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](http://www.whatever.com/bla/whatever.txt)”, 0);

Thanks

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 5, 2003, 3:18am UTC](https://forum.kirupa.com/t/string-to-array/14991/2 "2003-03-05T03:18:20Z")

</div>

what is the format of your text file?

```php

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…

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 5, 2003, 4:18am UTC](https://forum.kirupa.com/t/string-to-array/14991/3 "2003-03-05T04:18:39Z")

</div>

I’m sleepy, so maybe I am wrong…

loadVariablesNum(“[http://www.whatever.com/bla/whatever.txt](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???

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 5, 2003, 9:44am UTC](https://forum.kirupa.com/t/string-to-array/14991/4 "2003-03-05T09:44:46Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 24, 2003, 3:46pm UTC](https://forum.kirupa.com/t/string-to-array/14991/5 "2003-03-24T15:46:05Z")

</div>

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

thanks.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 24, 2003, 3:54pm UTC](https://forum.kirupa.com/t/string-to-array/14991/6 "2003-03-24T15:54:20Z")

</div>

havent tried it, but try something like

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

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 24, 2003, 4:04pm UTC](https://forum.kirupa.com/t/string-to-array/14991/7 "2003-03-24T16:04:48Z")

</div>

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](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=18442&highlight=arrays+strings)

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 24, 2003, 4:08pm UTC](https://forum.kirupa.com/t/string-to-array/14991/8 "2003-03-24T16:08:21Z")

</div>

oh… yeah… thats how its done 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [March 24, 2003, 9:17pm UTC](https://forum.kirupa.com/t/string-to-array/14991/9 "2003-03-24T21:17:48Z")

</div>

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](http://64.207.155.38/forums/showthread.php?s=&postid=147035#post147035)
