title: Flash AS3 text=Error #2124: Loaded file is an unknown type when importing XML?
body: <p>I can't seem to find a thread anywhere that matches my needs, so please direct me if this has been answered elsewhere.</p>
  
  <p>Currently pulling my hair out over an error that shouldn't be happening. I'm making a flash website which has an XML gallery in it, just as I've done before in many, many projects (<a href="http://www.sulsc.org/#/pictures/82" rel="nofollow">like this one</a>). When I load the XML file, however, I get the following error:</p>
  
  <pre><code>Error #2044: Unhandled IOErrorEvent:. text=Error #2124: Loaded file is an unknown type.
  </code></pre>
  
  <p>The only thing that's different in this project to previous ones is I'm making it all in document class coding, but so far this hasn't been an issue at all. I'm really confused as to why flash doesn't like the XML file, and I think there's something else making this error appear or I haven't imported something rather than Flash literally not recognising the filetype.</p>
  
  <p>Here's the relevant code:</p>
  
  <pre><code>    public function pg3_setup():void
      {
          trace("Page 3 setup in progress...");
          p3_gallery_loader.load(new URLRequest("flash_scripts/gallery.xml"));
          p3_gallery_loader.addEventListener(Event.COMPLETE,process_gallery);
  
          function process_gallery(e:Event):void
          {
              trace("Gallery loaded");
              var gallery_xml:XML = new XML(e.target.data);
              image_list = gallery_xml.IMAGE;
              number_of_images = image_list.length();
              container_mask_width = bg.width - p_pad_left - p_pad_right;
              create_container();
              load_thumbs();
          }
      }
  </code></pre>
  
  <p>I never get to the process_gallery function, so "Gallery loaded" is never traced. Any help on this (probably painfully obvious) issue would be great!</p>
  
  <p><strong>Update:</strong> should probably also include the XML in question, although as far as I'm aware it's the same as every other XML file I've used for this sort of thing.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;GALLERY ROWS="1" WIDTH="25" HEIGHT="25"&gt;
  &lt;IMAGE FULL="full_images/I01.jpg" THUMB="thumbs/TI01.jpg" DES="PICTURE_1"/&gt;
  &lt;IMAGE FULL="full_images/I02.jpg" THUMB="thumbs/TI02.jpg" DES="PICTURE_2"/&gt;
  &lt;IMAGE FULL="full_images/I03.jpg" THUMB="thumbs/TI03.jpg" DES="PICTURE_3"/&gt;
  &lt;IMAGE FULL="full_images/I04.jpg" THUMB="thumbs/TI04.jpg" DES="PICTURE_4"/&gt;
  &lt;IMAGE FULL="full_images/I05.jpg" THUMB="thumbs/TI05.jpg" DES="PICTURE_5"/&gt;
  &lt;IMAGE FULL="full_images/I06.jpg" THUMB="thumbs/TI06.jpg" DES="PICTURE_6"/&gt;
  &lt;IMAGE FULL="full_images/I07.jpg" THUMB="thumbs/TI07.jpg" DES="PICTURE_7"/&gt;
  &lt;IMAGE FULL="full_images/I08.jpg" THUMB="thumbs/TI08.jpg" DES="PICTURE_8"/&gt;
  &lt;IMAGE FULL="full_images/I09.jpg" THUMB="thumbs/TI09.jpg" DES="PICTURE_9"/&gt;
  &lt;IMAGE FULL="full_images/I10.jpg" THUMB="thumbs/TI10.jpg" DES="PICTURE_10"/&gt;
  &lt;IMAGE FULL="full_images/I11.jpg" THUMB="thumbs/TI11.jpg" DES="PICTURE_11"/&gt;
  &lt;IMAGE FULL="full_images/I12.jpg" THUMB="thumbs/TI12.jpg" DES="PICTURE_12"/&gt;
  &lt;IMAGE FULL="full_images/I13.jpg" THUMB="thumbs/TI13.jpg" DES="PICTURE_13"/&gt;
  &lt;IMAGE FULL="full_images/I14.jpg" THUMB="thumbs/TI14.jpg" DES="PICTURE_14"/&gt;
  &lt;IMAGE FULL="full_images/I15.jpg" THUMB="thumbs/TI15.jpg" DES="PICTURE_15"/&gt;
  &lt;IMAGE FULL="full_images/I16.jpg" THUMB="thumbs/TI16.jpg" DES="PICTURE_16"/&gt;
  &lt;IMAGE FULL="full_images/I17.jpg" THUMB="thumbs/TI17.jpg" DES="PICTURE_17"/&gt;
  &lt;IMAGE FULL="full_images/I18.jpg" THUMB="thumbs/TI18.jpg" DES="PICTURE_18"/&gt;
  &lt;IMAGE FULL="full_images/I19.jpg" THUMB="thumbs/TI19.jpg" DES="PICTURE_19"/&gt;
  &lt;IMAGE FULL="full_images/I20.jpg" THUMB="thumbs/TI20.jpg" DES="PICTURE_20"/&gt;
  &lt;IMAGE FULL="full_images/I21.jpg" THUMB="thumbs/TI21.jpg" DES="PICTURE_21"/&gt;
  &lt;IMAGE FULL="full_images/I22.jpg" THUMB="thumbs/TI22.jpg" DES="PICTURE_22"/&gt;
  &lt;IMAGE FULL="full_images/I23.jpg" THUMB="thumbs/TI23.jpg" DES="PICTURE_23"/&gt;
  &lt;IMAGE FULL="full_images/I24.jpg" THUMB="thumbs/TI24.jpg" DES="PICTURE_24"/&gt;
  &lt;IMAGE FULL="full_images/I25.jpg" THUMB="thumbs/TI25.jpg" DES="PICTURE_25"/&gt;
  &lt;IMAGE FULL="full_images/I26.jpg" THUMB="thumbs/TI26.jpg" DES="PICTURE_26"/&gt;
  &lt;IMAGE FULL="full_images/I27.jpg" THUMB="thumbs/TI27.jpg" DES="PICTURE_27"/&gt;
  &lt;IMAGE FULL="full_images/I28.jpg" THUMB="thumbs/TI28.jpg" DES="PICTURE_28"/&gt;
  &lt;IMAGE FULL="full_images/I29.jpg" THUMB="thumbs/TI29.jpg" DES="PICTURE_29"/&gt;
  &lt;IMAGE FULL="full_images/I30.jpg" THUMB="thumbs/TI30.jpg" DES="PICTURE_30"/&gt;
  &lt;IMAGE FULL="full_images/I31.jpg" THUMB="thumbs/TI31.jpg" DES="PICTURE_31"/&gt;
  &lt;IMAGE FULL="full_images/I32.jpg" THUMB="thumbs/TI32.jpg" DES="PICTURE_32"/&gt;
  &lt;/GALLERY&gt;
  </code></pre>