My three favorite JSFL commands

I’ve probably posted some of these before, but over the months, these three have proven worth their weight in gold, especially in developing components.

1. Export Selected SWCs.jsfl

Select any components in your library (components you are developing) and run this command. They will be exported into your components directory. Also, if they are in a folder in the library, and a folder of the same name exists in your components directory, that’s where they’ll go. This could even be fixed up with the new file i/o api to create the directory if it doesn’t exist.

var _doc = fl.getDocumentDOM();
var _lib = _doc.library;
var items = _lib.getSelectedItems();
var numItems = items.length;
for(var i=0;i

2. No Export First Frame

This just goes through your library and unchecks "Export in First Frame" for every exported item. Again, quite useful in making components or preloaded applications.

items = fl.getDocumentDOM().library.items;
numItems = items.length;
for(var i=0;i

3. Save and Test.

Of course we all got used to Control-Enter to test, right? But then I got into PrimalScript, which allows you to run a script by hitting F7. I made this JSFL file for PrimalScript to cause it to save the current fla and test it. But then sometimes I'd do something in the Flash IDE and hit F7 out of habit and create a new keyframe or something stupid. So I copied the file over into my commands directory and assigned F7 as a keyboard shortcut to it. Note that it saves the file first, in case you do something that puts Flash into an infinite loop and crashes the program. At least your work is saved.

fl.outputPanel.clear();
fl.getDocumentDOM().save();
fl.getDocumentDOM().testMovie();

Note that you can assign keyboard shortcuts to ANY command. This really speed up workflow.
These are deceivingly small and simple, considering how useful they actually are. The first two, particularly.

This entry was posted in Flash. Bookmark the permalink.

7 Responses to My three favorite JSFL commands

  1. Sam Robbins says:

    I use them all day long! JSFL is like the pork chop sandwich of Flash.

  2. Colby says:

    Man, did that smell good.

  3. Keith Peters says:

    cool, my own personal hecklers… 🙂

  4. That hitting F7 out of habit in Flash sounds so reckognizable….

  5. Jason says:

    That is fantastic…I use Visual Studio quite often and can’t tell you how many times I’ve F5’d (debug in VS) a flash movie only to find that I’m inserting new frames.

  6. shakib says:

    ah, now if only you could code firefox-like mouse gestures into flash 😉

  7. Oliver says:

    I read your very impressive site daily.

Comments are closed.