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:
else
{
seed = new Seed(10, GradientType.LINEAR, 0x0000ff, 0x0000ff);
}
SeedCollection(seed);
}
The Class itself looks like this:
//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);
}
}
}