Packagesekati.utils
Classpublic class WeakReference

Create a weak reference of an object instance for easier garbage colleciton of difficult to track Objects: if this is the only reference left the instance is elidgible for garbage collection.

See also

http://www.bigroom.co.uk/blog/create-your-own-weak-references-in-actionscript-3
http://www.partlyhuman.com/blog/index.php?s=strong+weak+reference


Public Methods
 MethodDefined by
  
WeakReference(reference:Object)
WeakReference Constructor
WeakReference
  
get():Object
The wrapped instance; this property is null if the wrapped instance was already garbage collected.
WeakReference
Constructor detail
WeakReference()constructor
public function WeakReference(reference:Object)

WeakReference Constructor

Parameters
reference:Object — the instance to wrap weakly referenced

Example
   // Create a weak reference
   var weak:WeakReference = new WeakReference( obj );
   
   // Use the referenced object
   var strong = weak.get();
   if( strong != null ) {
    // use strong here
   } else {
    // garbage collector has disposed of the object
   }
   

Method detail
get()method
public function get():Object

The wrapped instance; this property is null if the wrapped instance was already garbage collected.

Returns
Object