Global Functions
75
Example
The following example loads information from a text file called params.txt into the main
Timeline of the SWF at level 2 in Flash Player. The variable names of the text fields must
match the variable names in the params.txt file. The
setInterval()
function is used to
check the progress of the data being loaded into the SWF. The script checks for a variable in
the params.txt file named
done
.
loadVariablesNum("params.txt", 2);
function checkParamsLoaded() {
if (_level2.done == undefined) {
trace("not yet.");
} else {
trace("finished loading. killing interval.");
trace("-------------");
for (i in _level2) {
trace(i+": "+_level2[i]);
}
trace("-------------");
clearInterval(param_interval);
}
}
var param_interval:Number = setInterval(checkParamsLoaded, 100);
// Params.txt includes the following text
var1="hello"&var2="goodbye"&done="done"
See also
getURL function
,
loadMovie function
,
loadMovieNum function
,
loadVariables
function
,
loadMovie (MovieClip.loadMovie method)
,
loadVariables
(MovieClip.loadVariables method)
,
load (LoadVars.load method)
mbchr function
mbchr(number:Number)
Deprecated
since Flash Player 5. This function was deprecated in favor of the
String.fromCharCode()
method.
Converts an ASCII code number to a multibyte character.
Availability:
ActionScript 1.0; Flash Player 4
Parameters
number
:Number
- The number to convert to a multibyte character.
Summary of Contents for FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Page 1: ...ActionScript 2 0 Language Reference ...
Page 1352: ...1352 ActionScript classes ...