# Error #1034: Type Coercion failed: cannot convert

**URL:** <https://forum.kirupa.com/t/error-1034-type-coercion-failed-cannot-convert/270748>\
**Category:** flash\
**Created:** [September 13, 2008, 1:57pm UTC](https://forum.kirupa.com/t/error-1034-type-coercion-failed-cannot-convert/270748 "2008-09-13T13:57:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![smkirupa](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@smkirupa](https://forum.kirupa.com/u/smkirupa)\
**Post date:** [September 13, 2008, 1:57pm UTC](https://forum.kirupa.com/t/error-1034-type-coercion-failed-cannot-convert/270748/1 "2008-09-13T13:57:11Z")

</div>

I have done a test code to create plattform to move down and then go back to the top.  
It works, but when i copy the code and paste it for the game then I get this error.

```auto
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::MovieClip@3633941 to plattform.

```

I have localized who cause the problem but I don’t know how to fix it.  
Here is the problem

```auto
    var tempPlatt:plattform = plattform(this.getChildAt(j));

```

The rest of the code

```auto
//Create plattform
for(var i:int=0;i<6;i++) {
    var myPlatt:plattform = new plattform();

    myPlatt.x = Math.random() *330+10;
    
    myPlatt.y = -650+i*100;
    myPlatt.name = "minPlatt" +i;
    addChild(myPlatt);
}

this.addEventListener(Event.ENTER_FRAME, onEnterFrameHandler);

function onEnterFrameHandler(evt:Event):void {
    for(var j:int=0;j<this.numChildren;j++) {
    var tempPlatt:plattform = plattform(this.getChildAt(j));

//Change Speed
    tempPlatt.y +=1.5;
    
        if(tempPlatt.y >550){
            tempPlatt.x = Math.random() *330+10;
            tempPlatt.y =-50;
            trace(tempPlatt.x);
            trace(tempPlatt.name);
        }
    }
}

```
