If your object implements IExternalizable, then just pass it to the normal output.writeObject() method. It will detect that it implements this interface and set the correct flags in the AMF3 type header for "object" to denote that it is IExternalizable.
________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of dwerbam Sent: Wednesday, April 04, 2007 5:49 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Serializing Object that contains IExternalizable properties I'm having exactly the same problem. Did anyone found a solution? Is this a bug or an implementation problem? Regards. dwerbam --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> , "remygendron" <[EMAIL PROTECTED]> wrote: > > Hello all, > > I'm looking for the easiest way to serialize a dynamic Object > instance that contains object types that implement IExternalizable. > In my root object writeExternal method, I sucessfully serializes > simple types. Everything still works great when I serializes an > Object instance that contains only simple properties. > > But when this Object instance contains class types that implements > IExternalizable, I get the following error: > > ArgumentError: Error #2004: One of the parameters is invalid. > at flash.utils::ByteArray/writeObject() > > Here's the code for my main object, which btw extends Proxy. > _dynamicProperties is an Object instance used to manage the object > dynamic properties... ;-) > > Any help appreciated! > > Thanks! > > Starman > > public function writeExternal(output: IDataOutput): void > { > // _entityKey implements IExternalizable. > _entityKey.writeExternal(output); > > output.writeBoolean(_dirty); > output.writeBoolean(_readonly); > > // _dynamicProperties is an Object instance. > output.writeObject(_dynamicProperties); > } >