// you’re reading...

Actionscript 3.0

Saving time with JSFL

A co-worker of mine needed to go through a thousand or so instances on stage and name them according to there respective Class names. This could take a few hours of copying, pasting, then renaming. This could easily lead to a nervous melt down if your not careful.

JSFL FILE TO THE RESCUE

JSFL stands for JavaScript Flash. A JSFL file contains a form of JavaScript that the Flash IDE uses to automate task. Almost anything that you do in flash, you can do with JSFL. Let’s say for example you wanted to add a new scene. The code would look something like this.

flash.getDocumentDOM().addNewScene("myScene");

You can see all that JSFL has to offer by downloading the documentation here.

SOME FREE STUFF!

So remember my co-worker? I coded a simple script that allows you to select all the instances on the stage and name them all according to there class names. I also created one that allowed you to select an instance that had a shape in it and convert it into a MovieClip. He was then able to link these scripts to a quick key and finish the job in a fraction of the time.

You can download the source code here. Feel free to use it and modify it.

Discussion

One comment for “Saving time with JSFL”

  1. This is cool. I’ll look into it.

    Posted by Jonah | May 27, 2010, 2:28 PM

Post a comment