I solved my own problem! I had forgotten to include the 'new' keyword...it's getting late in NYC!

code should read:

public function result(data:Object):void
{
                var myList:ArrayCollection = new ArrayCollection(data as Array);
}



- Kevin


On Jan 13, 2007, at 7:15 PM, Kevin wrote:

I can't seem too create an ArrayCollection from and array. I have data being returned (type object) which I can successfully type into an array, but when I try to then change it to an ArrayCollection it fails with the follow error. What am I doing wrong?



public function result(data:Object):void
{
                var myList:ArrayCollection = ArrayCollection(data as Array);
}

ERROR: TypeError: Type Coercion failed: cannot convert [EMAIL PROTECTED] to mx.collections.ArrayCollection.



this works fine,

public function result(data:Object):void
{
                var myList:Array = data as Array;
}

this is what is being sent to result()

var sendList: Object = ['test 0','test 1','test 2','test 3','test 4','test 5','test 6'];
responder.result( sendList );
.....


Thanks much,
- Kevin



Reply via email to