Tôi muốn sao chép một đối tượng Canvas, trong đó có một bề mặt Degrafa với một số hình dạng hình học.Làm thế nào để sao chép một đối tượng trong Flex?
Tôi đã thử các cách tiếp cận ngây thơ:
return ObjectUtil.copy(graph_area) as Canvas;
đó dẫn đến lỗi:
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] ...
nếu bạn nhìn vào nguồn của ObjectUtil.copy(), nó thực hiện chính xác điều tương tự. –
Vâng, nó đang sử dụng AMF để tuần tự hóa và de-serialize đối tượng. – LiraNuna
tôi gặp lỗi trên mã này ... Lỗi: Lỗi # 2030: Đã xảy ra kết thúc tệp. \t tại flash.utils :: ByteArray/readObject() – Devendra