home *** CD-ROM | disk | FTP | other *** search
/ Boot Disc 2 / boot-disc-1996-10.iso / Lip.dir / 00019_Script_PrimaryMovieScriptForLip < prev    next >
Text File  |  1996-08-09  |  10KB  |  335 lines

  1. global videosprite,videolist
  2.  
  3. on startmovie
  4.   set videosprite=9
  5.   set the visible of sprite videosprite to false
  6.   set the volume of sprite videosprite to 255
  7.   set videoList=["selker1","selker2","selker3","selker4","selker5"]
  8.   deactivatePlay
  9.   put " " into field "Status"
  10.   set the actorlist=[]
  11.   new(script "StatusClass")
  12. end
  13.  
  14. on stop movie
  15.   resetpuppets
  16.   set the actorlist=[]
  17. end
  18.  
  19. on activatePlay
  20.   set the visible of sprite videosprite to true
  21.   set spritenum=castsprite("ctrlBtns_Play")
  22.   if spritenum=0 then exit
  23.   set stopsprite=castsprite("ctrlBtns_StopDown")
  24.   puppetsprite spritenum,true
  25.   set the membernum of sprite spritenum=the number of member "ctrlBtns_PlayDown"
  26.   if stopsprite<>0 then
  27.     puppetsprite stopsprite,true
  28.     set the membernum of sprite stopsprite=the number of member "ctrlBtns_Stop"
  29.   end if
  30.   updateStage
  31.   set the movieRate of sprite videosprite to 1.0    
  32. end
  33.  
  34. on deactivatePlay
  35.   set the movieRate of sprite videosprite to 0.0
  36.   set stopsprite=castsprite("ctrlBtns_Stop")
  37.   if stopsprite=0 then exit
  38.   puppetsprite stopsprite,true
  39.   set the membernum of sprite stopsprite to the number of member "ctrlBtns_StopDown"
  40.   updateStage
  41.   set spritenum=castsprite("ctrlBtns_PlayDown")
  42.   if spritenum=0 then exit
  43.   puppetsprite spritenum,true
  44.   set the membernum of sprite spritenum=the number of member "ctrlBtns_Play"
  45.   updateStage
  46. end
  47.  
  48. on fastsearch delta
  49.   set spritenum=the clickon
  50.   puppetsprite spritenum,true
  51.   set curcast=the membernum of sprite spritenum
  52.   set castname=the name of cast curcast
  53.   set curdown=the membernum of member (castname&"Down")
  54.   set the membernum of sprite spritenum to curdown
  55.   updateStage
  56.   set oldrate=the movieRate of sprite videosprite
  57.   set the movieRate of sprite videosprite to delta*5.0
  58.   repeat while the mousedown
  59.   end repeat
  60.   set the membernum of sprite spritenum to curcast
  61.   updateStage
  62.   set the movieRate of sprite videosprite to oldRate
  63. end
  64.  
  65. on slowsearch delta
  66.   set spritenum=the clickon
  67.   puppetsprite spritenum,true
  68.   set curcast=the membernum of sprite spritenum
  69.   set castname=the name of cast curcast
  70.   set curdown=the membernum of member (castname&"Down")
  71.   set the membernum of sprite spritenum to curdown
  72.   updateStage
  73.   set oldrate=the movieRate of sprite videosprite
  74.   set the movieRate of sprite videosprite to delta*0.3
  75.   repeat while the mousedown
  76.   end repeat
  77.   set the membernum of sprite spritenum to curcast
  78.   updateStage
  79.   set the movieRate of sprite videosprite to oldRate
  80. end
  81.  
  82. on setvideo time
  83.   if time=#start then set time=0
  84.   if time=#end then
  85.     set time=the duration of member (the membernum of sprite videosprite)
  86.   end if
  87.   set the movietime of sprite videosprite to time
  88. end
  89.  
  90. on setVsoundpos castname,minpos,maxpos,orient
  91.   set spritenum=castsprite(castname)
  92.   puppetsprite spritenum,true
  93.   set pos=maxpos-(the volume of sprite videosprite)*(maxpos-minpos)/255
  94.   if orient=#vert then
  95.     set the locV of sprite spritenum to pos
  96.   else
  97.     set the locH of sprite spritenum to pos
  98.   end if
  99.   updateStage
  100. end
  101.  
  102. on setVSoundval minpos,maxpos,orient
  103.   set spritenum=the clickon
  104.   puppetsprite spritenum,true
  105.   set upcast=(the membernum of sprite spritenum)
  106.   set basename=the name of member upcast
  107.   set downcast=the number of member (basename&"Down")
  108.   set the membernum of sprite spritenum to downcast
  109.   if orient=#vert then
  110.     set delta=the mouseV-the locV of sprite spritenum
  111.   else
  112.     set delta=the mouseH-the locH of sprite spritenum
  113.   end if
  114.   repeat while the mousedown
  115.     if orient=#vert then
  116.       set the locV of sprite spritenum to min(max(the mouseV-delta,minpos),maxpos)
  117.     else
  118.       set the locH of sprite spritenum to min(max(the mouseH-delta,minpos),maxpos)
  119.     end if
  120.     updateStage
  121.     if orient=#vert then
  122.       set the volume of sprite videosprite to 255-min(max(integer((the locV of sprite spritenum)-minpos)*256/(maxpos-minpos),0),255)
  123.     else
  124.       set the volume of sprite videosprite to 255-min(max(integer((the locH of sprite spritenum)-minpos)*256/(maxpos-minpos),0),255)
  125.     end if
  126.     --    global gStatus
  127.     --    setBtnText gStatus,basename&"Down","The volume is "&getat(soundlist,the soundlevel+1)
  128.   end repeat
  129.   set the membernum of sprite spritenum to upcast
  130.   updateStage
  131. end
  132.  
  133. on isVideoDone
  134.   if the movieTime of sprite videosprite>=trackstoptime(member (the castnum of sprite videosprite),1) then
  135.     deactivatePlay
  136.     playNextVideo
  137.   end if
  138. end
  139.  
  140. on playNextVideo
  141.   set the movieRate of sprite videosprite to 0
  142.   set the movieTime of sprite videosprite to 0
  143. end
  144. on pressbtn
  145.   set spritenum=the clickon
  146.   set upcast=the membernum of sprite spritenum
  147.   set downcastname=the name of member (upcast)&"down"
  148.   set downcast=the number of member (downcastname)
  149.   puppetsprite spritenum,1
  150.   set the membernum of sprite spritenum to downcast
  151.   updatestage
  152.   repeat while the mousedown
  153.   end repeat
  154.   set the membernum of sprite spritenum to upcast
  155.   updateStage
  156.   puppetsprite spritenum,false
  157.   return rollover(spritenum)
  158. end
  159.  
  160. on setpuppets startpuppet,endpuppet,state
  161.   repeat with spritenum=startpuppet to endpuppet
  162.     puppetsprite spritenum,state
  163.   end repeat
  164. end
  165.  
  166. on getObj objname
  167.   set oldDelimiter=the itemDelimiter
  168.   set the itemDelimiter=quote
  169.   set foundobj=0
  170.   repeat with obj in the actorlist
  171.     if item 2 of string(obj)=objname then
  172.       set foundobj=obj
  173.       exit repeat
  174.     end if
  175.   end repeat
  176.   set the itemDelimiter=oldDelimiter
  177.   return foundobj
  178. end
  179. on makeDescr startcast,endcast,prefix
  180.   repeat with index=startcast to endcast
  181.     set text=the text of member index
  182.     set the name of member index to prefix&(line 1 of text)
  183.   end repeat
  184. end
  185.  
  186. on getDrive
  187.   set drive=the moviepath
  188.   set oldDelimiter=the itemdelimiter
  189.   set the itemdelimiter=":"
  190.   set drive=(item 1 of drive)&":"
  191.   set the itemdelimiter=oldDelimiter
  192.   return drive
  193. end
  194.  
  195.  
  196.  
  197. on numbercast startcast,endcast,startval
  198.   if voidP(startval) then set startval=1
  199.   repeat with curcast=startcast to endcast
  200.     set the name of member curcast to (the name of member curcast)&(startval+curcast-startcast)
  201.   end repeat
  202. end
  203.  
  204. on setsoundpos castname,minpos,maxpos,orient
  205.   set spritenum=castsprite(castname)
  206.   puppetsprite spritenum,true
  207.   set pos=maxpos-(the soundlevel)*(maxpos-minpos)/7
  208.   if orient=#vert then
  209.     set the locV of sprite spritenum to pos
  210.   else
  211.     set the locH of sprite spritenum to pos
  212.   end if
  213.   updateStage
  214. end
  215.  
  216. on setSoundval minpos,maxpos,orient
  217.   set spritenum=the clickon
  218.   set soundlist=["mute","barely audible","very quiet","quiet","moderate","medium loud","loud","loudest"]
  219.   puppetsprite spritenum,true
  220.   set upcast=(the membernum of sprite spritenum)
  221.   set basename=the name of member upcast
  222.   set downcast=the number of member (basename&"Down")
  223.   set the membernum of sprite spritenum to downcast
  224.   repeat while the mousedown
  225.     if orient=#vert then
  226.       set the locV of sprite spritenum to min(max(the mouseV,minpos),maxpos)
  227.     else
  228.       set the locH of sprite spritenum to min(max(the mouseH,minpos),maxpos)
  229.     end if
  230.     updateStage
  231.     if orient=#vert then
  232.       set the soundlevel=7-min(max(integer((the locV of sprite spritenum)-minpos)*8/(maxpos-minpos),0),7)
  233.     else
  234.       set the soundlevel=7-min(max(integer((the locH of sprite spritenum)-minpos)*8/(maxpos-minpos),0),7)
  235.     end if
  236.     global gStatus
  237.     setBtnText gStatus,basename&"Down","The volume is "&getat(soundlist,the soundlevel+1)
  238.     puppetsound "LED05.AIF"
  239.   end repeat
  240.   set the membernum of sprite spritenum to upcast
  241.   updateStage
  242. end
  243.  
  244. on castsprite castname
  245.   set spritenum=0
  246.   repeat with index=1 to 48
  247.     if the membernum of sprite index>0 then
  248.       if the name of member (the membernum of sprite index)=castname then
  249.         set spritenum=index
  250.         exit repeat
  251.       end if
  252.     end if
  253.   end repeat
  254.   return spritenum
  255. end
  256.  
  257. on resetpuppets
  258.   repeat with spritenum=1 to 48
  259.     if the castnum of sprite spritenum>0 then
  260.       if the puppet of sprite spritenum then
  261.         set the puppet of sprite spritenum to false
  262.       end if
  263.     end if
  264.     set the visible of sprite spritenum to true
  265.   end repeat
  266. end
  267.  
  268. on launchMovie moviename,whichbtn
  269.   global moviebtnlist
  270.   if moviebtnlist=0 then
  271.     set moviebtnlist=[]
  272.     set moviebtn1=castsprite("LipTopic")
  273.     add moviebtnlist,moviebtn1
  274.     repeat with spritenum=moviebtn1+1 to 48
  275.       if the castnum of sprite spritenum>0 then
  276.         if the name of member (the membernum of sprite spritenum)="LipTopic" then
  277.           add moviebtnlist,spritenum
  278.         end if
  279.       end if
  280.     end repeat
  281.   end if
  282.   if voidP(whichbtn) then
  283.     set whichsprite=the clickon
  284.   else
  285.     set whichsprite=getat(moviebtnlist,whichbtn)
  286.   end if
  287.   if not getbasepath() then exit
  288.   repeat with index=1 to count(moviebtnlist)
  289.     set spritenum=getat(moviebtnlist,index)
  290.     if not (the puppet of sprite spritenum) then
  291.       set the puppet of sprite spritenum to true
  292.     end if
  293.     if spritenum=whichsprite then
  294.       set the membernum of sprite spritenum to the number of member "LipTopicDown"
  295.     else
  296.       set the membernum of sprite spritenum to the number of member "LipTopic"
  297.     end if
  298.   end repeat
  299.   updateStage
  300.   set the filename of member (the membernum of sprite videosprite) to getBasePath()&moviename&string(getpos(moviebtnlist,whichsprite))&".avi"
  301.   activateplay
  302. end
  303.  
  304. on getBasePath
  305.   repeat with index=3 to 27
  306.     set drive=numtochar(64+index)
  307.     if fileExists(drive&":\bootcd\keylock.rsc") then
  308.       exit repeat
  309.     end if
  310.   end repeat
  311.   if drive=numtochar(91) then
  312.     alert("The bootCD was not found.  Please insert it into your disk drive to launch any applications.")
  313.     return false
  314.   end if
  315.   set basepath=drive&":\bootcd\movies\"
  316.   return basepath
  317. end
  318.  
  319. on fileExists filename
  320.   set file=fileIO(mNew,"read",filename)
  321.   if objectP(file) then
  322.     file(mDispose)
  323.     return true
  324.   else
  325.     return false
  326.   end if
  327. end
  328.  
  329. on wait numseconds
  330.   startTimer
  331.   repeat while the timer<numseconds*60
  332.     if the mousedown then exit repeat
  333.   end repeat
  334. end
  335.