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:


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:

 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.

Flash and XML[c] A Developer[ap]s Guide
Flash and XML[c] A Developer[ap]s Guide
ISBN: 201729202
Year: 2005
Pages: 160 © 2008-2017.
If you may any questions please contact us: