kolnedra . com | Executing command line commands through AS3 and JSFL

Executing command line commands through AS3 and JSFL

Executing command line commands through AS3 and JSFL

Date: 10 March 2010

During the creation of a Flash CS4 Codebase panel I found myself struggling around a simple feature in this panel: Opening a folder in the local file system.
This might look like an easy task, but unfortuantely I couldn't find anything close to what I was aiming for in the Flash CS4 Resource.
So I started another google quest for a satisfying answer and luckally for me (and you) I found a simple solution using the FLfile.runCommandLine method

// Windows approach
MMExecute('FLfile.runCommandLine("cmd /C explorer C:\\folder\\to\\open\\");');

// OSX
MMExecute('FLfile.runCommandLine("exec /Path/to/folder");');
The /C means: Carries out the command specified by string and then terminates.
And don't forget the double backslashes for the Windows example

Comments