HTML rendring of external txt file not working

By Billy Goat Karaoke | Jul 11, 2009

actionscript3

Hi

I’ve spend a lot of hours researching this problem, and nothing has worked so far.

I have a simple text file that I’m loading into a dynamic text box. I want to get one line spacing between the lines, not two like a carriage return seems to give me. So I understand the way to do this is with Html rendering.

So I click the html render button for my text box, add a ‘<br />’ to my text file, but still no good - it just displays the ‘<br />’

Here’s my dynamic text box code:
———————————–
var textRequest:URLRequest = new URLRequest("gigguide.txt");
var textLoader:URLLoader = new URLLoader();
textLoader.load(textRequest);
textLoader.addEventListener(Event.COMPLETE,fileLoa ded);

function fileLoaded(event:Event):void {
text_field.text = event.target.data;
}
—————————————

and here’s my text file:

item1<br />item2

I’ve tried adding:

text_field.html = true;
text_field.htmlText = event.target.data;

to the code, but I get an error saying the term html is undefined.

I’m using AS3

Cheers for any light you can throw on this.

Shaun

actionscript3

Please reply at our Forum

Leave a Comment

If you would like to make a comment, please fill out the form below.

Name (required)

Email (required)

Website

Comments

© 2007 ActionScript 3.0