home *** CD-ROM | disk | FTP | other *** search
/ Shocking The Web CD-ROM / SHOCK_CD.ISO / pc / tutorial / devglry / zoetek / source / shckclck.dir / 00091_Main.ls < prev    next >
Encoding:
Text File  |  1996-04-11  |  1.4 KB  |  72 lines

  1. global tick, shockTime, beeps, bignil, smallnil, amloc, sMode, stopwatchpause, day1
  2.  
  3. on startMovie
  4.   doInit()
  5. end
  6.  
  7. on doInit
  8.   castInit()
  9.   timeInit()
  10.   dateInit()
  11.   alarmInit()
  12.   timerInit()
  13.   stopwatchInit()
  14.   timezoneInit()
  15. end
  16.  
  17. on castInit
  18.   set bignil to the number of cast "Big Nil"
  19.   set smallnil to the number of cast "Small Nil"
  20.   set amloc to the number of cast "AM"
  21.   set sMode to 9
  22.   set day1 to the number of cast "SU"
  23. end
  24.  
  25. on upkeep
  26.   getTheTime()
  27.   set x to the result
  28.   if the second of shockTime <> the second of x then
  29.     set shockTime to x
  30.     set tick to 1
  31.     checkAlarm()
  32.     checkTimer()
  33.     indicatealarm()
  34.     if beeps then
  35.       beep()
  36.       set beeps to beeps - 1
  37.     end if
  38.   end if
  39. end
  40.  
  41. on gonext
  42.   set tick to 1
  43.   puppetrange(1, 44, 0)
  44.   if the frameLabel <> "timezone" then
  45.     go(#next)
  46.   else
  47.     go("clock")
  48.   end if
  49.   puppetrange(1, 44, 1)
  50.   set x to the frameLabel
  51.   if x = "alarm" then
  52.     alarm()
  53.   end if
  54.   if x = "stopwatch" then
  55.     set the castNum of sprite sMode to the number of cast "stopwatch" + stopwatchpause
  56.   end if
  57.   if x = "timezone" then
  58.     tzDisplay()
  59.   end if
  60. end
  61.  
  62. on puppetrange x, y, val
  63.   repeat with z = x to y
  64.     set the puppet of sprite z to val
  65.   end repeat
  66. end
  67.  
  68. on donum start, nil, pad, val
  69.   set the castNum of sprite start to nil + (val / 10) + (pad or (val / 10))
  70.   set the castNum of sprite (start + 1) to nil + (val mod 10) + 1
  71. end
  72.