Menu

Welcome to Open Discussion

2005-05-16
2013-04-09
  • Nobody/Anonymous

    Welcome to Open Discussion

     
    • Marcon

      Marcon - 2005-10-03

      Hi, first of all very good work very appreciate here.
      I've only one question:
      I've noticed one error in MM Delegate class.
      When I add an eventlistener to an object using Delegate, i can't remove it.
      It seems that the problem happens also with your libs.
      The problem, I think, is in line 65 of ArrayUtils .
      Due to MM allocation system doing Delegate two times doesn't return the same value.
      So "if(arr[i] == obj){" is always false for funcion added with Delegate.

      If I can suggest a solution, I've modified the removeEventListene r as follows:
      -----------------------------------------------------------------------------------------------
      //trace ("removing "+(o.func == handler))
      // if the function is equal or the function is a delegate of the
      //same function
      var eval = ((o.func) == (handler.func)&&(o.target == handler.target));
      if (o == handler ||  eval ) {
          queue.splice(i, 1);
          return;
      }
      ------------------------------------------------------------------------------------------------
      Where
      o = arr[i]
      handler = obj
      in your function.
      But I don't use an external ArrayUtils class, so I don't know if you can use this hint

      Hope this helps,
      thanks for the good work
      Marco

       
    • iiley

      iiley - 2005-10-05

      Thanx for your responses:)
      In fact there is a way to remove the listeners what ever way you added:

      var theListener:Object = xxx.addEventListener(xxx,xxx,xxx);
      to remove it with:
      xxx.removeEventListener(theListener);

      you can see the details about EventDispatcher here:
      http://www.aswing.org/aswing-doc/frameset.html

       

Log in to post a comment.

MongoDB Logo MongoDB