2、从组件栏中拖两个Combo Box到场景中,分别设置属性如下:A、命名为curve_cb,设置labels为“[normal, very tight, pixels, smooth, very smooth]”,设置rowCount为5;B、命名为corner_cb,设置labels为“[normal, many corners, few corners]”,设置rowCount为5。
/* Copyright 2003 Macromedia, Inc. All rights reserved. The following is Sample Code and is subject to all restrictions on sUCh code as contained in the End User License Agreement accompanying this product. */ function click() { var tab = " "; var asNewLine = "\n"; //注释1 if (start_stp.value == "") { var startKF_as = "\"\""; } else { var startKF_as = start_stp.value; } if (end_stp.value == "") { var endKF_as = "\"\""; } else { var endKF_as = end_stp.value; } if (color_stp.value == "") { var threshold_as = "\"\""; } else { var threshold_as = color_stp.value; } if (area_stp.value == "") { var minArea_as = "\"\""; } else { var minArea_as = area_stp.value; } var curveFit_as = _root.curve_cb.value; var corner_as = _root.corner_cb.value; //注释2 var str = "var cur_tl = fl.getDocumentDOM().getTimeline();"+"var curFrame, startKF, endKF;"+"var newSel = new Array();"+"try {"+"startKF = eval("+startKF_as+"-1);"+"endKF = eval("+endKF_as+"-1);"+"var threshold = "+threshold_as+";"+"var minArea = "+minArea_as+";"+"var curveFit = \""+curveFit_as+"\";"+"var corner = \""+corner_as+"\";"+"var errorMessage = \"\";"+"function theErrorMessage(msg){"+"if (errorMessage == \"\"){"+"errorMessage = msg;"+"}"+"else{"+"errorMessage += \"\\n\"+msg;"+"};"+"};"+"var thresholdErrorCondition = threshold==\"\" || threshold < 1 || threshold > 500;"+"var minAreaErrorCondition = minArea==\"\" || minArea > 1000 || minArea < 1 ;"+"if(startKF <=-1 || endKF==-1 || thresholdErrorCondition || minAreaErrorCondition){"+"if(startKF == -1){"+"theErrorMessage(\"Please enter a start frame.\");"+"};"+"if(startKF < -1){"+"theErrorMessage(\"The start frame you specified does not exist.\");"+"};"+"if(endKF == -1){"+"theErrorMessage(\"Please enter an end frame.\");"+"};"+"if(endKF < -1){"+"theErrorMessage (\"The end frame you specified does not exist.\");"+"};"+"if(thresholdErrorCondition){"+"theErrorMessage (\"Please enter a value for Threshold between 1 - 500.\");"+"};"+"if( minAreaErrorCondition){"+"theErrorMessage (\"Please enter a value for Minimum Area between 1 - 1000.\");"+"};"+"alert(errorMessage);"+"}"+"else{"+"for (var k=0; k //注释3