# TypeError: Error #1006: getRect is not a function

**URL:** <https://forum.kirupa.com/t/typeerror-error-1006-getrect-is-not-a-function/328897>\
**Category:** Uncategorized\
**Created:** [June 29, 2012, 5:06am UTC](https://forum.kirupa.com/t/typeerror-error-1006-getrect-is-not-a-function/328897 "2012-06-29T05:06:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ragnoroct](https://avatars.discourse-cdn.com/v4/letter/r/f07891/32.png) [@Ragnoroct](https://forum.kirupa.com/u/Ragnoroct)\
**Post date:** [June 29, 2012, 5:06am UTC](https://forum.kirupa.com/t/typeerror-error-1006-getrect-is-not-a-function/328897/1 "2012-06-29T05:06:02Z")

</div>

I get this error when I try to create a rectangle for an object in an array.

TypeError: Error #1006: getRect is not a function.

The line that causes the error is the third one.

```auto
for (var i:int = 0; i < fixedObjects.length; i++)
            {
                var wallRect:Rectangle = fixedObjects*.getRect(this);
                //trace(wallRect+"wall");
                trace(fixedObjects*.getRect(this));
                //trace(newCharRect+"char");

                if (newCharRect.intersects(wallRect))
                {
                    trace("should work");

                    // ball hitting left or right side
                    if (oldCharRect.right < wallRect.left)
                    {
                        trace("left");
                        //newBallX += 2*(brickRect.left - oldBallRect.right);
                        //ballDX *= -1;
                    }
                    else if (oldCharRect.left > wallRect.right)
                    {
                        trace("right");
                    }//newCharX += 2*(brickRect.right - oldBallRect.left);
                    //ballDX *= -1;

                    // ball hitting top or bottom
                    if (oldCharRect.top > wallRect.bottom)
                    {
                        trace("bottom");
                        //ballDY *= -1;
                        //newBallY += 2*(brickRect.bottom-newBallRect.top);
                    }
                    else if (oldCharRect.bottom < wallRect.top)
                    {
                        trace("top");
                    }//ballDY *= -1;
                    //newBallY += 2*(brickRect.top - newBallRect.bottom);
                }
            }

```

I attached the full .as
