|
Bgx Xml Serialization Classes (Flash MX 2004)
No
more looping through XML
When
I first started to work with Flash and XML I used to write plenty
of lines of code getting the data I wanted. When Flash MX came
along I created some generic XML parsing functions I used to copy
from one project to the other.
However, having learned to appreciate the .NET Serialization
model and given the possibilities that Actionscript 2.0 offer,
I finally created proper installable classes for XML to AS Object
conversions.
The
Bgx Serialization classes allow you to convert
any XML object into a multi level actionscript object (deserialization),
and vice versa to convert a complex actionscript object into XML
(serialization). To achieve this two separate classes are provided:
BgxDesObject and BgxSerObject.
Features BgxDesObject class
- Converts all elements of an XML document
into arrays of objects with the XML attributes
defined as the properties of those objects
- Allows databinding of XML data to UI
components like the DataGrid, Combos and Lists
with very little effort.
- Can be used as a global data container (DataHolder
if you want) of an application in which each property can be
changed when needed, new properties can be added etc. To save
the data the whole object or parts of it can be serialized again
and sent back to the server, containing the modifications.
Features BgxSerObject class
- Converts complex actionscript objects with n-level
arrays of
objects instantly into XML which can be accessed either as XML
object or as XML string that could e.g. be sent to a server.
Professional features
- The classes work from CD as well as from
servers.
- Extremely light weight, both classes
together add less than 1 kB to an SWF.
- onParsed event callback to trigger
off other code when parsing has finished.
- Includes a refrence to the object parentNodes
so that you can navigate through the deserialized object as you
would through XML.
- Includes a reference to the original
XML nodeName with every deserialized object. So you can
still easily understand what kind of object you are dealing with.
- Supports handling of colons ":"
in namespace declarations on the way in and out. For me
a must when dealing with XML created directly from databases or
Web services.
- Work with files exported for Flash
6 Player AS 2.0
- New: includes
recursive clone function for complex Objects
Documentation
View
the documentation for a full description of the classes and
several code samples.
Samples
The following examples show the classes in action
including descriptions of the code uesed:
For further information please contact info@bgxcomponents.com.
|