Flash Lite 1.x ActionScript Language Reference |
|
|
|
| Flash Lite Global Functions > loadVariables() | |||
Flash Lite 1.1.
loadVariables(url,target[,variables])
url A string representing an absolute or relative URL where the variables are located. If the SWF file issuing this call is running in a web browser, url must be in the same domain as the SWF file.
target The target path to a movie clip that receives the loaded variables.
variables An optional string parameter specifying an HTTP method for sending variables. The parameter must be the string GET or POST. If there are no variables to be sent, omit this parameter. The GET method appends the variables to the end of the URL and is used for small numbers of variables. The POST method sends the variables in a separate HTTP header and is used for long strings of variables.
Function; reads data from an external file, such as a text file or text generated by a ColdFusion, CGI, Active Server Pages (ASP), PHP, or Perl script, and sets the values for variables in a target movie clip. This function can also update variables in the active SWF file with new values.
The text at the specified URL must be in the standard MIME format application/x-www-form-urlencoded (a standard format used by CGI scripts). Any number of variables can be specified. For example, the following phrase defines several variables:
company=Adobe&address=600+Townsend&city=San+Francisco&zip=94103
To load variables into a specific level, use the loadVariablesNum() function instead of the loadVariables() function.
The following examples load variables from a text file and from a server:
// load variables from text file on local file system (Symbian Series 60)
on(release, keyPress "1") {
filePath = "file://c:/documents/flash/myApp/myvariables.txt";
loadVariables(filePath, _root);
}
// load variables (from server) into a movieclip
urlPath = "http://www.someserver.com/myvariables.txt";
loadVariables(urlPath, "myClip_mc");
loadMovieNum(), loadVariablesNum(), unloadMovie()
|
|
|
|