# Instances in an array cannot be displayed?

**URL:** <https://forum.kirupa.com/t/instances-in-an-array-cannot-be-displayed/319609>\
**Category:** Uncategorized\
**Created:** [February 26, 2011, 6:25am UTC](https://forum.kirupa.com/t/instances-in-an-array-cannot-be-displayed/319609 "2011-02-26T06:25:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![siriso](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@siriso](https://forum.kirupa.com/u/siriso)\
**Post date:** [February 26, 2011, 6:25am UTC](https://forum.kirupa.com/t/instances-in-an-array-cannot-be-displayed/319609/1 "2011-02-26T06:25:25Z")

</div>

Hi,  
There isn’t any error displaying. I traced the “rectAry[1]” and it’s “undefined”

When I change the variable “i” inside the statement to 3 or other values,  
the instance will be displayed probably.

```auto

package
{
      import flash.display.Sprite;
 
      public class testClass extends Sprite
      {
            private var rectAry:Array = new Array();
            public function testClass():void
            {
                  ...
                  for (var i:Number; i<5; i++)
                  {
                        rectAry* = new rectangles();
                        addChild(rectAry*);
                        rectAry*.x = 30;
                  }
                  trace(rectAry[1]);
            }
      }
}

```

I’m new to actionscript, Thanks for help!
