AnimatorX
08-28-2007, 04:19 AM
I need to write a jsfl script that will allow me to loop through all the frames in a scene and convert the bitmap files that are in them to vector graphics. This is the script I'm using, but I get an error telling me that traceBitmap() requires a selection.
var timeln = flash.documents[0].getTimeline();
var i;
for(i = 0 ;i < timeln.frameCount; i++){
var x;
var elems = timeln.layers[timeln.currentLayer].frames[i].elements;
for (x = 0; x < elems.length; x++) {
var elementType = elems[x];
var etype = elementType.instanceType;
if(etype=="bitmap"){
flash.documents[0].selection = [flash.documents[0].timelines[0].layers[tl.currentLayer].frames[i].elements[x]];
flash.documents[0].traceBitmap(32, 8, 'normal', 'normal');
}
}
}
The only element in each frame is a bitmap. If anyone can help me out here and point out what I'm doing wrong, i'd really appreciate it.
Thanks in advance,
Tim
var timeln = flash.documents[0].getTimeline();
var i;
for(i = 0 ;i < timeln.frameCount; i++){
var x;
var elems = timeln.layers[timeln.currentLayer].frames[i].elements;
for (x = 0; x < elems.length; x++) {
var elementType = elems[x];
var etype = elementType.instanceType;
if(etype=="bitmap"){
flash.documents[0].selection = [flash.documents[0].timelines[0].layers[tl.currentLayer].frames[i].elements[x]];
flash.documents[0].traceBitmap(32, 8, 'normal', 'normal');
}
}
}
The only element in each frame is a bitmap. If anyone can help me out here and point out what I'm doing wrong, i'd really appreciate it.
Thanks in advance,
Tim