67
CHAPTER 3
Working with External Data
In Macromedia Flex, 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. Macromedia Flash Player can send and load data over HTTP or HTTPS or load
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 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 or web page.
By default, a SWF file can access only data that resides in exactly the same domain (for example,
www.macromedia.com). For more information, see “Applying Flex Security” in
Developing Flex
Applications
.
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, and receive
information from 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 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.
Several ActionScript functions and methods let you pass information into and out of a SWF file.
Each function or method uses a protocol to transfer information and requires information to be
formatted in a certain way.
Summary of Contents for FLEX-FLEX ACTIONSCRIPT LANGUAGE
Page 1: ...Flex ActionScript Language Reference...
Page 8: ......
Page 66: ...66 Chapter 2 Creating Custom Classes with ActionScript 2 0...
Page 76: ......
Page 133: ...break 133 See also for for in do while while switch case continue throw try catch finally...
Page 135: ...case 135 See also break default strict equality switch...
Page 146: ...146 Chapter 5 ActionScript Core Language Elements See also break continue while...
Page 808: ...808 Chapter 7 ActionScript for Flash...
Page 810: ...810 Appendix A Deprecated Flash 4 operators...
Page 815: ...Other keys 815 Num Lock 144 186 187 _ 189 191 192 219 220 221 222 Key Key code...
Page 816: ...816 Appendix B Keyboard Keys and Key Code Values...
Page 822: ...822 Index...