home *** CD-ROM | disk | FTP | other *** search
/ Star Trek Starfleet Academy Mini Omnipedia / MINI_OMNI.ISO / pc / bl / 11vidwnw.dir / 00025.ls < prev    next >
Encoding:
Text File  |  1995-07-25  |  4.8 KB  |  200 lines

  1. global gActiveWin, gWinType, gNewCaption, gAssetPath, gPDL, gTheName, gTheNewWinht, gTheNewWinwd, gMovieIncr, gWinListNum, gMyWinTracker, gtheLockList, gtheSearchWord, gtheWord, gImageList, gTheVidTime, gSliderIncr, gtheNewIncr, gTheTime, gSliderMin, gSliderMax, gCurrentlyPlayingMovie, gStylingNeedF, gStylingStillNeeded, gStylingSuspended
  2.  
  3. on startMovie
  4.   setAt(gImageList, gWinListNum, gTheName)
  5.   setAt(gMyWinTracker, gWinListNum, 1)
  6.   setAt(gtheLockList, gWinListNum, 0)
  7.   set the volume of sprite 9 to 255
  8.   puppetSprite(4, 1)
  9.   set gStylingSuspended to 0
  10.   set vTrekCursor to the number of cast "trekcursFG"
  11.   cursor([vTrekCursor, vTrekCursor + 1])
  12. end
  13.  
  14. on hSetBlankCast
  15.   set the fileName of cast "BlankQ.MOV" to the pathName & "BL" & gPDL & "BlankQ.MOV"
  16. end
  17.  
  18. on closeWindow
  19.   hQTPause()
  20.   updateStage()
  21.   forget(window string(getaProp(gMyWinList, 11)))
  22.   setAt(gImageList, 11, EMPTY)
  23.   setAt(gMyWinList, 11, EMPTY)
  24.   setAt(gMyWinTracker, 11, 0)
  25.   setAt(gtheLockList, 11, 0)
  26.   clearpuppets()
  27. end
  28.  
  29. on hDisplayVideo
  30.   hGettheQT()
  31.   hgetCaption()
  32. end
  33.  
  34. on hGettheQT
  35.   set LFirstChar to char 1 of string(gTheName)
  36.   set gPath to gAssetPath
  37.   set the fileName of cast "BlankQ.MOV" to gPath & LFirstChar & gPDL & gTheName & "1Q.MOV"
  38.   set gTheVidTime to the duration of cast "BlankQ.MOV"
  39.   put "the video length is " & gTheVidTime && "ticks"
  40.   set gSliderIncr to 201.0 / (gTheVidTime + 0.0)
  41.   set gMovieIncr to (gTheVidTime + 0.0) / 201.0
  42.   set gSliderMin to the left of sprite 3 + 3
  43.   set gSliderMax to the right of sprite 3 - 3
  44.   put "the Control Increment is" && gSliderIncr
  45.   set gtheNewIncr to gSliderIncr
  46. end
  47.  
  48. on hgetCaption
  49.   set the text of field "caption" to string(gNewCaption)
  50. end
  51.  
  52. on hWatchVideo
  53.   if the locH of sprite 4 = gSliderMax then
  54.     go(the frame)
  55.     exit
  56.   end if
  57.   set gTheTime to the movieTime of sprite 9
  58.   set the locH of sprite 4 to gSliderMin + (gTheTime * gSliderIncr)
  59.   go(the frame)
  60. end
  61.  
  62. on hLockMe
  63.   if getaProp(gtheLockList, 11) = 0 then
  64.     puppetSprite(7, 1)
  65.     set the castNum of sprite 7 to the number of cast (the castNum of sprite 7 + 1)
  66.     updateStage()
  67.     setAt(gtheLockList, 11, 1)
  68.   else
  69.     puppetSprite(7, 0)
  70.     updateStage()
  71.     setAt(gtheLockList, 11, 0)
  72.   end if
  73. end
  74.  
  75. on hReWind
  76.   hQTPause()
  77.   if the locH of sprite 4 = gSliderMin then
  78.     exit
  79.   end if
  80.   set the locH of sprite 4 to gSliderMin
  81.   puppetSprite(12, 0)
  82.   puppetSprite(13, 0)
  83.   updateStage()
  84.   puppetSprite(11, 1)
  85.   set the castNum of sprite 11 to the number of cast (the castNum of sprite 11 + 1)
  86.   updateStage()
  87.   hSetTheHead()
  88.   hQTGo()
  89. end
  90.  
  91. on hPlayQT
  92.   puppetSprite(11, 0)
  93.   puppetSprite(13, 0)
  94.   updateStage()
  95.   puppetSprite(12, 1)
  96.   set the castNum of sprite 12 to the number of cast "PlayButton" + 1
  97.   updateStage()
  98.   hQTGo()
  99. end
  100.  
  101. on hStopQT
  102.   if the movieRate of sprite 9 = 0 then
  103.     exit
  104.   end if
  105.   puppetSprite(11, 0)
  106.   puppetSprite(12, 0)
  107.   updateStage()
  108.   puppetSprite(13, 1)
  109.   set the castNum of sprite 13 to the number of cast (the castNum of sprite 13 + 1)
  110.   updateStage()
  111.   hQTPause()
  112. end
  113.  
  114. on hSuspendStyling
  115.   if gStylingSuspended = 0 then
  116.     set gStylingStillNeeded to gStylingNeedF
  117.     set gStylingSuspended to 1
  118.     tell the stage
  119.       do("hSetStylingNeed 0")
  120.     end tell
  121.   end if
  122. end
  123.  
  124. on hResumeStyling
  125.   if gStylingSuspended = 1 then
  126.     if gStylingStillNeeded = 1 then
  127.       tell the stage
  128.         do("hSetStylingNeed 1")
  129.       end tell
  130.       set gStylingSuspended to 0
  131.     end if
  132.   end if
  133. end
  134.  
  135. on hQTGo
  136.   set gCurrentlyPlayingMovie to the moviePath & the movieName
  137.   tell the stage
  138.     do(" hWinVoiceSuspend")
  139.   end tell
  140.   hSuspendStyling()
  141.   set the movieRate of sprite 9 to 1
  142. end
  143.  
  144. on hQTPause
  145.   set the movieRate of sprite 9 to 0
  146.   tell the stage
  147.     do("hWinVoiceResume")
  148.   end tell
  149.   hResumeStyling()
  150.   set gCurrentlyPlayingMovie to EMPTY
  151. end
  152.  
  153. on hSlideTheHead
  154.   set the movieRate of sprite 9 to 0
  155.   set the constraint of sprite 4 to 2
  156.   repeat while the stillDown
  157.     set the locH of sprite 4 to the mouseH
  158.     updateStage()
  159.     set the movieTime of sprite 9 to gMovieIncr * (the mouseH - gSliderMin)
  160.     set the mouseUpScript to "hSetTheHead"
  161.   end repeat
  162. end
  163.  
  164. on hSetTheHead
  165.   hPlayQT()
  166.   if the locH of sprite 4 > 244 then
  167.     set the locH of sprite 4 to 245
  168.   end if
  169.   set LtheNewLocH to the locH of sprite 4
  170.   set the movieTime of sprite 9 to (LtheNewLocH - gSliderMin) * gMovieIncr
  171.   hQTGo()
  172.   set the mouseUpScript to "nothing"
  173. end
  174.  
  175. on hGetWord
  176.   global gtheWord
  177.   set x to the mouseCast
  178.   set y to the mouseWord
  179.   if (x > 0) and (y > 0) then
  180.     set gtheWord to word y of field x
  181.     tell the stage
  182.       hFindCaptionWord()
  183.     end tell
  184.   end if
  185. end
  186.  
  187. on clearpuppets
  188.   repeat with x = 1 to 24
  189.     puppetSprite(x, 0)
  190.   end repeat
  191. end
  192.  
  193. on activateWindow
  194.   if gActiveWin <> (the pathName & the movieName) then
  195.     set the windowType of window string(gActiveWin) to 2
  196.     set gActiveWin to the pathName & the movieName
  197.     set the windowType of window string(gActiveWin) to gWinType
  198.   end if
  199. end
  200.