Mike_Reynolds
07-31-2005, 01:50 AM
Soften Fill Edges makes shapes and I want to manipulate their color and alpha. Shapes can't have their color or alpha manipulated in ActionScript, but MovieClip symbols can, so I need to convert all of the shapes in the soften fill edges to movie clips.
// On an empty stage with 1 frame only, I type a character, break it apart and
// do a Soften Fill Edges with parameters of 50, 50. Now I have 50 shapes in the
// only frame. This code should convert each shape to it's own symbol, but instead
// it puts all 50 shapes into a single symbol.
var elementArray = document.getTimeline().layers[0].frames[0].elements;
fl.trace(elementArray.length);
// This trace prints out ONE instead of fifty!!
// Thus the following code fails to put each shape into it's own symbol.
var nSym = 1;
var selectionArray = new Array;
for (var nElem = 0; nElem < elementArray.length; nElem++)
{
if (elementArray[nElem].elementType == "shape")
{
selectionArray[0] = elementArray[nElem];
fl.getDocumentDOM().selection = selectionArray;
document.convertToSymbol("movie clip", "d"+nSym, "center");
}
}
BTW, what is the comment command for JSFL? // doesn't do it.
// On an empty stage with 1 frame only, I type a character, break it apart and
// do a Soften Fill Edges with parameters of 50, 50. Now I have 50 shapes in the
// only frame. This code should convert each shape to it's own symbol, but instead
// it puts all 50 shapes into a single symbol.
var elementArray = document.getTimeline().layers[0].frames[0].elements;
fl.trace(elementArray.length);
// This trace prints out ONE instead of fifty!!
// Thus the following code fails to put each shape into it's own symbol.
var nSym = 1;
var selectionArray = new Array;
for (var nElem = 0; nElem < elementArray.length; nElem++)
{
if (elementArray[nElem].elementType == "shape")
{
selectionArray[0] = elementArray[nElem];
fl.getDocumentDOM().selection = selectionArray;
document.convertToSymbol("movie clip", "d"+nSym, "center");
}
}
BTW, what is the comment command for JSFL? // doesn't do it.