|
|||
|
Hi everyone, I need some assistance again.
I have a game project that needs your assistance. I have a swf file with a dynamic text box that needs to load a player name from a text file saved from the SWFKIT published exe file. I have read the documentation but cannot for the life of me figure out how to load in the name. The save script works fine and writes a txt file to disk in the same directory as the exe. This is the initialize script I have so far. \\Initialize function Name (playerName) { this.playerName = playerName; } NameRecord = []; var NameFile = getAppDir() + "\\playerName.txt"; Datafile.load(NameFile) for (i = 0; i < NameRecord.length; i ++) { var player =NameRecord[i]; trace(player.playerName) } Sometimes I get a warning saying I have "using undefined property "playerName"", other times I get a warning saying "using undefined property "length"", or I do not get an undefined message as the trace result. So if anyone can help me load the playerName from the txt file into the textbox I would be eternally greatful. David |
|
|||
|
Could you please send us your project (to support@swfkit.com)? With only the above code, it is very hard for us to find out where the problem is. Thank you.
|
|
|||
|
Hi guys the files worked perfectly
I only have one other sleight problem. I assumed that DataFile.save and DataFile.saveAndEnc code where pretty much the same. When I changed the saveName script to this:var playerName = FlashPlayer.getVariable("_root.playerName"); var playerRecord = new playerInfo(playerName); function save() { var file = getAppDir() + "\\playerName.txt"; DataFile.saveAndEnc(file, "playerRecord"); } { save(); } The file no longer writes to disk. Any suggestions. Thanks again |
|
|||
|
Please set the "file encryption password" in "Resources" panel. The "saveAndEnc" method use that password to encrypt the data files. And please use "loadAndDec" method to load the encrypted data file.
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|