February 2010
M T W T F S S
« Jan   Mar »
1234567
891011121314
15161718192021
22232425262728

Using the htmlText method

Problem
Load a text file with html code into Flash

Solution
Use the htmlText method.

Detailed explanation

var myTextObject:URLRequest=new URLRequest("my_content.txt");

var myLoaderObject:URLLoader = new URLLoader();

myLoaderObject.addEventListener(Event.COMPLETE,
myContentWasLoaded);

myLoaderObject.load(myTextObject);

function myContentWasLoaded(e:Event):void {

myContent_txt.htmlText=myLoaderObject.data;

}


index20
An example is in the source of the attached file.

Source:
reading_html

Thank you for reading.

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>