home *** CD-ROM | disk | FTP | other *** search
/ Shocking The Web CD-ROM / SHOCK_CD.ISO / pc / tutorial / casestdy / ch11_sfx / shhome.dir / 00021.ls < prev    next >
Encoding:
Text File  |  1996-11-12  |  2.0 KB  |  94 lines

  1. on startMovie
  2.   global gBaseURL, gReadyToGo
  3.   set gBaseURL to "../"
  4.   set gReadyToGo to 0
  5.   set the randomSeed to the ticks
  6.   set pCursor to the number of member "pointing"
  7.   set the cursor of sprite 6 to [pCursor, pCursor + 1]
  8.   set the cursor of sprite 19 to [pCursor, pCursor + 1]
  9.   pass()
  10. end
  11.  
  12. on getLoadID theMovie
  13.   PreloadNetThing(theMovie)
  14.   set CurrID to GetLatestNetID()
  15.   return CurrID
  16. end
  17.  
  18. on waitForTicks theTicks
  19.   set startTime to the timer
  20.   repeat while (startTime + theTicks) > the timer
  21.     nothing()
  22.   end repeat
  23. end
  24.  
  25. on goMovie theMovie
  26.   global gPreloadingOn, gBaseURL, gReadyToGo
  27.   if not (theMovie contains ".dcr") then
  28.     set theMovie to theMovie & ".dcr"
  29.   end if
  30.   set fadeDuration to 200
  31.   if soundBusy(1) or soundBusy(2) then
  32.     set lPlaying to 1
  33.   end if
  34.   if soundBusy(1) then
  35.     sound fadeOut 1, fadeDuration
  36.   end if
  37.   if soundBusy(2) then
  38.     sound fadeOut 2, fadeDuration
  39.   end if
  40.   if lPlaying = 1 then
  41.     waitForTicks(fadeDuration)
  42.   end if
  43.   set gReadyToGo to 1
  44.   GoToNetMovie(theMovie)
  45. end
  46.  
  47. on goPage thePage
  48.   global gReadyToGo
  49.   set fadeDuration to 20
  50.   if soundBusy(1) or soundBusy(2) then
  51.     set lPlaying to 1
  52.   end if
  53.   if soundBusy(1) then
  54.     sound fadeOut 1, fadeDuration
  55.   end if
  56.   if soundBusy(2) then
  57.     sound fadeOut 2, fadeDuration
  58.   end if
  59.   updateStage()
  60.   if lPlaying = 1 then
  61.     waitForTicks(fadeDuration)
  62.   end if
  63.   set gReadyToGo to 1
  64.   goToNetPage(thePage)
  65. end
  66.  
  67. on enterFrame
  68.   checkCycle()
  69. end
  70.  
  71. on getFileName theURL
  72.   repeat with i = the number of chars in theURL down to 1
  73.     if (char i of theURL = "/") or (char i of theURL = ":") then
  74.       set rVal to char i + 1 to the number of chars in theURL of theURL
  75.       exit repeat
  76.     end if
  77.   end repeat
  78.   return rVal
  79. end
  80.  
  81. on checkCycle
  82.   global gRealClick, gForeCol, gCycCol
  83.   if gRealClick then
  84.     if the mouseDown then
  85.       set the foreColor of sprite gRealClick to random(256) - 1
  86.       updateStage()
  87.     else
  88.       set the foreColor of sprite gRealClick to gForeCol
  89.       updateStage()
  90.       set gRealClick to 0
  91.     end if
  92.   end if
  93. end
  94.