Chapter 12. Using XML with Flash


Imagine what it would be like if every electrical appliance in your home had a different type of plug chances are, you'd end up putting most of those gizmos back in the cupboard and doing the task manually. Or what if none of the screwdrivers or wrenches in your tool shed even came close to fitting the screws, nuts, and bolts that hold stuff together? Fortunately, neither scenario is likely because people figured out long ago that by creating products according to guidelines, or rules of standardization, they could have far more productive societies.

This simple chat application which you will script in this lesson uses an XML socket connection.

graphics/12fig01.gif

In essence, standards facilitate linkages between disparate items battery and flashlight, Macromedia Flash and multiuser game server, and so on. And on the Web, where tons of data is transferred every second, having a standardized way of moving data between systems is essential. The powerful and easy-to-use XML is quickly becoming that standard.

In this lesson, we'll introduce you to the XML format, as well as show you how to use the XML object and the XMLSocket object in Flash. By lesson's end, you will have made Flash talk to ASP pages for user log-in and registration, and you will have created a very simple real-time chat using a socket server.

WHAT YOU WILL LEARN

In this lesson, you will:

  • Learn about the XML format

  • Send and load XML from the server

  • Create new XML objects

  • Learn to parse an XML document

  • Use methods, properties, and events of the XML object

  • Connect to a simple socket server using Flash

APPROXIMATE TIME

This lesson takes approximately 1½ hours to complete.

LESSON FILES

Media Files:

None

Starting Files:

Lesson12/Assets/LoginRegister1.fla

Lesson12/Assets/Chat1.fla

Completed Projects:

LoginRegister2.fla

Chat2.fla



Macromedia Flash MX ActionScripting Advanced. Training from the Source
Macromedia Flash MX ActionScripting: Advanced Training from the Source
ISBN: 0201770229
EAN: 2147483647
Year: 2002
Pages: 161

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net