Help getting <> to render in dynamic txt field

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

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…

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 :slight_smile:

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


&var1=nathan&
&var2=you&

will be read as var1 and var2

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.

I think he has forgotten to render the textfield as html

some.html = true;

scotty(-:

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 :frowning: 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.

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.

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

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.

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 :slight_smile:

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.

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

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

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

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

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


<html> is at the top of the html file

?

scotty(-:

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

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

scotty(-: