Caches BitmapData
in memory. Each BitmapData
object may be saved with
its own key, such as the URL where the original image file is located.
1.0.0
.Constructor
new(maxUnretained:Int = 0x7FFFFFFF)
Creates a new BitmapDataCache
object with the given arguments.
1.0.0
.Variables
maxUnretained:Int
Limits the number of unretained BitmapData
objeccts that may be
stored in memory. The BitmapData
objects retained least recently will
be disposed, if there are too many.
1.0.0
.Methods
addBitmapData(key:String, bitmapData:BitmapData, retain:Bool = true):Void
Saves a BitmapData
object, and associates it with a specific key.
1.0.0
.See also:
dispose():Void
Disposes the BitmapData
cache, including all BitmapData
objects
(even if they are retained, so be careful!).
1.0.0
.getRetainCount(key:String):Int
Returns how many times the BitmapData
object associated with the
specified key has currently been retained.
1.0.0
.hasTexture(key:String):Bool
Indicates if a BitmapData
object is associated with the specified key.
1.0.0
.releaseBitmapData(key:String):Void
Releases a retained BitmapData
object.
1.0.0
.See also:
removeBitmapData(key:String, dispose:Bool = false):Void
Removes a specific key from the cache, and optionally disposes the
BitmapData
object associated with the key.
1.0.0
.See also:
retainBitmapData(key:String):BitmapData
Gets the BitmapData
object associated with the specified key, and
increments the retain count for the BitmapData
object. Always remember
to call releaseBitmapData()
when finished with a retained BitmapData
object.
1.0.0
.See also: