Name
loadVariables( ) Global Function — retrieve an external set of variables
Availability
Flash 4 and later
Synopsis
loadVariables(URL, target) loadVariables(URL, target, method)
Arguments
- URL
A string specifying the path to a variable source—either a server-side script that returns variables or a text file containing variables.
- target
A string indicating the path to the movie clip or document level on which the loaded variables will be defined. May also be a reference to a movie clip or document level (references are converted to paths when used in a string context).
- method
An optional string indicating the method by which to send variables to an external script. If specified, the variables from the current timeline are sent to the script and
targetreceives the loaded variables. If omitted, variables are retrieved but none are sent. The legal values formethodare"GET"and"POST". This parameter must be a literal, not a variable or other expression. The standalone version of the Flash Player always uses the"GET"method regardless of themethodspecified.
Description
Normally, we define variables inside our movies using ActionScript.
However, using loadVariables( ), we may also
import variables into a movie from a text file or a server-side
application such as a Perl script. Variables loaded via
loadVariables( ) are scoped to the movie clip or
level specified by target and are always
of the string datatype. To attach loaded variables to the current timeline, use the empty string as the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access