1 Reply Latest reply on Jun 22, 2007 12:13 AM by Greg Dove

    MovieClipLoader loadClip and unloadClip

      When I call unloadClip on a MovieClipLoader instance after loading has started, but before loading finishes, the clip continues loading. Is there any kind of "stop()" functionality for the MovieClipLoader?

      I have a main image viewer tied to button events that tell it to load the next or previous image. So if the user clicks the next button 10 times, the MovieClipLoader instance will load all 10 clips, rather than dumping the UrLs sent by the previous 9 clicks. I know I can just disable the buttons until the data has loaded, but that shouldn't be necessary.

      I've tried these workarounds with no success:
      - Re-initializing the moviecliploader instance I am using when either button is clicked
      - Deleting the target movie of the previous load, and putting the new target on another level with a different name

      I thought about setting the _alpha property of the targets of previous load requests to 0, but that still means that the user has to wait for each image to download before they get to the one they wanted. So they don't see the clips loading but they have to wait alot longer.

      I haven't found much help on the forums for this, or the documentation. So, I assume it's still possible to halt the loading of data with moviecliploader as I have not come across any site that says "You must wait for the load to finish before calling unloadClip()". The documentation says that unloadClip during loading should trigger onLoadError, but it doesn't -- someone made mention of this in the user comments section but I haven't seen a response to it.
      http://livedocs.adobe.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm?cont ext=Flash_MX_2004&file=00001584.html
      http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveD ocs_Parts&file=00002538.html

      Thanks in advance for any help. Even if it's to tell me that you can't stop loading a file mid-stream.
        • 1. Re: MovieClipLoader loadClip and unloadClip
          Greg Dove Level 4
          I haven't tried this, but I found this advice from a google search:

          When using the MovieClipLoader the .unloadMovie will only work after the
          'onLoadStart' has been called. If you can wait until that event has been
          dispatched then the download should stop. Otherwise it behaves as you have
          said, it just keeps loading as usual.

          Also, if you tell the MovieClip to load another movie (ex. "null") it will
          cancel the current load and begin on the next one. Of course if that one
          doesn't exist it fulfills your purpose of simply canceling a load.

          Original Source : http://www.openlaszlo.org/jira/browse/LPP-648

          Where it says .unloadMovie above I assume that's a mistake and that they mean the MovieClipLoader .unloadClip method.
          And in the second paragraph I assume its supposed to be MovieClipLoader instead of MovieClip.