|
|||
|
I have an swf (one frame only) with a text input box which has the contents assigned to a variable named "phrases".
I have used the following actionscript to link to a ffish script called "savePhrases", to try and save the variable to a file. newBtn.onRelease =function(){fscommand ("ffish_run","savePhrases");} The ffish script is as follows: //savePhrases var hp=FlashPlayer.getVariable("_root.phrases"); var filter = "Phrases(*.txt)|*.txt|"; var filename = Dialogs.fileSave(filter, ".txt"); if (filename) { file_stream = new FileStream(filename,"w"); trace(file_stream); file_stream.write(hp+"xxxxx"); file_stream.close(); }//end of if(filename) return true; The button works fine and will open the save dialogue. It will save to file the "xxxxx" (put there as a test) but will do nothing with the variable. There are no error messages, so it seems the variable is recognised but its contents are not used. What am I doing wrong?? |
|
|||
|
Success.
I think the problem was in where I placed the fscommand. I had it as its own function instead of putting it into the onRelease function of the save button. Anyway it works now as good as gold. Great prog. |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|