views:

715

answers:

3

Hi,

I'm developing a system which use resources(image/sound) from server. on user action, I download specific resources and use them.

now, before all those resources downloading completes, If user perform another action, I want to discontinue/cancel downloading current ones. Is this possible?

I tried with Loader.stop() method but it dosen't seems working as it should be.

Not canceling this slows down new resource downloading process and user has to wait for long for new resources.

Thanks in advance!!

A: 

You can stop downloading the sound using the close() method of the Sound class. This method

Closes the stream, causing any download of data to cease. No data may be read from the stream after the close() method is called.

As for images and movies, the Loader class do have an unload() method, but I'm not sure if calling that method in the middle of the downloading will work.

Amarghosh
I tried that as mentioned in question but, it dosen't seem to close stream. :(
Bhavesh.Bagadiya
A: 

This approach might be of help:

http://onflash.org/ted/2007/12/progressive-image-loading-with.php

jedierikb
A: 

Have you tried it on a real server? The Flash IDE has a known bug that prevents Loader.close() from working correctly...

kkyy