Home arrow Flash arrow Page 5 - XML Sockets in Flash
FLASH

XML Sockets in Flash


The purpose of this tutorial is to familiarize readers with the XMLSocket object in Flash, it's methods and properties. Teach the reader the more common methods of using the XMLSocket object, and then open the reader up to the possibilities allowed by the XMLSocket Object.

Author Info:
By: Richard Lyman
Rating: 4 stars4 stars4 stars4 stars4 stars / 30
April 02, 2002
TABLE OF CONTENTS:
  1. · XML Sockets in Flash
  2. · Methods and Properties
  3. · Common Utilizations
  4. · Possibilities
  5. · Summary

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
XML Sockets in Flash - Summary
(Page 5 of 5 )

All in all the XMLSocket object allows for an increased vocabulary between clients and/or server. This allows the developer to bring about more dynamic ‘real-time-capable’ data. The XMLSocket object also facilitates the transferal of information from storage to use. The XMLSocket object is only one of many methods available for this transferal, yet it’s advantages give the developer an increased range of motion in delivering that data to the client.

There are precautions that need to be taken, as Flash does not currently support encoding of a robust nature. There are Flash developers who have scripted objects that deal with MD5 encryption, yet they tend to be bulky, and unwieldy. Care must also be taken when addressing issues of usability in Animated representation of data. The Flash Player version 5 needs code snippets to deal with a loss of frame rate when parsing larger XML documents, yet the Flash Player 6 Beta release does not.

Attention should also be focused on the structuring of the XML document or string that is to be sent to Flash. Flash tends to favor less parent/child node structure, and more an attribute type of structure. For instance, the string:

<top> <firstChild> <insideDescription1> Text1 </insideDescription1> </firstChild> <secondChild> <insideDescription2> Text2 </insideDescription2> </secondChild> </top>
Would be better defined like this:

<top> <firstChild type=’insideDescription1’ text=’TEXT1’/> <secondChild type=’insideDescription2’ text=’TEXT2’/> </top>
if at all possible. There are circumstances that do not allow for this style of structure, but it should be used if it can.

It should also be remembered that Flash does not have to accept only XML formatted data. By using the ‘onData()’ event handler we can process other forms of information. Why send a string like this:

<top> <xPosition> 234 </xPosition> <yPosition> 34 </yPosition> <zPosition> 4 </zPosition> </top>
When the string: “234|34|4” would more than suffice? The XMLSocket does not use ‘headers’ like standard HTML does, nor does it require bulky tag explanations if you don’t want it to. The joy in the XMLSocket implementation is that you can define your data anyway you wish and display it from your server to anywhere you can squeeze Flash!
DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus
FLASH ARTICLES

- More Top Flash Game Tutorials
- Top Flash Game Tutorials
- Best Flash Photo Gallery Tutorials
- The Top Flash Tutorials for Menus
- 7 Great Flash Tutorials
- Adobe Creative Suite 5.5 Now Available
- Critical Flash Vulnerability Heats Up the Web
- More on Nonpersistent Client-Side Remote Sha...
- Nonpersistent Client-Side Remote Shared Obje...
- Using the Decorator Pattern for a Real Web S...
- Using Concrete Decorator Classes
- Delving More Deeply into the Decorator Patte...
- The Decorator Pattern in Action
- A Simple Decorator Pattern Example
- Decorator Pattern

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 10 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials