//Create the URLLOader instance var myLoader:URLLoader = new URLLoader() //the data will come as URL-encoded variables myLoader.dataFormat = URLLoaderDataFormat.VARIABLES //Load using an URLRequest, even beeing local myLoader.load(new URLRequest("about.txt")) //onLoad handler listener myLoader.addEventListener(Event.COMPLETE, onDataLoad) //Error handling myLoader.addEventListener(IOErrorEvent.IO_ERROR, onIOError) myLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError) //Could be an error or just a message myLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, onHTTPStatus) //add a listener for the complete event function onDataLoad(evt:Event){ Title_txt.text = evt.target.data.Title Comments_txt.text = evt.target.data.Comments } //error callbacks function onIOError(evt:IOErrorEvent){ trace("IOError: "+evt.text) } function onHTTPStatus(evt:HTTPStatusEvent){ trace("HTTPStatus: "+evt.status) } function onSecurityError(evt:SecurityErrorEvent){ trace("SecurityError: "+evt.text) }