Managing your scripts
The easiest way to manage your files is using Komodo's Projects panel. xJSFL comes with a default Komodo project, with 3 folders, core, modules, and user.
You can add your own scripts to the user folder if you wish or you can create your own Komodo Project elsewhere on your hard drive if that suits you better. If you develop any Modules you'll end up building sets of related files in a modules subfolder.
Writing and running your first JSFL script
You'll need the Komodo xJSFL Extension installed to run scripts, so make sure it is then:
- Create your first script by pressing CTRL+N, or by going File > New > New File
- Write any valid JSFL in the file, then save it with a .jsfl extension
- With Flash open, press CTRL+Enter to run the file
Initializing the framework
Due to the way Flash sandboxes externally-run files (i.e. from Komodo) you'll notice that variables created in one execution, won't exist in subsequent executions. This is different from running scripts via the Commands menu, or running them in Flash Panels.
What this means for xJSFL and running code from an external IDE is that a clever workaround is needed in order to not reload the entire framework from disk on every external script execution. In this case the workaround is that when xJSFL loads, all framework code is copied to the xJSFL extension, and a special method xjslf.init() is called to copy the code back out to the currently-running script environment.
// copy framework code to current scope xjsfl.init(this); // run your code inspect(window);