Archive for September, 2008
JSFL - Convert selected items on stage to MovieClips
Here is a handy dandy script I wrote to select a bunch of items on stage, lets say 300 vector shapes for some ungodly reason, and convert them all to MovieClips based on a root name you pass. This has helped tremendously in the past. I have gotten a few inqueries for something like this recently so here you go:
** PLEASE NOTE **
You have to “distribute to layers”, then select the layers on the timeline and then run the script for it to work, don’t select the actual items themselves. Its a little funky I know. I havent had to time to work this out to be more user friendly. Sorry.
/*
Action: Creates MovieClips from the items on selected layers.
** The layers need to be selected, not the items themselves.
Author: Charles D Clements
URL: www.charlesclements.net
Date: 10/11/07
*/
/*
Variables
*/
// Base clip name.
var baseName = prompt(”What base name would you like to use?”);
// All layers in document.
var currentLayersArray = fl.getDocumentDOM().getTimeline().layers
// Create an Array of the layer indeces.
var layerArray = fl.getDocumentDOM().getTimeline().getSelectedLayers();
// Stores original lock status.
var lockStatus = []
// Increment variable
var num = 0
/*
Functionality
*/
for(c = 0; c < currentLayersArray.length; c++){
lockStatus.push(currentLayersArray[c].locked)
}
/*
for(c = 0; c < currentLayersArray.length; c++){
oldLayers.push(currentLayersArray[c])
}
*/
// Lock all layers.
for(b = 0; b < currentLayersArray.length; b++){
fl.getDocumentDOM().getTimeline().layers[b].locked = true
}
// Loop thru Array of layers selected.
for(a = 0; a < layerArray.length; a++){
// Lock all layers.
for(b = 0; b < layerArray.length; b++){
fl.getDocumentDOM().getTimeline().layers[layerArray[b]].locked = true
}
// Unlock current layer.
fl.getDocumentDOM().getTimeline().layers[layerArray[a]].locked = false
// Get item on layer.
var myElements = fl.getDocumentDOM().getTimeline().layers[layerArray[a]].frames[0].elements;
// Select all items.
fl.getDocumentDOM().selectAll();
// Convert items to Symbols.
if(myElements.length > 0){
fl.getDocumentDOM().convertToSymbol(”movie clip”, baseName+num, “top left”);
fl.getDocumentDOM().selection[0].name = baseName+num
}
// Increment variable.
num++
}
// Set layer’s lock properties to what they were originally.
for(b = 0; b < currentLayersArray.length; b++){
var layer = fl.getDocumentDOM().getTimeline().layers[b]
layer.locked = lockStatus[b]
}
“THE MIGHTY B”!!!! Dont sleep on it!

It was Saturday. I was looking for the amusement only a cartoon provides. I wanted something familiar but there was nothing available. I came across a title that didn’t particularly stand out but I gave it a shot; “The Mighty B”. I won’t lie, I was hoping that this wasn’t some weak Nickelodeon show like “Doug”, “Rugrats”, “Hey Arnold” or the dreaded “Wild Thornberrys”. These shows spewed mediocrity and should have never left the creators skulls (no, I’m not biased). I was fantastically surprised. The writing is genius, the artwork is incredible. It’s like someone stole the torch from Tex Avery and shot for new heights. “The Mighty B” is reminiscent of “Ren and Stimpy”, “Spongebob Squarepants”, anything good from the 40’s and 50’s, and I want to say “Felix the Cat” for some reason. It is everything I could want and more. I seriously haven’t laughed harder in 15 years. What really caught my eye was the exaggerated poses and the wonderful contrast between vector graphics and color pencil backgrounds. Really great stuff. I love the effect that the rough cold press paper gives for the background; very organic. Do yourself a favor, check out the show and leave me a comment to tell me if I’m crazy or not for going on such a positive rant. This show should flourish among the Flash (Interactive) demographic where dry humor and appreciation for subtle genius runs rampant like an angry plague.