Connecting with External Sources > Sending and loading variables to and from a remote source |  |

Sending and loading variables to and from a remote source

A Flash movie is a window for capturing and displaying information, much like an HTML page. However, Flash movies can stay loaded in the browser and continuously update with new information without having to reload the entire page. Using Flash actions and object methods, you can send information to and receive information from server-side scripts, text files, and XML files. You can also load JPEG and MP3 files from a remote source into a Flash movie while the movie plays.

In addition, server-side scripts can request specific information from a database and relay it to a Flash movie. Server-side scripts can be written in many different languages: some of the most common are CF, 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 movie. 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.

Several ActionScript actions and methods allow you to pass information into and out of a movie. Each action and method uses a protocol to transfer information, and requires information to be formatted in a certain way.

| The MovieClip object methods that use HTTP or HTTPS protocol to send information in URL-encoded format are `getURL`, `loadVariables`, `loadVariablesNum`, `loadMovie`, and `loadMovieNum`.
| The LoadVars object methods that use HTTP or HTTPS protocol to send information in URL-encoded format are `load`, `send`, and `sendAndLoad`.
| The Sound object method that uses HTTP and HTTPS protocol to load sounds is `loadSound`.
| The ActionScript elements that use HTTP or HTTPS protocol to load JPEG images into a Flash movie are `loadMovie` and `loadMovieNum`.
| The methods that use HTTP or HTTPS protocol to send information as XML are `XML.send`, `XML.load`, and `XML.sendAndLoad`.
| The methods that create and use a TCP/IP socket connection to send information as XML are `XMLSocket.connect` and `XMLSocket.send`.