# Why doesn't this code work (trying to do parent\["b.b"+i\] = new MovieClip();

**URL:** <https://forum.kirupa.com/t/why-doesnt-this-code-work-trying-to-do-parent-b-b-i-new-movieclip/225985>\
**Category:** flash\
**Created:** [May 17, 2007, 8:13am UTC](https://forum.kirupa.com/t/why-doesnt-this-code-work-trying-to-do-parent-b-b-i-new-movieclip/225985 "2007-05-17T08:13:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mythic\_Fr0st](https://avatars.discourse-cdn.com/v4/letter/m/4da419/32.png) [@Mythic\_Fr0st](https://forum.kirupa.com/u/Mythic_Fr0st)\
**Post date:** [May 17, 2007, 8:13am UTC](https://forum.kirupa.com/t/why-doesnt-this-code-work-trying-to-do-parent-b-b-i-new-movieclip/225985/1 "2007-05-17T08:13:26Z")

</div>

How come this doesn’t work, does anyone know?

```auto
var b:Object = {};
b.n = 2;
for (var i:Number = 0; i<b.n; i++)
{
    parent["b.b"+i] = new MovieClip;
    stage.addChild(parent["b.b"+i]);
}

```

error:

```auto

ReferenceError: Error #1056: Cannot create property b.b0 on flash.display.Stage.
    at Timeline0_ed1685370f8246ae76f9dfe3b4eb3d/::frame1()

```
