# Loading text with AS

**URL:** https://forum.kirupa.com/t/loading-text-with-as/20642
**Category:** Uncategorized
**Created:** [May 11, 2003, 6:36pm UTC](https://forum.kirupa.com/t/loading-text-with-as/20642 "2003-05-11T18:36:53Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![morse](https://avatars.discourse-cdn.com/v4/letter/m/bbce88/32.png) [@morse](https://forum.kirupa.com/u/morse)
#### Post date: [May 11, 2003, 6:36pm UTC](https://forum.kirupa.com/t/loading-text-with-as/20642/1 "2003-05-11T18:36:53Z")

</div>

Is there any way to make line breaks when you load text into a dynamic text box, other than using html? And if not, could someone give me an example of how to do it using html?

---

<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 11, 2003, 6:50pm UTC](https://forum.kirupa.com/t/loading-text-with-as/20642/2 "2003-05-11T18:50:55Z")

</div>

= new line

\r = carriage return

just put them where you want them. Should work.

---

<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 11, 2003, 6:58pm UTC](https://forum.kirupa.com/t/loading-text-with-as/20642/3 "2003-05-11T18:58:12Z")

</div>

can I do this?:

quote = new Array("’’ Tastes Like Burning ‘’\*\*  
\*\* - Ralph")

and then load text into a box from the array? I mean, I know I can load the text from the array, but is that up there legal?

---

<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 11, 2003, 7:00pm UTC](https://forum.kirupa.com/t/loading-text-with-as/20642/4 "2003-05-11T19:00:44Z")

</div>

yeah, what exactly are you trying to do?

quote = "Tastes Like Burning

- Ralph"

just include the  
right in the string. and be careful its \ not /

---

<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 11, 2003, 7:02pm UTC](https://forum.kirupa.com/t/loading-text-with-as/20642/5 "2003-05-11T19:02:04Z")

</div>

Hey, I’m having the same problem. I have a text box loaded dynamically and I have it in HTML format but when I put things like \<b\>News\</b\> in my notepad file they don’t show up when i publish. Is there anyway that I don’t make it HTML and use the /n and /r commands. Because when I put /n it actually shows up when I publish

---

<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 11, 2003, 7:02pm UTC](https://forum.kirupa.com/t/loading-text-with-as/20642/6 "2003-05-11T19:02:05Z")

</div>

Oh I see. I’m making a random quotes thinger.

---

<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 11, 2003, 7:03pm UTC](https://forum.kirupa.com/t/loading-text-with-as/20642/7 "2003-05-11T19:03:10Z")

</div>

Oy hey it does work! Thanks a trillian gazillian Jubba!

---

<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 11, 2003, 7:03pm UTC](https://forum.kirupa.com/t/loading-text-with-as/20642/8 "2003-05-11T19:03:11Z")

</div>

i mean i use  
and it still doesn’t work…that was a typo in the post

---

<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 11, 2003, 7:03pm UTC](https://forum.kirupa.com/t/loading-text-with-as/20642/9 "2003-05-11T19:03:45Z")

</div>

i still need help ☹

---

<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 11, 2003, 8:02pm UTC](https://forum.kirupa.com/t/loading-text-with-as/20642/10 "2003-05-11T20:02:41Z")

</div>

maybe if you post the fla we can help, or post some code, it’s either the way you made your text file or your as syntax…

---

<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 12, 2003, 3:38am UTC](https://forum.kirupa.com/t/loading-text-with-as/20642/11 "2003-05-12T03:38:39Z")

</div>

i got everything to work now I just can’t get things to be bold or what not. this is what i have in my firstframe

loadText = new loadVars();  
loadText.load(“news.txt”);  
// creating the loadVarsText function  
loadText.onLoad = function() {  
\_root.text.scroller.html = true;  
\_root.text.scroller.htmlText = this.newstext;  
};

and this is what I have in my notpad file

newstext=

\<p\>\<b\>Layout - \</b\>Posted by Sanman\</p\>  
\<p\>This is the news page.\</p\>

and the word layout won’t show up.?

---

<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 12, 2003, 3:39am UTC](https://forum.kirupa.com/t/loading-text-with-as/20642/12 "2003-05-12T03:39:45Z")

</div>

"newstext=

\<p\>\<b\>Layout - \</b\>Posted by Sanman\</p\>  
\<p\>This is the news page.\<p\>"

I would like to get rid of the HTML part and just use the  
and \r

---

<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 12, 2003, 9:56am UTC](https://forum.kirupa.com/t/loading-text-with-as/20642/13 "2003-05-12T09:56:17Z")

</div>

Well, then what you’re looking for is the url encode method. You can’t use escape characters in the text file. Where you would have used "  
", use “%0d”, and where you would have used “\r”, use “%0a”. Other useful codes are: “%09” (tab) and “%20” (space). Anyway, the problem is that Flash doesn’t read escape characters in the text file, that’s solely an ActionScript thing (and, since it’s a C derivative, you can use the same escape chars in C: printf(“It’s the same  
really!  
And\\Or quite different, you see?”); ).

Anyway,  
–Elios
