At this point we have a very generic XML node viewer. It is useful for browsing XML in a Flash environment. Furthermore, it was useful as a culminating experience for learning about recursion and tree-walking . The node viewer could be used to help verify XML output by our code.

In its simplicity and versatility, the node viewer is also quite useful as a framework for many XML-based applications. It does the basic work of taking a general XML file and embodying it as functional Flash objects. It just remains for the application to design specialized MovieClips to match the expected XML objects.

The node viewer demonstrates an interesting principle. The in-memory XML, as we will see, is not easy to work with. Without pointers, ActionScript is fairly clumsy when it tries to manipulate data in structures like the XML DOM.

Alert readers will notice that we have transferred all the data that was delivered by the XML document into a MovieClip structure. These are relatively easy to manipulate. We will often duplicate the incoming XML with a native (MovieClip) hierarchy. It models our data accurately, displays it clearly, and allows us to handle it directly.

Soon we will think of the MovieClip structure not as a duplicate of our XML data but rather as the data itself transformed into Flash. The clumsy, invisible XML DOM object can be discarded, and we can have data that is colorful , tangible , and even makes noise!

And when we need it to behave as XML and serialize itself into an XML string, it can do that, too.

Flash and XML[c] A Developer[ap]s Guide
Flash and XML[c] A Developer[ap]s Guide
ISBN: 201729202
Year: 2005
Pages: 160 © 2008-2017.
If you may any questions please contact us: