2 Replies Latest reply on Feb 12, 2010 5:03 PM by bentwonk

    Quick question, getting the filename of file just loaded by a loader

    bentwonk

      How do i detect the file that a loader has just completed?

       

      I wish to load a series of small files, and am using the loader functions

       

       

          url = "image"+index+".png";
          var request:URLRequest = new URLRequest(url);
          loader.load(request);
         loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadCompleteHandler);

       

      and then an event handler

       

          private functionloadCompleteHandler(event:Event):void
              {
                //do stuff
              }

       

      however, i am firing of a number of these load requests, and do not want to assume they will be complete in the order they were triggered, so I want a way of detecting which load has just been completed, can this be deduced from the even (url field was blank).

       

      I had an attempt with a custom event handler, but am unsure how to make it trigger on load completion.

       

      thanks Ben