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

Append new content to the current loaded swf

Problem
Content has been loaded from a text file. How do we append text through AS3?

Solution
Using appendText method, or just + your content.

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.text=myLoaderObject.data + " Added some new
text here!!!";//first way
myContent_txt.appendText(" Hello world! Added new text
again!");//second way
}

index26

Example and source in the attached file.

Source:
append_new_text_for_existing

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>