http://www.actionscript.org/forums/showthread.php3?t=215339
1. Not every object may be serialized at all.(不是所有的对象都可以序列化)
2. Those that may be serialized require that you:(满足如下条件即可)
a. register their class for serialization by using registerClassAlias or, in Flex you can use [RemoteClass] meta, which basically does the same thing.
(要求对类通过registerClassAlias 来注册为可序列化,或者通过标签[RemoteClass]来注册,他们两个就一个德行
b. if they happen to have constructor arguments, they need defaults for them.
(如果类的构造函数有参数要求,该参数一定要设定默认值)
c. alternatively, they should implement IExternalizable.
(或者实现IExternalizable接口)
However, all prime types are serializable (they don't need to implement IExternalizable).(所有的基础类型都是可序列化的)
Some flash.* classes are also good for serialization (ByteArray, BitmapData).
有些flash.*下面的类用来序列化都是不赖的
翻译的不一定对,呵呵
以前遇到过ByteArray.writeObject()失效的情况,呵呵
1. Not every object may be serialized at all.(不是所有的对象都可以序列化)
2. Those that may be serialized require that you:(满足如下条件即可)
a. register their class for serialization by using registerClassAlias or, in Flex you can use [RemoteClass] meta, which basically does the same thing.
(要求对类通过registerClassAlias 来注册为可序列化,或者通过标签[RemoteClass]来注册,他们两个就一个德行
b. if they happen to have constructor arguments, they need defaults for them.
(如果类的构造函数有参数要求,该参数一定要设定默认值)
c. alternatively, they should implement IExternalizable.
(或者实现IExternalizable接口)
However, all prime types are serializable (they don't need to implement IExternalizable).(所有的基础类型都是可序列化的)
Some flash.* classes are also good for serialization (ByteArray, BitmapData).
有些flash.*下面的类用来序列化都是不赖的
翻译的不一定对,呵呵
以前遇到过ByteArray.writeObject()失效的情况,呵呵