# Help getting \<\> to render in dynamic txt field

**URL:** <https://forum.kirupa.com/t/help-getting-to-render-in-dynamic-txt-field/183841>\
**Category:** flash\
**Created:** [March 30, 2006, 4:31pm UTC](https://forum.kirupa.com/t/help-getting-to-render-in-dynamic-txt-field/183841 "2006-03-30T16:31:46Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![spinweb](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@spinweb](https://forum.kirupa.com/u/spinweb)\
**Post date:** [March 30, 2006, 4:31pm UTC](https://forum.kirupa.com/t/help-getting-to-render-in-dynamic-txt-field/183841/1 "2006-03-30T16:31:46Z")

</div>

I’m trying to load a bunch of code from a text file. It’s bombing at the point it sees the \< and \> characters (i.e., it just stops rendering beyond that point). I’ve tried the %3e and %3c solutions, no go. I’ve tried \<, as Moock suggests. I’ve tried .

Anyone know the secret?

Here’s my code:

loadText = new LoadVars();  
loadText.load(“potential\_win.txt”);  
//creating the loadVarsText function  
loadText.onLoad = function() {  
scroller.htmlText = this.myText;  
scroller.htmlText = unescape(this.myText);  
};

Thanks!

Rick

---

<div class="post-metadata">

**Author:** ![kBisk](https://avatars.discourse-cdn.com/v4/letter/k/eb8c5e/32.png) [@kBisk](https://forum.kirupa.com/u/kBisk)\
**Post date:** [March 30, 2006, 6:12pm UTC](https://forum.kirupa.com/t/help-getting-to-render-in-dynamic-txt-field/183841/2 "2006-03-30T18:12:28Z")

</div>

I’ve never had any problems putting \< and \> in external text files. The only character that would end a variable is the amperstand “&”. You’ll have to post the contents of your text file to see exactly whats going on…

---

<div class="post-metadata">

**Author:** ![lordkiller](https://avatars.discourse-cdn.com/v4/letter/l/9fc29f/32.png) [@lordkiller](https://forum.kirupa.com/u/lordkiller)\
**Post date:** [April 14, 2006, 11:24pm UTC](https://forum.kirupa.com/t/help-getting-to-render-in-dynamic-txt-field/183841/3 "2006-04-14T23:24:43Z")

</div>

Project started in MX , later transfered in MX2004 for commodity, with prototypes so the settings are: export for Player6 with AS1

Rendering html tags in a runtime created TextField (with .html enabled), the text is loaded via LoadVars, everything ok until in the text appear the " \< " caracter, after that nothing show up…

Tired the ASCII %3c , the same kill effect, but the %3b and the “\>” as %3e show up…  
The &lt and &gt kill the rendering also.

Please play around with my code, maybee someone can figure out why…or can suggest a combination that work.  
The .txt file is located in the Pages folder.

I tested also on Flash8 with Player8, same result…

Im to tyred and fustrated to search the bug threads 🙂

---

<div class="post-metadata">

**Author:** ![nathan99](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nathan99](https://forum.kirupa.com/u/nathan99)\
**Post date:** [April 15, 2006, 5:17am UTC](https://forum.kirupa.com/t/help-getting-to-render-in-dynamic-txt-field/183841/4 "2006-04-15T05:17:04Z")

</div>

yeah ampersands wont work because whenver a loaded.txt file has the & symbol, it ends a string  
for eg

```auto

&var1=nathan&
&var2=you&

```

will be read as var1 and var2

---

<div class="post-metadata">

**Author:** ![gvozden](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/gvozden/32/1084_2.png) [@gvozden](https://forum.kirupa.com/u/gvozden)\
**Post date:** [April 15, 2006, 8:27am UTC](https://forum.kirupa.com/t/help-getting-to-render-in-dynamic-txt-field/183841/5 "2006-04-15T08:27:39Z")

</div>

In XML \< and \> don’t work as I’ve tried  
instead I use [and] and then replace them in Flash

---

<div class="post-metadata">

**Author:** ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)\
**Post date:** [April 15, 2006, 9:04am UTC](https://forum.kirupa.com/t/help-getting-to-render-in-dynamic-txt-field/183841/6 "2006-04-15T09:04:27Z")

</div>

> [@gvozden](#):
>
> In XML \< and \> don’t work as I’ve tried  
> instead I use [and] and then replace them in Flash

In XML, \< and \> define a new node in the XML - if you don’t want them to get parsed you would use CDATA. And besides, he’s not talking about XML.

You really shouldn’t have any problems with the \< and \> in a text file so I’m betting that you aren’t loading it properly in Flash.

---

<div class="post-metadata">

**Author:** ![scotty](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@scotty](https://forum.kirupa.com/u/scotty)\
**Post date:** [April 15, 2006, 9:17am UTC](https://forum.kirupa.com/t/help-getting-to-render-in-dynamic-txt-field/183841/7 "2006-04-15T09:17:39Z")

</div>

> [@TheCanadian](#):
>
> I…You really shouldn’t have any problems with the \< and \> in a text file so I’m betting that you aren’t loading it properly in Flash.

I think he has forgotten to render the textfield as html

```auto
some.html = true;

```

scotty(-:

---

<div class="post-metadata">

**Author:** ![lordkiller](https://avatars.discourse-cdn.com/v4/letter/l/9fc29f/32.png) [@lordkiller](https://forum.kirupa.com/u/lordkiller)\
**Post date:** [April 16, 2006, 7:33pm UTC](https://forum.kirupa.com/t/help-getting-to-render-in-dynamic-txt-field/183841/8 "2006-04-16T19:33:56Z")

</div>

Thanks for your answers.

Scotty: .html is true(I use for text formating)… and the problem persist only for \< , the \> show up fine, the %3c have an “&” behavoir…  
TheCanadian : is loaded properly this is page22 I load with the same code, and the first with “\<”

The text is large, a whole page 800x590, so not proper for load via XML, and a lot of pages ☹ need to be loaded containing the \< …around 30-35

gvozden: thanks for the tip: load [] and replace in flash… this is a solution for my problem, no the best but solve the problem, the backward is: this text later need to be edited by others…who wait to find html code inside :))

Something like CDATA for XML exist for LoadVars ?

Thanks to everybody.

---

<div class="post-metadata">

**Author:** ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)\
**Post date:** [April 16, 2006, 7:45pm UTC](https://forum.kirupa.com/t/help-getting-to-render-in-dynamic-txt-field/183841/9 "2006-04-16T19:45:30Z")

</div>

In that file you posted, the data is loaded fine from \*page\_test.txt. \*Your problem is that there is no text field to even put the loaded text into. So like scotty and I said, you have a problem displaying the text in Flash.

---

<div class="post-metadata">

**Author:** ![lordkiller](https://avatars.discourse-cdn.com/v4/letter/l/9fc29f/32.png) [@lordkiller](https://forum.kirupa.com/u/lordkiller)\
**Post date:** [April 16, 2006, 8:49pm UTC](https://forum.kirupa.com/t/help-getting-to-render-in-dynamic-txt-field/183841/10 "2006-04-16T20:49:43Z")

</div>

Is my fault.  
I forgot to add the prototype containing .as , sorry.  
Now updated the zip file.

myPage proto line 55 contain the createEmptyTextField method  
line 56: .html = true

This is an example/test version, so most of the code in the .as is useles without the whole context

---

<div class="post-metadata">

**Author:** ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)\
**Post date:** [April 16, 2006, 9:00pm UTC](https://forum.kirupa.com/t/help-getting-to-render-in-dynamic-txt-field/183841/11 "2006-04-16T21:00:20Z")

</div>

Then I don’t know what your having a problem with because it loads the text file fine and puts it in the text field with the correct formatting applied.

---

<div class="post-metadata">

**Author:** ![lordkiller](https://avatars.discourse-cdn.com/v4/letter/l/9fc29f/32.png) [@lordkiller](https://forum.kirupa.com/u/lordkiller)\
**Post date:** [April 16, 2006, 9:11pm UTC](https://forum.kirupa.com/t/help-getting-to-render-in-dynamic-txt-field/183841/12 "2006-04-16T21:11:42Z")

</div>

Pls. edit the .txt file and put the “\<” as %3c(or whatever) somewhere and from that point the text disapear / at least for me, if on your machine show up fine tell me which flash version, what player u used.  
Help pls 🙂

---

<div class="post-metadata">

**Author:** ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)\
**Post date:** [April 16, 2006, 9:16pm UTC](https://forum.kirupa.com/t/help-getting-to-render-in-dynamic-txt-field/183841/13 "2006-04-16T21:16:56Z")

</div>

I havent touched the text file - just tested it in Flash as is and it works.

I’m using Flash 8 publishing to Flash Player 6, AS1.

---

<div class="post-metadata">

**Author:** ![lordkiller](https://avatars.discourse-cdn.com/v4/letter/l/9fc29f/32.png) [@lordkiller](https://forum.kirupa.com/u/lordkiller)\
**Post date:** [April 16, 2006, 9:20pm UTC](https://forum.kirupa.com/t/help-getting-to-render-in-dynamic-txt-field/183841/14 "2006-04-16T21:20:51Z")

</div>

pls. change the .txt, if u look at, the \< is missing ☹ from the begining of the HTML tags, becouse I cant find how to put inside to show up

---

<div class="post-metadata">

**Author:** ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)\
**Post date:** [April 16, 2006, 9:27pm UTC](https://forum.kirupa.com/t/help-getting-to-render-in-dynamic-txt-field/183841/15 "2006-04-16T21:27:37Z")

</div>

Just use \< and \> - but it begs the question why are you using the _html_ tags?

---

<div class="post-metadata">

**Author:** ![lordkiller](https://avatars.discourse-cdn.com/v4/letter/l/9fc29f/32.png) [@lordkiller](https://forum.kirupa.com/u/lordkiller)\
**Post date:** [April 16, 2006, 9:30pm UTC](https://forum.kirupa.com/t/help-getting-to-render-in-dynamic-txt-field/183841/16 "2006-04-16T21:30:47Z")

</div>

the simple \< \> wont show up ☹  
Use of html tags - becouse this is the subject of this project, a comprehensive presentation of html tags ☹ and their use/effect on a webpage

---

<div class="post-metadata">

**Author:** ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)\
**Post date:** [April 17, 2006, 5:49am UTC](https://forum.kirupa.com/t/help-getting-to-render-in-dynamic-txt-field/183841/17 "2006-04-17T05:49:43Z")

</div>

> [@lordkiller](#):
>
> the simple \< \> wont show up ☹  
> Use of html tags - becouse this is the subject of this project, a comprehensive presentation of html tags ☹ and their use/effect on a webpage

Ya but Flash doesn’t support \<html\>\</html\> . . .

---

<div class="post-metadata">

**Author:** ![scotty](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@scotty](https://forum.kirupa.com/u/scotty)\
**Post date:** [April 17, 2006, 5:57am UTC](https://forum.kirupa.com/t/help-getting-to-render-in-dynamic-txt-field/183841/18 "2006-04-17T05:57:48Z")

</div>

So in your textfield you want to show something like (not render)

```auto

<html> is at the top of the html file

```

?

scotty(-:

---

<div class="post-metadata">

**Author:** ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)\
**Post date:** [April 17, 2006, 6:19am UTC](https://forum.kirupa.com/t/help-getting-to-render-in-dynamic-txt-field/183841/19 "2006-04-17T06:19:45Z")

</div>

Ooooooooooooooooooooooooooooh!!! If that is what he wants I’ve done nothing but trouble :thumb2:

---

<div class="post-metadata">

**Author:** ![scotty](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@scotty](https://forum.kirupa.com/u/scotty)\
**Post date:** [April 17, 2006, 6:32am UTC](https://forum.kirupa.com/t/help-getting-to-render-in-dynamic-txt-field/183841/20 "2006-04-17T06:32:27Z")

</div>

:lol: I’m not 100% sure he wants that, but it looks like 😉

scotty(-:

[Next page](https://forum.kirupa.com/t/help-getting-to-render-in-dynamic-txt-field/183841.md?page=2)
