title: Creating anonymous functions in loop with not the same arguments
body: <p>I want to make in loop set of buttons, and add to them some events, but anonymous functions is the same. I write example code:</p>
  
  <pre><code>for(var i:int=0;i&lt;5;i++)
  {
      var button:SimpleButton = new SimpleButton(...);
      ...
      button.addEventListener(MouseEvent.CLICK, function(event:MouseEvent):void
      {
          trace(i);
      });
  }
  
  ...
  </code></pre>
  
  <p>And I want to trace 0,1,2,3.. from click buttons instead of 4,4,4,4 ..
  Do you know how can I make this ?</p>