home *** CD-ROM | disk | FTP | other *** search
- on setStyles
- global fontNameList, fontSizeList, fontStyleList
- if the machineType = 256 then
- set fontNameList to ["times new roman", "arial", "helvetica", "new courier"]
- else
- set fontNameList to ["times", "geneva", "chicago", "monaco"]
- end if
- set fontSizeList to [9, 10, 12, 14, 18, 24]
- set fontStyleList to ["plain", "italic", "underline", "condense"]
- set showMe to 0
- initColorLists()
- end
-
- on initColorLists
- global gray2black, black2gray, useMeColors
- set black2gray to [255, 254, 253, 252, 251]
- set gray2black to [251, 252, 253, 254, 255]
- set useMeColors to [251, 252, 253, 254, 255, 244, 243, 242, 241, 234, 224, 219, 220, 212, 213, 214, 208, 207, 206, 202, 200, 12, 27, 44, 46, 48, 50, 51, 52, 106, 107]
- end
-
- on stopMovie
- end
-
- on enterFrame
- global showMe
- if showMe then
- randomOperate()
- end if
- end
-
- on initHeightPatch
- global gRealTHList
- set gRealTHList to [:]
- repeat with i = 30 to 34
- set thisOne to the name of cast i
- setaProp(gRealTHList, "#" & thisOne, 0)
- end repeat
- end
-
- on randomOperate
- global gRealTHList, gray2black, black2gray, useMeColors, fontNameList, fontSizeList, fontStyleList, gExitOp
- set theFieldNum to random(count(gRealTHList))
- set N to 1
- set theField to "text" & theFieldNum
- set chunkType to "word"
- do("set " & "n" & " = the number of " & chunkType & "s in field " & QUOTE & theField & QUOTE)
- set N to random(N)
- set infoLine to N && "of field" && QUOTE & theField & QUOTE
- set exitOp to "if the textStyle of" && chunkType && infoLine & gExitOp
- put exitOp
- put N
- set opType to random(4)
- set opsList to ["size", "color", "font", "style"]
- if opType = 1 then
- changeTextSize(theField, chunkType && N, getAt(fontSizeList, random(count(fontSizeList))))
- else
- if opType = 2 then
- changeTextColor(theField, chunkType && N, getAt(useMeColors, random(count(useMeColors))))
- else
- if opType = 3 then
- changeTextFont(theField, chunkType && N, getAt(fontSizeList, random(count(fontNameList))))
- else
- if opType = 4 then
- changeTextStyle(theField, chunkType && N, getAt(fontStyleList, random(count(fontStyleList))))
- end if
- end if
- end if
- end if
- end
-
- on resetAllFields
- global fontNameList, fontStyleList, gFields, showMe
- repeat with i = 1 to 5
- set theField to getAt(gFields, i)
- set highChar to the number of words in field theField
- changeTextSize(theField, "word 1 to " & highChar, 12)
- if showMe then
- morphHeight(theField, 1)
- end if
- changeTextColor(theField, "word 1 to " & highChar, 255)
- changeTextStyle(theField, "word 1 to " & highChar, getAt(fontStyleList, 1))
- changeTextFont(theField, "word 1 to " & highChar, getAt(fontNameList, 1))
- repeat with j = 1 to the number of lines in field theField
- if line j of field theField contains "?" then
- changeTextStyle(theField, "line " & j, "bold")
- end if
- end repeat
- morphHeight(theField, 24)
- end repeat
- updateStage()
- end
-