# Split() external text by return?

**URL:** <https://forum.kirupa.com/t/split-external-text-by-return/111381>\
**Category:** Uncategorized\
**Created:** [May 26, 2004, 1:28pm UTC](https://forum.kirupa.com/t/split-external-text-by-return/111381 "2004-05-26T13:28:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![keitai](https://avatars.discourse-cdn.com/v4/letter/k/73ab20/32.png) [@keitai](https://forum.kirupa.com/u/keitai)\
**Post date:** [May 26, 2004, 1:28pm UTC](https://forum.kirupa.com/t/split-external-text-by-return/111381/1 "2004-05-26T13:28:59Z")

</div>

Hi,

I got a external .txt with

delay=50&  
&bannerText=line 1  
line 2  
line 3  
&eof=true

Now is it possible to split &bannerText so i get something like

bannerText = [“line 1”, “line 2”, “line 3”];

So i split by “return” ?

---

<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:** [May 26, 2004, 2:30pm UTC](https://forum.kirupa.com/t/split-external-text-by-return/111381/2 "2004-05-26T14:30:35Z")

</div>

i’m not sure exactly what you mean. what do you want the end flash product to look like?

---

<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:** [May 26, 2004, 2:39pm UTC](https://forum.kirupa.com/t/split-external-text-by-return/111381/3 "2004-05-26T14:39:51Z")

</div>

hmm,

i rewritten my external text file to  
delay=50&  
&bannerText=line 1|line 2|line 3  
&eof=true

and used  
bannerTextArray = this.bannerText.split ("|");

what i am trying to do is a simple banner with the lines scrolling from down - up - pause and then the next line.

---

<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:** [May 26, 2004, 3:26pm UTC](https://forum.kirupa.com/t/split-external-text-by-return/111381/4 "2004-05-26T15:26:58Z")

</div>

Yes it is possible.  
If your textfile looks like this:

```auto
bannerText=this
is
your
text&

```

Then use this code:

```auto
	var banner_text = new LoadVars();
	banner_text.onLoad = function(success) {
		if (success) banner_array = this.bannerText.split("
")
	};
	banner_text.load("textfile.txt");

```

---

<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:** [May 26, 2004, 3:31pm UTC](https://forum.kirupa.com/t/split-external-text-by-return/111381/5 "2004-05-26T15:31:32Z")

</div>

thnks

i was looking for ("  
") didn’t knew that is equal to the “return” button. gonna rewrite it back and see if i can make it work.

btw i notice that when i use  
&delay=50&  
…  
instead of

delay=50&  
…

delay is seen as a string instead of a number is this right?

---

<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:** [May 26, 2004, 4:03pm UTC](https://forum.kirupa.com/t/split-external-text-by-return/111381/6 "2004-05-26T16:03:44Z")

</div>

Both ways should return a string.  
If you want to use it as a number, use:

```auto
parseInt(this.delay)

```
