Hi.
Right now I'm having the same problem.
I even found this:

public function cloneObject(o:Object):Object
{
 var bytes:ByteArray = new ByteArray();
 bytes.writeObject(o);
 bytes.position = 0;
 return bytes.readObject();
}

but ended up always in the casting problem :(

Had you find an answer?

Thanks

Best regards

--- In [email protected], "ben.clinkinbeard"
<[EMAIL PROTECTED]> wrote:
>
> Does anyone know how to do this? Neither casting nor the "as" operator
> are working.
> 
> var foo:FooObject = new FooObject();
> 
> // this doesn't work
> var fooCopy:FooObject = FooObject(ObjectUtil.copy(foo));
> 
> 
> // neither does this
> var fooCopy:FooObject = ObjectUtil.copy(foo) as FooObject;
> 
> Thanks in advance for any pointers,
> Ben
>


Reply via email to