PDA

View Full Version : fscommand calls for SWF studio EXEs


Grig
04-30-2004, 08:24 AM
I'm writing an app that is compiled and downloaded as an EXE. The EXE wrapper is created using SWF Studio. SWF Studio allows me to save files to the local computer through a series of fscommand calls.

I had this working before, but I've _lost_ the code snippet I had for this. It required 2 things: that the function calls happen on the canvas' script tag AND a special flag to be set before the FSCOMMANDs are called.

I've been hunting around for this all morning and can't find anything. Can someone at Laszlo answer this one for me?

Here's an example of a readfile script:

function readFile(){
_level0.result = "?";
fscommand("Arg","_level0.result");
fscommand("Arg", _level0.ssStartDir + "\\userdata.dat");
fscommand("FILESYS2.READFILE","");
}

I just need a way to enable the fscommand calls.

Thanks! :)

ptw
04-30-2004, 03:52 PM
I think you are looking for this:

#pragma "flashCompilerCompatability=true";

which must be in the body of the function that calls fscommand.

Note that this #pragma and the use of fscommand is not officially supported and could change in the future.

ows
05-18-2004, 11:33 AM
Since this pragma changes a lot of other behaviors, you might want to put the fscommand call in a function that doesn't do much else. For example,


<script>
function fscommandarg(arg) {
#pragma "flashCompilerCompatability=true"
return fscommand('Arg', arg);
}
</script>


Also, Flash requires that the first argument to fscommand is a string literal, so you can't write a single function myfscommand and then call that e.g. myfscommand('Arg', etc).

Grig
05-18-2004, 11:39 AM
Good point of clarification! Thanks!