MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT Reference Manual page 179

Actionscript reference guide
Hide thumbs Also See for FLASH MX 2004 - ACTIONSCRIPT:
Table of Contents

Advertisement

For more information, see
on page
184.
Using HTTP to connect to server-side scripts
The
loadVariables()
functions and the
MovieClip.getURL()
HTTPS protocols. These functions send all the variables from the Timeline to which the
function is attached. When used as methods of the MovieClip object,
, and
getURL()
loadMovie()
method) handles its response as follows:
returns any information to a browser window, not to Flash Player.
getURL()
loadVariables()
loadMovie()
When you use
loadVariables()
several parameters:
is the file in which the remote variables reside.
URL
is the level or target in the SWF file that receives the variables. (The
Location
function does not take this parameter.)
For more information about levels and targets, see "About multiple Timelines and levels" in
Using Flash Help.
sets the HTTP method, either
Variables
When omitted, Flash Player defaults to
For example, if you wanted to track the high scores for a game, you could store the scores on a
server and use
loadVariables()
game. The function call might look like this:
loadVariables("http://www.mySite.com/scripts/high_score.php", _root.scoreClip,
GET);
This loads variables from the PHP script called
using the
scoreClip
Any variables loaded with the
application/x-www-form-urlencoded (a standard format used by CGI scripts). The file you specify
in the
parameter of
URL
format so that Flash can read them.This file can specify any number of variables; variable and
value pairs must be separated with an ampersand (
with a plus (
). For example, this phrase defines several variables:
+
highScore1=54000&playerName1=rockin+good&highScore2=53455&playerName2=
bonehelmet&highScore3=42885&playerName3=soda+pop
For more information, see
on page
loadMovie()
Dictionary," on page
"Using the XML class" on page 181
,
loadVariablesNum()
MovieClip.loadVariables()
methods can all communicate with server-side scripts over HTTP or
send all the variables of the specified movie clip; each function (or
loads variables into a specified Timeline or level in Flash Player.
loads a SWF file into a specified level or movie clip in Flash Player.
,
getURL()
to load them into the SWF file each time someone played the
HTTP method.
GET
loadVariables()
loadVariables()
loadVariables()
420, and the
LoadVars class
205.
Sending and loading variables to and from a remote source
and
,
,
getURL()
loadMovie()
,
MovieClip.loadMovie()
, or
, you can specify
loadMovie()
or
, by which the variables will be sent.
GET
POST
, but no variables are sent.
GET
high_score.php
function must be in the standard MIME format
must write out the variable and value pairs in this
), and words within a value must be separated
&
on page
422,
getURL()
entry in
Chapter 12, "ActionScript
"Using the XMLSocket class"
, and
loadMovieNum()
, and
loadVariables()
getURL()
into the movie clip instance
on page
394,
,
179

Advertisement

Table of Contents
loading

Table of Contents