About the Book
Instead of just "gee-whiz" animation or cool user interfaces, Flash pros need to build truly useful sites that are viable for the long-term. That means interfacing Flash with dynamic content, backend databases, server-based applications, and even with other live users. The key to all these is XML. Now, there's a book that shows you exactly how to build enterprise Flash applications that integrate XML -- and leverage its full power. Flash and XML is structured in 19 progressive lessons. In each lesson, the authors teach a key principle of Flash enterprise integration by first explaining it, and then demonstrating it with working code. The book begins with an introduction to Flash and ActionScript that's ideal for working developers, and also serves as a useful refresher for Flash professionals. Next, the authors introduce XML, review the role of HTTP in Web development, and start writing PHP-based server code for accessing back-end data. Next, they show how to extend Flash and server-side systems to a third-tier, connecting with back-end databases via SQL.
Every chapter's code samples build on what's come before, constructing a robust application that encompasses client-side Flash code, server-side XML, back-end remote database access, and even emulated "peer-to-peer" connections. For both Flash professionals (with or without XML experience) and software engineers involved in Web development (with or without Flash experience).
Table of Contents:
Preface. Why this book, who should read it. Acknowledgments. 1. Flash Basics. Starting out: Buttons, graphics, text, sound, script. The Background of Flash. Practical Flash. Event-Driven Graphics. Building a Button. Constructing a Round. Making Keyframes. Constructing the Responses. Finishing Features. Conclusion--and Beyond. 2. FlashActionScript: Objects and Events. Core concepts: Object orientation, event handlers, dynamic text. Object Orientation Concepts. Object-Oriented Theory vs. ActionScript Reality. Flash Objects. Programmable Button. Data Encapsulation. Conclusion. 3. More ActionScript: Data-Driven Interfaces. Practical work: Thin client, smart graphic elements, exposing data structure. Data-Driven Decisions. Data-Driven Everything. Isolating the Data. Dynamic Creation of Graphics. Multiple Questions. Conclusion. 4. XML Fundamentals. Big picture: Inspiration, evolution, esthetic, promise. XML Background. How XML Works. Designing the Data. Conclusion. 5. XML Structure. Definitions: Elements, names, tags, attributes, content, markup, etc. Element. Name. Start Tag. End Tag. Attributes. Text (Character Data). Entity References. Comments. Processor Instructions. Conclusion. 6. XML Validation: DTD. Declaration: Entities, parameters, notations, namespaces. Purpose of DTD. Valid XML and Well-Formed XML. DTD Declarations. Entities. Namespace. Conclusion. 7. HTTP Connection. Transaction: Request/response, GET, POST, load, variable scope. Characteristics of HTTP. Structure of HTTP. Loading Data from a File. Making a Self-Loading High Score Display. Object-Oriented Implementation. Data File. Flash Download Security. Conclusion. 8. XML Connection. Download: XML files, ActionScript parser, debugger, DOM. Downloading XML. XML.load. Debugging Flash. Event-Driven Functionality. Conclusion. 9. Recursive Approach. Recursion: See Chapter 9. Event-Driven Code. Recursive Design. Recursion. Recursion in Practice. Graphic XML Browser. Interactive Node Viewer. Conclusion. 10. XML Server. Two tier: Server-side options, PHP, HTTP header variables. XML Online. Dedicated XML Server. Middle-Tier Solutions. PHP Basics. PHP and XML. XML-Driven Flash Client. Conclusion. 11. Database Fundamentals. DBMS 101: Purpose, technology options, relational, rows, columns, keys, joins. Background. Advantages of a DBMS. Advantages of SQL. Keys. Conclusion. 12. SQL Syntax. Practical DB: Building tables, data types, designing queries, getting records. Varieties of SQL. Prompt Tables. Guidelines for Building a Table. Types of Data. Adding Data to Tables. Reading Records from the Table. Conclusion. 13. Serving from SQL. Middle tier: PHP and MySQL, MySQL/functions, results tables. Connecting to a Database. Interaction with a Database. Parsing Commands. Fetching a Row. Trial-and-Error Approach. Scalable Alternative. Conclusion. 14. XML Upload. Upload: ActionScript and PHP, HTTP, XML as HTML, XML in browser. Flash Client. Uploading to PHP. Conclusion. 15. Two-Way XML. Roundtrip: Object exchange, PHP parsing, expat, event-based parser, packet sniffing. Event-Driven Parsing. Building the PHP Parser. Conclusion. 16. Cookies. Persistence: ActionScript parsing, DOM-based parser, setting cookies, reading cookies. ActionScript XML Objects. Stateless Persistence. Conclusion. 17. Three Tiers. Three tier: Database, application, client; a flexible system. Database. Flexible Middle Tier. Client Tier. Conclusion. 18. Flash to the World. Proxies: Domain perimeter, security, escape, RSS, newsfeeds, content browsing. Domain Perimeter. PHP Proxy. Client. RSS File. RSS Browser. Conclusion. 19. XML Sockets. Realtime: Socket programming, ports, streaming XML, single-user communications. Advanced Socket Programming. XMLSocket. Simple Socket System. Simple Socket Server. Conclusion. 20. Multiplexed XML Sockets. Multisockets: Scalable, stream servers, multi-user environments, live peer Connections. Chat. Client with History. Multiclient Server. Beyond PHP. Conclusion. End Note. Upload: ActionScript and PHP, HTTP, XML as HTML, XML in browser. Appendix A: Microsoft Compatibility. MS: XML in ASP, MSXML, PHP on IIS ASP Code with Flash. IIS and PHP. Appendix B: Scalable Vector Graphics (SVG). SVG: Flash without Flash, beyond the swf file Appendix C: Tools and Sources. Debuggers, editors, web sites, books, newsgroups, conferences. Network Tool. Servers. XML Tools. PHP Tools. MySQL Tools. Flash. Index. 0201729202T10222001