on menupick theAmount

put line 1 of the points of graphic "triangle" into theStart

put pointOnCircle(theStart,-60,theAmount) into theTop

put item 1 of theStart+theAmount,item 2 of theStart into theLeft

put theStart & return & theTop & return & theLeft & return & theStart into thePoints

set the points of graphic "triangle" to thePoints

--set the loc of graphic "triangle" to theAmount div 2+10,theAmount div 2

set the loc of graphic "triangle" to the loc of this card

end menupick

Result)``QcREVGeneralrevUniqueID 1199497920665231364100 Trianglei?on mouseDown send mouseDown to graphic "knob" end mouseDown _mcREVGeneralscriptChecksumH}9mbf)a bookmarksrevUniqueID 1199500176648handlerList mouseDownscriptSelection char 63 to 62prevHandler mouseDowntempScriptscriptdon mouseDown

send mouseDown to graphic "knob"

end mouseDown

TriangleKBcqdr,dcREVGeneralscriptChecksumُ B~ bookmarksrevUniqueID 1199410346749handlerListscriptSelectionchar 1 to 0prevHandlermouseUptempScriptscriptblueKB44cqdrdcREVGeneralrevUniqueID 1199499881984yellowKBcd,dcREVGeneralrevUniqueID 1199499884673redKBqfr,cREVGeneral bookmarksrevUniqueID 1199499885893handlerListprevHandlertempScriptscriptknobKT on mouseDown put the points of graphic "triangle" into thePoints repeat until the mouse is up if pointinpoly(the mouseLoc ,thePoints) then set the loc of me to the mouseloc else put line 1 of thePoints && distance(line 1 of thePoints, the mouseloc) & return into theDistances put line 2 of thePoints && distance(line 2 of thePoints, the mouseloc) & return after theDistances put line 3 of thePoints && distance(line 3 of thePoints, the mouseloc) after theDistances sort theDistances numeric by word 2 of each put word 1 of theDistances into point1 put word 1 of line 2 of theDistances into point2 if distance(point2,closestPointOnLine(point1, point2, the mouseloc)) > distance(point1, point2) then set the loc of me to point1 else set the loc of me to closestPointOnLine(point1, point2, the mouseloc) end if end if put distance(closestPointOnLine(line 2 of thePoints, line 3 of thePoints, the loc of me), the loc of me) into nr1 put distance(closestPointOnLine(line 3 of thePoints, line 1 of thePoints, the loc of me), the loc of me) into nr2 put distance(closestPointOnLine(line 1 of thePoints, line 2 of thePoints, the loc of me), the loc of me) into nr3 put (nr1+nr2+nr3) into theMax if nr1 <= 1 then put 0 into nr1 put round(100/theMax*nr2) into nr2 put 100-(nr1+nr2) into nr3 else if nr2 <= 1 then put round(100/theMax*nr1) into nr1 put 0 into nr2 put 100-(nr1+nr2) into nr3 else if nr3 <= 1 then put round(100/theMax*nr2) into nr2 put 0 into nr3 put 100-(nr3+nr2) into nr1 else put round(100/theMax*nr1) into nr1 put round(100/theMax*nr2) into nr2 put 100-(nr1+nr2) into nr3 end if put nr1 & return & nr2 & return & nr3 & return & return & sum(nr1,nr2,nr3) into field "result" put thePoints into temp put the loc of me into line 1 of temp put the loc of me into line -1 of temp set the points of graphic "red" to temp put thePoints into temp put the loc of me into line 2 of temp set the points of graphic "yellow" to temp put thePoints into temp put the loc of me into line 3 of temp set the points of graphic "blue" to temp end repeat end mouseDown theloc123,138hcREVGeneralscriptChecksum>dQMmgkrevUniqueID 1199415568716 bookmarkshandlerList mouseDowntempScriptprevHandler mouseDownscriptSelectionchar 2010 to 2009scripton mouseDown

put the points of graphic "triangle" into thePoints

repeat until the mouse is up

if pointinpoly(the mouseLoc ,thePoints) then

set the loc of me to the mouseloc

else

put line 1 of thePoints && distance(line 1 of thePoints, the mouseloc) & return into theDistances

put line 2 of thePoints && distance(line 2 of thePoints, the mouseloc) & return after theDistances

put line 3 of thePoints && distance(line 3 of thePoints, the mouseloc) after theDistances

sort theDistances numeric by word 2 of each

put word 1 of theDistances into point1

put word 1 of line 2 of theDistances into point2

if distance(point2,closestPointOnLine(point1, point2, the mouseloc)) > distance(point1, point2) then

set the loc of me to point1

else

set the loc of me to closestPointOnLine(point1, point2, the mouseloc)

end if

end if

put distance(closestPointOnLine(line 2 of thePoints, line 3 of thePoints, the loc of me), the loc of me) into nr1

put distance(closestPointOnLine(line 3 of thePoints, line 1 of thePoints, the loc of me), the loc of me) into nr2

put distance(closestPointOnLine(line 1 of thePoints, line 2 of thePoints, the loc of me), the loc of me) into nr3

put (nr1+nr2+nr3) into theMax

if nr1 <= 1 then

put 0 into nr1

put round(100/theMax*nr2) into nr2

put 100-(nr1+nr2) into nr3

else if nr2 <= 1 then

put round(100/theMax*nr1) into nr1

put 0 into nr2

put 100-(nr1+nr2) into nr3

else if nr3 <= 1 then

put round(100/theMax*nr2) into nr2

put 0 into nr3

put 100-(nr3+nr2) into nr1

else

put round(100/theMax*nr1) into nr1

put round(100/theMax*nr2) into nr2

put 100-(nr1+nr2) into nr3

end if

put nr1 & return & nr2 & return & nr3 & return & return & sum(nr1,nr2,nr3) into field "result"

put thePoints into temp

put the loc of me into line 1 of temp

put the loc of me into line -1 of temp

set the points of graphic "red" to temp

put thePoints into temp

put the loc of me into line 2 of temp

set the points of graphic "yellow" to temp

put thePoints into temp

put the loc of me into line 3 of temp

set the points of graphic "blue" to temp

end repeat

end mouseDown