Lesson 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.In essence, standards facilitate linkages between disparate itemsbattery and flashlight, Macromedia Flash and multi-user game server, and so on. And on the Web, where tons of data is transferred every second, having a standardized way of moving data among systems is essential. The powerful and easy-to-use XML has become one standard.
The simple chat application that you will script in this lesson shows you how to connect a Flash application to an XML socket server.
In this lesson, we'll introduce you to the XML format as well as show you how to use the XML class and the XMLSocket class in Flash. By lesson's end, you will have made Flash talk to ASP pages for user login and registration, and you will have created a very simple real-time chat application using a socket server.WHAT YOU WILL LEARNIn this lesson, you will:Learn about the XML formatCreate new XML objectsLearn how to parse an XML documentSend and load XML from the serverUse methods, properties, and events of the XML objectLearn about the XMLSocket class and socket serversBuild a simple real-time chat applicationAPPROXIMATE TIMEThis lesson takes approximately one and one half hours to complete.LESSON filesMedia Files:AddUser.aspUserLogin.aspXMLExample.mdbInstallElectroServer.exeElectroServer.asWddx.asWddxRecordset.asStarting Files:Lesson12/Assets/loginRegister1.flaLesson12/Assets/Chat1.flaCompleted Projects:loginRegister2.flaChat2.fla
• Table of ContentsMacromedia® Flash MX 2004 ActionScript: Training from the SourceBy
Derek Franklin, Jobe Makar Publisher: Peachpit PressPub Date: November 19, 2003ISBN: 0-321-21343-2Pages: 636
Sure, you can use Flash MX 2004 without being a master programmer, but as any Flash developer worth his or her salt will tell you, you''''re not tapping all of its power unless you''''re taking advantage of its scripting language "ActionScript 2.0" which offers a more robust programming model and better object-oriented programming support than ever before. Here to take the fear factor out of learning it are Flash veterans and best-selling authors Derek Franklin and Jobe Makar, who demonstrate that scripting is an instinctual process you already know by translating real-life activities into ActionScript scripts. In these pages, you''''ll find methodologies and techniques for building over 40 real-life Flash ActionScript projects, including sample games, applications, Web sites, and more. New in this edition are coverage of ActionScript 2.0, Web services, Components, Printing, Video, and more. On the companion CD, you''''ll find all the project files and images you need to complete each project.