title: AS 3.0 Dynamic Instance Names
body: <p>Hi i made a custom class where i would like to create x instances of a movieclip. But the following doesn't work:</p>
  
  <p><code>
  package  {</p>
  
  <pre><code>import flash.display.MovieClip;
  public class CustomClass extends MovieClip {
  
      public function CustomClass(amount:uint) {  
          var Collector:Array = new Array(); 
  
          //Add and position Tiles to stage.
          for (var i:uint = 1; i &lt;= amount; i++){ 
              var newMovieClip:MovieClip = new MovieClip;
              newMovieClip.y = amount * 10;
              Collector.push(newMovieClip); 
          }
          addChild(Collector);
      }
  }
  </code></pre>
  
  <p>}
  </code></p>
  
  <p>I would like to position them on the timeline with </p>
  
  <pre>
  var customClass_mc:CustomClass = new CustomClass(10);
  addChild(customClass_mc);
  
  //try to trace the x position of one of the instances. 
  trace(customClass_mc.Collector[5].x);
  </pre>
  
  <p>I keep getting the error: Scene 1, Layer 'Layer 1', Frame 1, Line 5 1119: Access of possibly undefined property Collector through a reference with static type CustomClass.</p>