home *** CD-ROM | disk | FTP | other *** search
/ Star Trek Starfleet Academy Mini Omnipedia / MINI_OMNI.ISO / pc / bl / 11vidwn.dir / 00025.ls < prev    next >
Encoding:
Text File  |  1995-06-19  |  4.4 KB  |  180 lines

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