LocalCacheLoader is a library toÂ cache content (such as swf ,images , data file etcâ€¦) to the local file system. ItÂ is fully compatible with
NetStream, being a very light weight adjustment to the browser cache functionality. When the applicationÂ triesÂ to fetch an asset or any other file, the library first checks locally for the file.
The consequence of using the lib for caching isÂ that theÂ communication with the server can be drastically reduced. The lib API is very similarÂ to the native Flash loading classes as
NetStream. The only difference is that a developer must instantiate the desired loader using the lib’s factory class. After this step, the loader will behave exactly like a native one.
// Setup cache Directory. // Can be cached in the directory that you specify here . LocalCacheSettings.WORKING_DIRECTORY = File.applicationDirectory; // Please set the following: If AIR for Android, the AIR for iOS. // LocalCacheSettings.WORKING_DIRECTORY = File.applicationStorageDirectory; // Init Factory Class. // Loader like normal will be used if you do not initialize the factory class . NetClassFactory.initialize (LocalCacheLoader, LocalCacheURLLoader, LocalCacheNetStream); / Create Class. // If true the second argument here , regardless of there without a cache that is stored in the local // I will take the file from the Web always on . _loader = NetClassFactory.createLoader (null, false); // I use normally after . _loader.contentLoaderInfo.addEventListener (Event.COMPLETE, _onComplete); _loader.load (new URLRequest ("https://www.google.co.jp/images/srpr/logo11w.png"));