2 Replies Latest reply on Sep 25, 2006 6:15 PM by ntsiii

    Function does not recognise return values despite function type declaration

    Mr Binitie Level 1
      The following function
      public function removeObj (l:IEventListener):Boolean
      {
      var len:Number = getListener().length;
      for (var i:Number = len; i >= 0; i--)
      {
      switch (getListener() )
      {
      case l:
      getListener().splice(i, 1);
      return true;
      break;

      default:
      return false;
      break;
      }
      }
      }

      comes up with an error saying the function does not return a value. However the function does return a value. What is wrong here??