我想克隆一個Canvas對象,其中包含具有多個幾何形狀的Degrafa曲面。如何在Flex中克隆對象?
我嘗試了天真的做法:
return ObjectUtil.copy(graph_area) as Canvas;
這就造成了錯誤:
TypeError: Error #1034: Type Coercion failed: cannot convert [email protected] to com.degrafa.geometry.Geometry.
TypeError: Error #1034: Type Coercion failed: cannot convert [email protected] to com.degrafa.geometry.Geometry.
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mx.core::Container/addChildAt()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2196]
at mx.core::Container/addChild()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\core\Container.as:2140] ...
如果你看一下ObjectUtil.copy()的來源,它完全一樣。 – 2010-04-02 14:35:36
是的,它使用AMF來序列化和反序列化對象。 – LiraNuna 2010-04-02 23:11:46
我在此代碼中出錯...錯誤:錯誤#2030:遇到文件結尾。 \t at flash.utils :: ByteArray/readObject() – Devendra 2013-01-23 10:20:09