Flash and jsfl

Flash and jsfl

Flash y jsfl

All of  us who work with Flash have created our own jsfl commands to adjust the programs to fit our needs, some more simple and other more complex that allow us to automate repetitive tasks. Anyone who knows a little about JavaScript, can create his own commands, being these for Flash or for other Adobe programs which provide API access.

If you want to go further, they can be implemented as program extensions. One of the most interesting projects over jsfl is xJSFL, an open source jsfl framework for the creation of tools and plugins for the Flash program developed by Dave Stewart.

Some of the commands I have created and which I have needed at some time in order to develop repetitive tasks are shown below.

Change image compression type in the library

This command saves you from one of the most tedious task in Flash when you have to work with png files, as it tends to place the imported and pasted images in jpg.

Reduce the size of the selected element and place it at a certain point

This is a very simple command but often very helpful, as it repositions elements in the scene.

Change text properties

In Flash there is not a styles panel as in other Adobe programs, as Illustrator, Fireworks, etc. Because of that, in order to apply styles to a text, we have to apply each of the properties from the Character and Paragraph panels. To avoid repeating the text formatting, I usually create commands that work as the styles of a Styles panel. One of these commands can be created easily by saving as command the different actions that stay recorded in the History panel. Generally, once the command is saved, it is necessary to make some adjustments so that this works in any situation and not only in which the command has been recorded.

Modify fla files in a directory

One of the biggest problems with Flash when a big amount of fla files is managed is that, to modify something you have to open the file, modify it and compile it again. If that same modification has to be done in several ‘fla’ files, the solution is to use a command with a recursive function which opens, modify and compiles the different ‘fla’ files. From Flash CS5, instead of using the ‘fla’ format, we can use the XFL format, which allow us to do certain tasks on different ‘fla’ files by simply replacing the changes in XML files, although we do need to recompile the file afterwards.

Search and replace ActionScript

The following is an experimental command that searchs an ActionScript code and replaces it by another one in all the fla files in a folder. It can not access the code over clips, just as it was used in ActionScript 1 and 2. If anyone wants to try this, I recommend him/her the maximum possible precaution as it could take hours to process a ‘fla’ file and not using it on important files.

Tags:
©2024 PoseLab SL. All rights reserved.