title: remove a listener that has an anonymous function in Actionscript 3
body: <pre><code>up.addEventListener(MouseEvent.CLICK, 
      function clickFunc(event:MouseEvent):void
      { 
          revealSpinner(event,51.42,1,spinner);
          event.currentTarget.removeEventListener(event.type, arguments.callee);
          autoTimer.stop();
      },
      false, 0, true);
  down.addEventListener(MouseEvent.CLICK, 
      function clickFunc(event:MouseEvent):void
      { 
          revealSpinner(event,51.42,-1,spinner);
          event.currentTarget.removeEventListener(event.type, arguments.callee);
          autoTimer.stop();
      },
      false, 0, true);
  </code></pre>
  
  <p>The above code adds a listener to a couple of MC's. Originally the methods were anonymous but I have named them clickFunc() in order to try an reference them in my remove listener.</p>
  
  <p>Here is my remove listener code. Both of these snippets are in separate functions. The add listener method is called before the remove method.</p>
  
  <pre><code>up.removeEventListener(MouseEvent.CLICK, clickFunc );
  down.removeEventListener(MouseEvent.CLICK, clickFunc);
  </code></pre>
  
  <p>As soon as I publish the movie I get this error:</p>
  
  <pre><code>1120: Access of undefined property clickFunc.
  </code></pre>