[Flash] Serialize + BitmapData

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Flash] Serialize + BitmapData

Matthew Spencer-2
Hey,

Ran into a problem with serialize not storing actual bitmapdata. Is this intended or a bug?

Thanks
--Matthew Spencer

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: [Flash] Serialize + BitmapData

James W. Hofmann
The flash built-ins don't have serialization methods. (there are some major complexity issues - e.g. reconstruction of a partially serialized display list)

It is possible instead to write the subset of functionality that you want to serialize - for BitmapData, a straightforward path is to transfer to Vector and then to Array, then serialize the Array. If only Flash needs to use the data you can also use the ByteArray methods that take or emit Objects and get a speed boost over haXe native, but again, not all API is directly supported.
Reply | Threaded
Open this post in threaded view
|

Re: [Flash] Serialize + BitmapData

Matthew Spencer-2
I've been extracting it to a Bytes and then serializing it. Just wondered why the BitmapData did not serialize properly. Thank you for the detailed answer.

--Matthew Spencer


--
haXe - an open source web programming language
http://haxe.org