EasyManua.ls Logo

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH - Sending and Loading Variables

MACROMEDIA FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
830 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
634 Working with External Data
Sending and loading variables
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 users 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.
The functions and MovieClip methods that use the HTTP or HTTPS protocol to send
information in URL-encoded format are
getURL(), loadVariables(),
loadVariablesNum(), loadMovie(), and loadMovieNum().
The LoadVars methods that use the HTTP or HTTPS protocol to send and load
information in URL-encoded format are
load(), send(), and sendAndLoad().
The methods that use HTTP or HTTPS protocol to send and load information as XML
are
XML.send(), XML.load(), and XML.sendAndLoad().
The methods that create and use a TCP/IP socket connection to send and load
information as XML are
XMLSocket.connect() and XMLSocket.send().
For more information, see the following topics:
“Checking for loaded data” on page 634
“Creating a progress bar to display data loading progress” on page 636
Checking for loaded data
Each function or method that loads data into a SWF file (except XMLSocket.send()) is
asynchronous: the results of the action are returned at an indeterminate time.

Table of Contents

Related product manuals