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.



Flash and XML[c] A Developer[ap]s Guide
Flash and XML[c] A Developer[ap]s Guide
ISBN: 201729202
EAN: N/A
Year: 2005
Pages: 160

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net