home *** CD-ROM | disk | FTP | other *** search
/ Shocking The Web CD-ROM / SHOCK_CD.ISO / pc / tutorial / casestdy / ch11_sfx / esnavbar.dir / 00001.ls next >
Encoding:
Text File  |  1996-11-12  |  2.2 KB  |  110 lines

  1. on startMovie
  2.   global gBaseURL
  3.   localInit()
  4.   pass()
  5. end
  6.  
  7. on getLoadID theMovie
  8.   PreloadNetThing(theMovie)
  9.   set CurrID to GetLatestNetID()
  10.   return CurrID
  11. end
  12.  
  13. on waitForTicks theTicks
  14.   set startTime to the timer
  15.   repeat while (startTime + theTicks) > the timer
  16.     nothing()
  17.   end repeat
  18. end
  19.  
  20. on goMovie theMovie
  21.   global gPreloadingOn, gCurrLoading, gLoadStatus, gBaseURL, gReadyToGo
  22.   if not (theMovie contains ".dcr") then
  23.     set theMovie to theMovie & ".dcr"
  24.   end if
  25.   set gReadyToGo to 1
  26.   GoToNetMovie(theMovie)
  27.   fadeAllSounds(200)
  28. end
  29.  
  30. on goPage thePage, frameSet
  31.   global gPreloadingOn, gCurrLoading, gLoadStatus, gReadyToGo, gBaseURL
  32.   set gReadyToGo to 1
  33.   if not frameSet then
  34.     goToNetPage(thePage)
  35.     fadeAllSounds(200)
  36.   else
  37.     goToNetPage(thePage, frameSet)
  38.   end if
  39. end
  40.  
  41. on idle
  42.   global cgiFlag, gCGIResult
  43.   if cgiFlag = 1 then
  44.     set gCGIResult to checkCGI()
  45.   end if
  46. end
  47.  
  48. on getFileName theURL
  49.   repeat with i = the number of chars in theURL down to 1
  50.     if (char i of theURL = "/") or (char i of theURL = ":") then
  51.       set rVal to char i + 1 to the number of chars in theURL of theURL
  52.       exit repeat
  53.     end if
  54.   end repeat
  55.   return rVal
  56. end
  57.  
  58. on getCurrLabel
  59.   set lastLine to the number of lines in the labelList - 1
  60.   repeat with i = 1 to lastLine
  61.     if the frame < label(line i of the labelList) then
  62.       if i > 1 then
  63.         return line i - 1 of the labelList
  64.       else
  65.         return EMPTY
  66.       end if
  67.       exit
  68.     end if
  69.   end repeat
  70.   return line lastLine of the labelList
  71. end
  72.  
  73. on goCookiePage thePage
  74.   global cgiFlag, gReadyToGo
  75.   put thePage
  76.   if not cgiFlag then
  77.     getNetText("http://www.dxm.com/cgi/cookie_set.cgi?cookieName=nextPage;cookieValue=" & thePage)
  78.     set cgiFlag to 1
  79.     set gReadyToGo to 1
  80.   end if
  81. end
  82.  
  83. on checkCGI
  84.   global cgiFlag, gReadyToGo
  85.   if cgiFlag = 1 then
  86.     if NetDone() = 1 then
  87.       set cgiFlag to 0
  88.       set gReadyToGo to 0
  89.       return NetTextResult()
  90.       exit
  91.     end if
  92.   end if
  93.   return 0
  94. end
  95.  
  96. on fadeAllSounds fadeDuration
  97.   if soundBusy(1) or soundBusy(2) then
  98.     set lPlaying to 1
  99.   end if
  100.   if soundBusy(1) then
  101.     sound fadeOut 1, fadeDuration
  102.   end if
  103.   if soundBusy(2) then
  104.     sound fadeOut 2, fadeDuration
  105.   end if
  106.   if lPlaying then
  107.     waitForTicks(fadeDuration)
  108.   end if
  109. end
  110.