<p>Is it possible in Actionscript 3 to create a weak reference to an object, so that it can be garbage collected.</p>

<p>I'm creating some classes to make debugging easier, so I don't want the objects to hang around in memory if they are only referenced here (and of course I don't want to fill the code with callbacks to remove the objects)</p>

Right now I've made a simple class to  take advantage of the Dictionary weakKeys parameter:
```
```
public class WeakReference
{
    private var dic

    public function WeakReference(object)
    {
        this.dic = new Dictionary(true)
        this.dic[object] = true
    }

    public function get Value()
    {
        for (var object in this.dic)
        {
            return object
        }
        return null
    }
}
```
```