A URLRequest object is created to identify the location of the XML file, which for this example is in the same directory as the SWF file. The file is loaded in a try...catch block in order to catch any error that may occur. (Here we catch the SecurityError errors.) If an IO_ERROR event occurs, the errorHandler() method is invoked, which writes an error message in the xmlTextField text field. Once the XML file data is received and place in the data property of the loader URLLoader object, the event is dispatched and the loaderCompleteHandler() method is invoked.