1 Reply Latest reply on Jun 23, 2008 2:44 PM by abeall

    useWeakReference causes events to never fire in AIR?

    abeall Level 3
      I'm wondering if anyone can explain this:

      mc.addEventListener('mouseDown',function(evt){
      txt.appendText('clicked');
      },false,0,true);

      I'm using Flash CS3. The above works, until I change the publish setting to AIR. The event never fires. If I remove the weakReference or change it to false in the addEventListener call, it starts working.

      So why is setting weakReference to true causing events to never fire in AIR?
        • 1. useWeakReference causes events to never fire in AIR?
          abeall Level 3
          Another bit of info: this seems to only apply to anonymous functions (only in AIR). The following works when publishing to AIR:

          mc.addEventListener('mouseDown',func,false,0,true);
          function func(evt){
          txt.appendText('clicked');
          }

          So perhaps AIR garbage collection is killing the weak referenced anonymous listener more aggressively? AIR beta 1 did not ever remove these event listeners, and the app would run for hours.