Data File
The highscore object we just built requires a file called highscore.txt. We make a file by that name in the same directory as our swf file. In it is a single line:
ActionScript
highscore=122
Loading this file will create the variable highscore at the specified scope and set the value to 122. Flash will treat it as the assignment of a string literal, equivalent to this line of ActionScript code:
ActionScript
var highscore = "122";
If a variable already exists with that name, Flash sets that highscore to "122". If not, it first creates the variable, then sets its value.
|