Name
loadVariablesNum( ) Global Function — attach an external set of variables to a document level
Availability
Flash 5. Use the Load Variables Action in Flash
4 to place variables on a document level.
Synopsis
loadVariablesNum(URL, level) loadVariablesNum(URL, level, 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.
- level
A non-negative integer, or an expression that yields one, indicating the document level on which the loaded variables will be defined.
- 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
levelreceives the loaded variables. If omitted, variables are retrieved but none are loaded. 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
The loadVariablesNum( ) function is nearly
identical to loadVariables( ) except that it
requires the target level to be specified
as a number rather than as a string. This means that
loadVariablesNum( ) can attach variables to
document levels only, not movie clips. The target
level can be specified dynamically, as in:
var myLevel = 2;
loadVariablesNum("myVars.txt", myLevel);A similar effect could be achieved using string concatenation ...
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