-
Stopping a loadMovie
I have a jpeg image that loads when a button is clicked (using loadMovie). If the user clicks another button before that jpeg is done loading, I want the loadMovie command to stop loading the current jpeg, so I can start loading the new one. Basically I am asking how to stop a loadMovie command. Can this be done?
-
Registered User
hi,
I guess the solution is unloadMovie().
But, if you specify the same target when you click the second button, you don't even need to use it, as the second loadMovie() will act as if unloadMovie() was used.
Example:
code:
my_mc.loadMovie("some.jpg");
// and then:
my_mc.loadMovie("other.jpg");
only other.jpg will be loaded.
-
Oops. I wasn't very clear. lol. There are actually a bunch of jpg's on the screen in a photo gallery. They load consecutively. But if the user clicks a button to change the page before all the images are loaded, I want it to stop loading the current image and start loading the first image on this new page. I am looking for a way to stop a loadMovie action.
-
Registered User
If changing the page means go to a different frame, and the target doesn't exist in that frame, you don't need to do anything.
If not, i.e., the target still exists, the last answer still applyes:
unloadMovie()
or a new
loadMovie()
Removing the target could also be an option...
Other than this, there is no way to stop a loadMovie().
Even in MX 2004, with the MovieClipLoader Class there isn't a direct way to stop a loadClip(). I guess the solution would be exactly the same: a new loadClip() or an unloadClip().
-
just load the the image into the same level and it will replace what is currently loading,...no need for any script....just target the same level or MC
B
-
Can't stop a MCL once it has started loading
For my own reasons I wanted to stop something from loading.
I have a gallery where each thumbnail has it's own MCL. When you click on the thumbnail, a window pops up that shows a bigger version of that picture (another, bigger file) which is in it's own movieclip, and has it's own MCL in that MC. When the pop ups close button is clicked, it is removed from the stage via removeClip.
To test, I uploaded this onto the net and cleared my cache. I opened a popup, and closed it. I browsed other pictures and their pop ups. I stopped browsing - my internet was still downloading data. I when it stopped being active, I went back to that first popup I opened - and voila - it was finished downloading. And I'm sure that Flash continually downloaded the pic because it is 1.8MB. I couldn't have been mistaken by a fast download of a small file size.
I guess there is no way to stop an MCL save from closing the whole flash program.
-
Thanks for the replies. Yeah, I absolutely need to stop the movie from loading. I had tried unloadMovie(), but it didn't seem to work. It was because I had to put that command in two places and I only had it in one. It works now and unloadmovie() stops the currently loading clip. Thanks for the help!
-
Thanks to Lee Brimelow (www.gotoandlearn.com), I know a solution to this: tell the net stream to play something that doesn't exist.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|