1 Reply Latest reply on May 27, 2008 5:26 AM by stigbn

    SWFLoader timing issue

    stigbn Level 1
      I have a catalog where I am displaying a number of SWF files (movieclips). The SWF files are loaded dynamically using SWFLoaders, but sometimes the load operation does not complete, meaning that the complete event is never fired.

      As part of my debugging, I handled the Ioerror, httpstatus, open and init events. The event handlers were just incrementing som debug counters, but when I am doing this, the problem cannot be reproduced. So it looks like the tiny delay introduced by handling these events, makes the SWFLoader work.

      So is there a timing issue to be aware of when using a lot (30-40) loaders too fill a catalog?

      When I am not handling the extra events ( = introducing tiny delays) 1,2 or sometimes 10 items are missing because their load operation does not complete (and no, IO error event is not fired).

      When the extra event handlers are used, the problem disappears. Seems lilke a timing issue with the SWFLOader, or perhaps the flash Loader class which I believe is used internally by the SWFLoader ?

      Does anyone have any ideas as to how to solve this issue ?

      best regards Stig

      best regards Stig
        • 1. Re: SWFLoader timing issue
          stigbn Level 1
          Hmm now I managed to reproduce the error when I am handling events, so this did not fix the problem.

          So to sum up here is the situation:

          I am trying to load 35 SWF files in my flex application (for a catalog) but only 24 of the load operations are completed.

          I have set up some debug handlers which increment some counters to see what is actually happening:

          load() is called 35 times

          complete event is fired 24 times

          IO error event is fired 0 times

          init event is fired 24 times

          open event is fired 35 times

          HTTPstatuscode event is fired 24 times (and every time the status code is 0).

          Note that the open event was fired 35 times, but I have 11 SWF files which never load.

          Please note that most of the time all 35 swf files are loaded just fine, but roughly every 10th time some of the load operations fail.

          Does anybody have any clues ?