
177
CHAPTER 10
Working with External Data
In Macromedia Flash MX 2004 and Macromedia Flash MX Professional 2004, you can use
ActionScript to load data from external sources into a SWF file. You can also send data from a
SWF file for processing by an application server (such as Macromedia ColdFusion MX or
Macromedia JRun) or another type of server-side script, such as PHP or Perl. Flash Player can
send and load data over HTTP or HTTPS or from a local text file. You can also create persistent
TCP/IP socket connections for applications that require low latency—for example, chat
applications or a stock quote services.
Data that you load into or send from a SWF file can be formatted as XML (Extensible Markup
Language) or as name-value pairs.
Flash Player can also send data to and receive data from its host environment—a web browser, for
example—or another instance of Flash Player on the same computer.
By default, a SWF file can only access data that resides in the same domain (for example,
www.macromedia.com) that the Flash movie originated from. (For more information, see
“Flash
Player security features” on page 188
.)
Sending and loading variables to and from a remote source
A SWF file is a window for capturing and displaying information, much like an HTML page.
However, SWF files can stay loaded in the browser and continuously update with new
information without having to reload the entire page. Using ActionScript functions and methods,
you can send information to and receive information from server-side scripts, text files, and
XML files.
In addition, server-side scripts can request specific information from a database and relay it to a
SWF file. Server-side scripts can be written in many different languages: some of the most
common are CFML, Perl, ASP (Microsoft Active Server Pages), and PHP. By storing information
in a database and retrieving it, you can create dynamic and personalized content for your SWF
file. For example, you could create a message board, personal profiles for users, or a shopping cart
that keeps track of a user’s purchases so that it can determine the user’s preferences.
Содержание FLASH MX 2004 - ACTIONSCRIPT
Страница 1: ...ActionScript Reference Guide...
Страница 8: ...8 Contents...
Страница 12: ......
Страница 24: ...24 Chapter 1 What s New in Flash MX 2004 ActionScript...
Страница 54: ...54 Chapter 2 ActionScript Basics...
Страница 80: ...80 Chapter 3 Writing and Debugging Scripts...
Страница 82: ......
Страница 110: ...110 Chapter 5 Creating Interaction with ActionScript...
Страница 112: ......
Страница 120: ...120 Chapter 6 Using the Built In Classes...
Страница 176: ......
Страница 192: ...192 Chapter 10 Working with External Data...
Страница 202: ...202 Chapter 11 Working with External Media...
Страница 204: ......
Страница 782: ...782 Chapter 12 ActionScript Dictionary...
Страница 793: ...Other keys 793 221 222 Key Key code...
Страница 794: ...794 Appendix C Keyboard Keys and Key Code Values...
Страница 798: ...798 Appendix D Writing Scripts for Earlier Versions of Flash Player...
Страница 806: ...806 Appendix E Object Oriented Programming with ActionScript 1...
Страница 816: ...816 Index...