home *** CD-ROM | disk | FTP | other *** search
/ Shocking The Web CD-ROM / SHOCK_CD.ISO / pc / tutorial / casestdy / ch12_isn / ledmiaw.dir / 00050.ls < prev    next >
Encoding:
Text File  |  1996-11-12  |  2.4 KB  |  89 lines

  1. global gMyMessage, gMessageLength, gIterCount, gCharToNumList, gCastNumList, gStopPoint, gStopFlag, gHowLongHold, gBlinkFlag, gBlinkOffset, gNumCharsToBlink, gStopOffset, gCharColorList
  2.  
  3. on startMovie
  4.   puppetTempo(10)
  5.   set gStopFlag to 0
  6.   set gStopPoint to 36
  7.   set gHowLongHold to 5
  8.   repeat with x = 12 to 47
  9.     puppetSprite(x, 1)
  10.   end repeat
  11. end
  12.  
  13. on goToNetPage destination
  14.   alert("GoToNetPage command. Goes to " & RETURN & destination)
  15. end
  16.  
  17. on clearNHold
  18.   repeat with x = 12 to 47
  19.     set the castNum of sprite x to the number of member " "
  20.     set the visible of sprite x to 1
  21.   end repeat
  22.   go("Set Up")
  23.   updateStage()
  24. end
  25.  
  26. on writeMessage
  27.   if gIterCount >= (count(gCharToNumList) - 35) then
  28.     set gIterCount to 0
  29.   else
  30.     repeat with x = 47 down to 12
  31.       set myNum to getAt(gCharToNumList, x - 11 + gIterCount)
  32.       set the castNum of sprite x to myNum
  33.       set the foreColor of sprite x to getAt(gCharColorList, x - 11 + gIterCount)
  34.     end repeat
  35.     updateStage()
  36.     set gIterCount to gIterCount + 1
  37.   end if
  38. end
  39.  
  40. on writeNStop
  41.   if gIterCount >= (count(gCharToNumList) - 35) then
  42.     set gIterCount to 0
  43.   else
  44.     if gIterCount = gStopPoint then
  45.       if gBlinkFlag then
  46.         go("HoldNBlink")
  47.       else
  48.         go("Hold")
  49.       end if
  50.     else
  51.       repeat with x = 47 down to 12
  52.         set myNum to getAt(gCharToNumList, x - 11 + gIterCount)
  53.         set the castNum of sprite x to myNum
  54.         set the foreColor of sprite x to getAt(gCharColorList, x - 11 + gIterCount)
  55.       end repeat
  56.       updateStage()
  57.       set gIterCount to gIterCount + 1
  58.     end if
  59.   end if
  60. end
  61.  
  62. on readLEDText
  63.   if objectp(myLEDText) then
  64.     myLEDText(mdispose)
  65.   end if
  66.   set myLEDText to fileio(mnew, "?read", "TEXT")
  67.   set newLEDValues to myLEDText(mReadFile)
  68.   myLEDText(mdispose)
  69.   if not listp(value(line 8 of newLEDValues)) then
  70.     alert("Not a valid LED Player text file!")
  71.   else
  72.     set gStopPoint to value(line 1 of newLEDValues)
  73.     set gHowLongHold to value(line 2 of newLEDValues)
  74.     set gStopFlag to value(line 3 of newLEDValues)
  75.     set gBlinkFlag to value(line 4 of newLEDValues)
  76.     set gBlinkOffset to value(line 5 of newLEDValues)
  77.     set gNumCharsToBlink to value(line 6 of newLEDValues)
  78.     set gStopOffset to value(line 7 of newLEDValues)
  79.     set gCharToNumList to value(line 8 of newLEDValues)
  80.   end if
  81. end
  82.  
  83. on makeList
  84.   set gCastNumList to [:]
  85.   repeat with x = 1 to 48
  86.     addProp(gCastNumList, the name of cast x, x)
  87.   end repeat
  88. end
  89.