# Load Pre-formatted HTML into a textfield?

**URL:** <https://forum.kirupa.com/t/load-pre-formatted-html-into-a-textfield/178736>\
**Category:** flash\
**Created:** [February 13, 2006, 8:50pm UTC](https://forum.kirupa.com/t/load-pre-formatted-html-into-a-textfield/178736 "2006-02-13T20:50:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![CEOofAEP](https://avatars.discourse-cdn.com/v4/letter/c/7cd45c/32.png) [@CEOofAEP](https://forum.kirupa.com/u/CEOofAEP)\
**Post date:** [February 13, 2006, 8:50pm UTC](https://forum.kirupa.com/t/load-pre-formatted-html-into-a-textfield/178736/1 "2006-02-13T20:50:54Z")

</div>

Greetings.

I know it’s possible and I kind of got it to work- but this is a bit tricky…

I have pre-formatted HTML in a textfile. Let me know if any of this might already be an error-source- I am currently too tired to try out alternatives:

the textfile looks something like this:

```auto
<p><img src='biathlon' vspace='2' hspace='4' width='40' height='40'></img>Alot of text</p>
<p><br></p>
<p><img src='biathlon' vspace='2' hspace='4' width='40' height='40'></img>Even MORE Text</p>
<p><br></p>

```

it’s saved as a “.txt”-file… I didn’t think that would really make a difference?

What I want to do is load the file and dump it directly to an HTML-enabled textfield, using something like

```auto
if (loaded) {
TickerData_txt.htmlText = this;
}

```

in the function connected to the “onLoad”.

If I use “LoadVars” as a handler to load the file, it gives me the raw data, something like “%3Cp%3E%3Cimg%20src=%27biathlon%27%20vspace%3D%272%27…” (you get the idea)…

If I use an XML handler, it only gives me the first entry when I use “this” to send the file’s content to the htmlText-field… probably because each entry in the file is enclosed by “\<p\>”-tags and the XML-handler considers the file to be over once the first closing “\</p\>” occures?

What would need to be added to the file to make it load it all? Or what would I need to change about the function to make sure it sends the whole content of the file?

When I use “trace” on the “this” that is loaded, it actually _does_ give back only what it also sends to the textfield, even though the text-file contains several rows of that stuff.

Your help is very appreciated.

Thanks! 😃
