Category Archives: JSFL

Bulk swap elements from timelines by tagging their layers

This happened me several times: I needed to swap a lot of movie clips, and the flash swap dialog completely ignores ergonomy, specially when your library has more then 300 symbols. This scripts handle it. You “tag” the layer of the movieclip with the name of the movieclip we’ll swap to. And tagging layers is [...]
Posted in JSFL | Tagged | Leave a comment

Remove empty folders from library

Oh, this is a simple trick, but might be useful if you have a huge library. You know… when you use the “remove unused items” and flash does forget to remove the folders function remove_empty_folders(doc){   for( var i = 0; i < doc.library.items.length; i++){     var item=doc.library.items[i];     var item_name=item.name;     var item_name_length=item_name.length;   [...]
Posted in JSFL | Tagged | Leave a comment

Find and Replace Library Names and Linkages using JSFL

Another script to save programmer’s fingers. It replaces words in library, including linkages and package names. Case sensitive. So, if you want to replace all class linkages from the package “com.test1″ to “com.test1.specific”, it’s an instant. It asks which is the word to substitute, and by which word. Hit ok, and it’s done. function find_and_replace_in_library(){   [...]
Posted in JSFL | Tagged , , | 1 Comment

Automatically assign AS3 class linkages to library Bitmaps using JSFL (CS4+)

This script prompts you to choose the package for the linkages that will be added. Then, it search for all not yet linked bitmaps in library. When it find anyone, it set the class name based in the library item name. Unfortunately, it won’t work on CS3. function add_linkage(doc){     var package=prompt(‘Choose a package or live [...]
Posted in JSFL | Tagged , , , | Leave a comment

Bug: flash psd importer adds an extra instance of a movieclip inside the assets folder

This is probably the mostly exhotic post of this blog. I have several times had problems with this bug, so I’ve built a script to correct it. Flash PSD importer, in rare occasions, create non-desired movieclips inside of the desired movieclips. These bastards come nested inside the Assets folder of the “real movieclip”, and are child [...]
Also posted in flash psd importer | Tagged , , , , | Leave a comment

Add AS2 linkage identifiers to library Bitmaps or Movie Clips using JSFL

These are scripts to add AS2 linkage identifiers to items in library. Linkage is added to all those items that don’t yet have it assigned. This may make things a lot faster and less boring when you need to give maintenance to old projects. This first script add linkage identifiers to movieclips. function add_linkage(doc){   var library=doc.library;   [...]
Posted in JSFL | Tagged , , , | 1 Comment

Automatically assign AS3 class linkages to library MovieClips using JSFL

This script prompts you to choose the base class and package for the linkages that will be added. Then, it search for all not yet linked movieclips in library. When it find anyone, it set the class name based in the library item name. function add_linkage(doc){     var base=prompt(‘Choose a base class’,‘flash.display.MovieClip’);   var package=prompt(‘Choose [...]
Posted in JSFL | Tagged , , | 2 Comments

Publish all opened FLA files using JSFL

I’ve built this once I was performing changes in a core script I use in every actionscript application. To avoid definition conflicts, every change demanded re-compiling the 16 fla of the current project. I was a little bit tired of hitting shift+F12. So, this script publishes all opened FLA files according to their own [...]
Posted in JSFL | Tagged , | 1 Comment

Photo or lossless? Automatically choose the optimized Bitmap compression using JSFL

This script compile the current FLA twice for each bitmap, testing the best compression for each of them and choosing the virtually most advantageous one. It ignores bitmaps marked as “useImportedJPEGQuality”. function bitmap_quality(doc){   var doc_path_uri=getFolderURI(doc.path);   var tempFile=path.substr(0,doc_path_uri.lastIndexOf(‘/’))+‘/temp.swf’;   var library=fl.getDocumentDOM().library;     var items=library.items;   var items_length=items.length;   for( var h = 0; h < items_length; h++){     var item=items[h];   [...]
Posted in JSFL | Tagged , , , , , | 1 Comment

Set AllowSmoothing for all Bitmaps using JSFL

Today we have two very simple JSFL scripts to make this happen unpainfully. To turn on: var library=fl.getDocumentDOM().library; var items=library.items; var items_length=items.length; for( var i = 0; i < items_length; i++){   var item=items[i];   if(item.itemType==‘bitmap’){     item.allowSmoothing=true;   } } Click here to download To turn off: var library=fl.getDocumentDOM().library; var items=library.items; var items_length=items.length; for( var i = 0; i < items_length; i++){   var item=items[i];   if(item.itemType==‘bitmap’){     item.allowSmoothing=false;   } } Click here [...]
Posted in JSFL | Tagged , , | Leave a comment