Posted By

mcorlan on 08/17/11


Tagged

image mobile Flex caching


Versions (?)

Image caching


 / Published in: ActionScript 3
 

URL: http://corlan.org/?p=3106

  1. package org.corlan.utils {
  2. import spark.core.ContentCache;
  3.  
  4. public class ImageCache {
  5.  
  6. private static var _instance:ImageCache;
  7.  
  8. public var cache:ContentCache;
  9.  
  10. public function ImageCache(s:Singleton, maxCacheEntries:int=100) {
  11. cache = new ContentCache();
  12. cache.maxCacheEntries = maxCacheEntries;
  13. }
  14.  
  15. public static function getInstance(maxCacheEntries:int=100):ImageCache {
  16. if (ImageCache._instance == null) {
  17. ImageCache._instance = new ImageCache(new Singleton(), maxCacheEntries);
  18. }
  19. return ImageCache._instance;
  20. }
  21. }
  22. }
  23.  
  24. class Singleton {}

Report this snippet  

You need to login to post a comment.