The age-old problem, finally hacked:
/*
Symbolize Contours
By Max Kaufmann
*/
function copy_array(src,dest) {
for (var i=0; i<src.length; i++)
dest[i] = src[i];
}
fl.outputPanel.clear();
var doc = fl.getDocumentDOM();
var tl = doc.getTimeline();
var elems = new Array();
doc.selectNone();
copy_array(tl.layers[tl.currentLayer].frames[tl.currentFrame].elements,elems
);
var index=0;
for (var i in elems) {
if (elems[i].elementType == "shape") {
var contours = new Array();
copy_array(elems[i].contours, contours);
for (var j in contours) {
var initialHalfEdge =
contours[j].getHalfEdge();
var halfEdge = initialHalfEdge;
doc.selectNone();
try {
while (doc.selection.length
== 0 && halfEdge.getNext()!=initialHalfEdge) {
var vert =
halfEdge.getVertex();
doc.mouseClick(vert, false, true);
halfEdge =
halfEdge.getNext();
}
} catch(e) {
fl.trace(e);
}
if (doc.selection.length == 0) {
var x =
initialHalfEdge.getVertex().x;
var y =
initialHalfEdge.getVertex().y;
fl.trace("Unable to group
contour at ("+x+", "+y+")");
} else if (doc.selection[0].elementType
== "shape") {
doc.convertToSymbol("movie
clip", "Contour"+index++, "center");
}
}
}
}
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com