Strict Standards: Only variables should be passed by reference in /home/abeall/public_html/fireworks/download.php on line 28

Warning: Cannot modify header information - headers already sent by (output started at /home/abeall/public_html/fireworks/download.php:28) in /home/abeall/public_html/fireworks/download.php on line 44
// Fireworks JavaScript Command // Sets selected point as the first node in the path // Install by copying to Fireworks/Configuration/Commands/ // Run in Fireworks via the Commands menu // Aaron Beall 2008-2011 - http://fireworks.abeall.com // Version 1.1 var dom = fw.selection ? fw.getDocumentDOM() : false; // document object var sel = new Array().concat(fw.selection); function SetFirstNode(){ var paths = []; for(var s in sel){ if(sel[s] == "[object Path]") paths.push(sel[s]); } if(!paths.length) return alert('This command requires a selection of one or more paths, with not more than one point selected for each path contour. It will set that selected point as the "first node" for that contour.'); var nodes, node, newNode, newNodes, selectedContours, contourIndex; for(var p = 0; p < paths.length; p++){ selectedContours = []; for(var c = 0; c < paths[p].contours.length; c++){ nodes = paths[p].contours[c].nodes; var nlen = nodes.length; for(var n = 0 ; n < nlen; n++){ if(nodes[n].isSelectedPoint){ if(selectedContours[c] == undefined) selectedContours[c] = n; else return alert('You have more than one point selected in the same contour. You must select no more than one point per contour to define as the first node.'); } } } if(!selectedContours.length) return alert('You have no selected points. Select a point on a contour to define as the first node.'); for(var c = 0; c < selectedContours.length; c++){ contourIndex = selectedContours[c]; if(contourIndex == undefined) continue; nodes = paths[p].contours[c].nodes; newNodes = []; for(var n = contourIndex; n < nodes.length; n++) newNodes.push(copyNode(nodes[n])); for(var n = 0; n < contourIndex; n++) newNodes.push(copyNode(nodes[n])); for(var n = 0; n < nodes.length; n++) pasteNode(nodes[n], newNodes[n]); } } return true; } // copy node function copyNode(pt){ return eval("(" + pt.toSource() + ")"); } // paste node function pasteNode(pt, ptCopy){ copyProps(pt, ptCopy, ["x", "y", "succX", "succY", "predX", "predY", "randomSeed", "isSelectedPoint", "isCurvePoint", "name"]); var dynamicInfo = []; for(var i = 0; i < ptCopy.dynamicInfo.length; i++) dynamicInfo.push(copyProps(new ContourNodeDynamicInfo(), ptCopy.dynamicInfo[i], ["pressure", "duration", "velocity"])); pt.dynamicInfo = dynamicInfo; return pt; } // copy props by name function copyProps(targetObj, sourceObj, props){ var p = props.length; while(p--) targetObj[props[p]] = sourceObj[props[p]]; return targetObj; } //try{ SetFirstNode(); //}catch(e){ alert([e, e.lineNumber, e.fileName].join("\n")) };