# What is wrong when adding my external file to stage?

**URL:** <https://forum.kirupa.com/t/what-is-wrong-when-adding-my-external-file-to-stage/243727>\
**Category:** flash\
**Created:** [November 9, 2007, 11:05pm UTC](https://forum.kirupa.com/t/what-is-wrong-when-adding-my-external-file-to-stage/243727 "2007-11-09T23:05:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mippzon](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@Mippzon](https://forum.kirupa.com/u/Mippzon)\
**Post date:** [November 9, 2007, 11:05pm UTC](https://forum.kirupa.com/t/what-is-wrong-when-adding-my-external-file-to-stage/243727/1 "2007-11-09T23:05:11Z")

</div>

Hey!

Could use some help here. I have an empty fla-file, and this code as the document class:

```auto

package {

    import flash.display.*;
    import flash.events.Event;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.events.ProgressEvent;

    public class Photoexperiment extends Sprite {

        var xmlLoader:URLLoader = new URLLoader();
        var xmlRequest:URLRequest = new URLRequest("photo.xml");

        var thumbRoot:String = "http://www.michaelpersson.se/photos/thumbs/";

        public function Photoexperiment() {
            xmlLoader.load(xmlRequest);
            xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
        }
        public function xmlLoaded(e:Event):void {
            var myXML:XML = new XML(xmlLoader.data);
            var thumbAdress:String = thumbRoot + myXML.photo[0].thumb[0];
            thumbLoader(thumbAdress);

        }
        function thumbLoader(thumbAdress:String):void {
            var thumbRequest:URLRequest = new URLRequest(thumbAdress);
            var thumbLoader:Loader = new Loader();
            thumbLoader.load(thumbRequest);

            thumbLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbLoaded);
            thumbLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, thumbProgress);

        }
        function thumbProgress(eventet:ProgressEvent):void {
            trace("Downloading file");
        }
        public function thumbLoaded(e:Event):void {

        }

    }
}

```

In the last function thumbLoaded, I want to just add the loaded picture to the stage, but I just get error messages when trying. So can someone help me, and tell me what I suppose to write in thumbLoaded?

Thank you in advance
