[Flashcoders] getting text from textfile.txt into a dynamic text field

2009-11-23 Thread Alan Neilsen
In CS4 (AS3) I have a simple text file for my client to easily update their text content. I found the method var loader:URLLoader = new URLLoader(new URLRequest(textfile1.txt)); that is supposed to load data from the external text file, but I can't work out what I need to do to then get that

Re: [Flashcoders] getting text from textfile.txt into a dynamic text field

2009-11-23 Thread Eric E. Dolecki
var loader:URLLoader = new URLLoader(); loader.addEventListener(Event.COMPLETE, onLoaded); loader.load(new URLRequest(textfile1.txt)); function onLoaded(e:Event):void { someField_txt.text = e.target.data; } On Mon, Nov 23, 2009 at 4:51 PM, Alan Neilsen aneil...@gotafe.vic.edu.auwrote: In

Re: [Flashcoders] getting text from textfile.txt into a dynamic text field

2009-11-23 Thread Glen Pike
Hi, You need to add an event listener to the loader object to listen for the Complete event which tells you when the file has loaded. Then in this event you grab the data property of the loader object, e.g import flash.events.Event; //... function load():void { var loader:URLLoader = new