# Add a movieclip to an array instead of a generated object

**URL:** <https://forum.kirupa.com/t/add-a-movieclip-to-an-array-instead-of-a-generated-object/327937>\
**Category:** flash\
**Created:** [April 6, 2012, 1:41pm UTC](https://forum.kirupa.com/t/add-a-movieclip-to-an-array-instead-of-a-generated-object/327937 "2012-04-06T13:41:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MFRS](https://avatars.discourse-cdn.com/v4/letter/m/aca169/32.png) [@MFRS](https://forum.kirupa.com/u/MFRS)\
**Post date:** [April 6, 2012, 1:41pm UTC](https://forum.kirupa.com/t/add-a-movieclip-to-an-array-instead-of-a-generated-object/327937/1 "2012-04-06T13:41:48Z")

</div>

I am creating a platform game through the use of arrays, and i am inserting the platforms in a variable called blockHolder. I have successfully inserted generated blocks, but i want to insert my own movieclip, so i replaced this code:

Before:

```auto
else if (lvlArray* == 1)
                {//making a new block
                    var newBlock2:Block = new Block ;
                    //drawing the block
                    newBlock2.graphics.beginFill(0x000000,1);
                    //turning the shape into a square;
                    newBlock2.graphics.drawRect(0,0,25,25);
                    //change the coordinates of the block;
                    newBlock2.x = (i - (colunas - 1) * lvlColumns) * newBlock2.width;
                    newBlock2.y = (colunas - 1) * newBlock2.height;
                    //then finally adding it to stage
                    blockHolder.addChild(newBlock);
                }

```

For this code:

```auto
if (lvlArray* == 1)
                {
                    //making a new block
                    newBlock = new platNev ;
                    
                    //then finally adding it to stage
                    blockHolder.addChild(platNev);
                    
                    
                    
                }

```

And it gives the error: Implit coercion of a value of type class to an unrelated type flash etc. Any ideias?
