Jan 13
JSFL – Guide / Unguide Selected Layers
JSFL is one of those magic features in Flash that could possibly change your life (or at least put a huge smile on your face). If you are like me and deal with multitudes of layers on a single timeline and use the “guide layers” functionality frequently, this post is for YOU!!!
Wouldn’t it be great if you could select 10 layers at once and set them all as guided. The way we have always done it till now is if there are multiple layers that need to be guided, we would have to select layer / right click / guide layer for each one individually. I wrote this script to handle that redundant task and I share it with you.
——————————————————————————-
/*
My favorite part about this script is that if you select guided layers along with unguided layers, their statuses will be toggled.
Title: Guide / Unguide Layers
Action: Guides selected unguided layers and vice versa.
Author: Charles D Clements
Date: 10/11/07
*/
// Create an Array of the layer indeces.
var layerArray = fl.getDocumentDOM().getTimeline().getSelectedLayers();
// Loop thru Array.
for(a = 0; a < layerArray.length; a++){
var numLayer = layerArray[a]
var thisLayer = fl.getDocumentDOM().getTimeline().layers[numLayer]
switch(thisLayer.layerType){
case ‘normal’:
thisLayer.layerType = “guide”;
break
case ‘guide’:
thisLayer.layerType = “normal”;
break
}
}
——————————————————————————-