sumathimuthu / as3corelib

Automatically exported from code.google.com/p/as3corelib
0 stars 0 forks source link

ResourceCache doesn't have functionality to allow adding timeouts to cached items #127

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Currently the ResourceCache does not allow for cached items to have 
information on when the item should be reloaded from the server.

I made a version that supports this functionality.
Adding timeouts is optional and the class can be used in the exact same way 
as before.

When the storage directory is set, a Dictionary with the files of the 
folder is created for fast checkup of cached files

I also added more events and added event metadata to the main class
ITEM_EXPIRED
ITEM_LOADING
ITEM_LOAD_PROGRESS
ITEM_LOAD_FAILED
CACHE_CLEARED
CACHE_REFRESHED
CACHE_REFRESHING

Mikko Tormala
flashtronaut.com

Original issue reported on code.google.com by flashtro...@googlemail.com on 23 Sep 2009 at 4:29

Attachments:

GoogleCodeExporter commented 8 years ago
I updated my update :)
I added a method called "callbackRetrieve" that works exactly the same as the 
normal 
"retrieve" except that it takes a callback function as an extra argument and it 
calls 
that callback function with the loaded file as an argument once the file is 
ready.

Since each callbackRetrieve method creates a unique loader instance, it may be 
used 
to simultaneously retrieve multiple files without having to think about which 
file is 
ready once the ResourceCache dispatched an ITEM_READY event.

Also added functionality to clean up and remove each loader instance once it's 
no 
longer needed.

Original comment by flashtro...@googlemail.com on 23 Sep 2009 at 11:06

Attachments:

GoogleCodeExporter commented 8 years ago
I added some description of the changes I made on my blog:
http://blog.flashtronaut.com/2009/09/24/contribution-to-the-as3corelib-resourcec
ache-
class/

Original comment by flashtro...@googlemail.com on 24 Sep 2009 at 2:38