title: Store variable in Movieclip or Sprite
body: <p>How can you add data to a dynamically created MovieClip/Sprite so that the data can be accessed later on an event coordinating to that MovieClip/Sprite?</p>
  
  <p>Example Code:</p>
  
  <pre>
  for(var i:int; i &lt; xml.children(); i++){
      var button:MovieClip = new MovieClip();
      button.graphics.beginFill(0x000000);
      button.graphics.drawCircle(100 + 20 * i, 200, 10);
      button.graphics.endFill();
      button.addEventListener(MouseEvent.MOUSE_UP, doSomething);
      button.name = "item_"+i;
      <em>button.storedData.itemNumber = i;</em>
  }
  
  function doSomething(e:Event):void
  {
      trace(e.target.storedData.itemNumber);
  }
  </pre>
  
  <p>Thanks in advance.</p>