# TypeError. Trying to create a Class with an Array of Objects

**URL:** <https://forum.kirupa.com/t/typeerror-trying-to-create-a-class-with-an-array-of-objects/283523>\
**Category:** flash\
**Created:** [March 7, 2009, 11:14am UTC](https://forum.kirupa.com/t/typeerror-trying-to-create-a-class-with-an-array-of-objects/283523 "2009-03-07T11:14:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wurzagg](https://avatars.discourse-cdn.com/v4/letter/w/50afbb/32.png) [@Wurzagg](https://forum.kirupa.com/u/Wurzagg)\
**Post date:** [March 7, 2009, 11:14am UTC](https://forum.kirupa.com/t/typeerror-trying-to-create-a-class-with-an-array-of-objects/283523/1 "2009-03-07T11:14:19Z")

</div>

I’ve been trying to create an Array of Objects in a Class structure, for easy access of the objects from other classes and my .fla file. Unfortunately I keep running into this error:

“TypeError: Error #1034: Type Coercion failed: cannot convert Seed@31161a1 to SeedCollection.  
at flowerGame06\_fla::MainTimeline/flowerGame06\_fla::frame1()”

Does anyone know what this means, because I can’t figure it out. I’ve tried several tweaks in the syntax, but I only get the above error or a regular syntax error.

The line calling the class in my.fla file is this:

```auto
else
    {
        seed = new Seed(10, GradientType.LINEAR, 0x0000ff, 0x0000ff);
    }
    SeedCollection(seed);
}

```

The Class itself looks like this:

```auto
//SeedCollection class
package
{
    import flash.display.*;
    import Seed;
    
    public class SeedCollection
    {
        private var _seedArray:Array = new Array;
        
        public function SeedCollection(s:Seed) 
        {
            _seedArray.push(s);
        }
    }
}

```
