home *** CD-ROM | disk | FTP | other *** search
/ Boot Disc 2 / boot-disc-1996-10.iso / bootcd.dir / 00266_Script_MainMovieScript < prev    next >
Text File  |  1996-08-09  |  4KB  |  137 lines

  1. on startMovie
  2.   set the actorlist=[]
  3.   setpuppets 1,48,false
  4.   new(script "StatusClass")
  5.   openxlib "FileIO"
  6. end
  7.  
  8. on stopMovie
  9.   if the runMode="Author" then
  10.     set the updatemovieenabled to true
  11.   else
  12.     set the updatemovieenabled to false
  13.   end if
  14. end
  15.  
  16. on pressbtn
  17.   set spritenum=the clickon
  18.   set upcast=the membernum of sprite spritenum
  19.   set downcastname=the name of member (upcast)&"down"
  20.   set downcast=the number of member (downcastname)
  21.   puppetsprite spritenum,1
  22.   set the membernum of sprite spritenum to downcast
  23.   updatestage
  24.   repeat while the mousedown
  25.   end repeat
  26.   set the membernum of sprite spritenum to upcast
  27.   updateStage
  28.   puppetsprite spritenum,false
  29.   return rollover(spritenum)
  30. end
  31.  
  32. on setpuppets startpuppet,endpuppet,state
  33.   repeat with spritenum=startpuppet to endpuppet
  34.     puppetsprite spritenum,state
  35.   end repeat
  36. end
  37.  
  38. on getObj objname
  39.   set oldDelimiter=the itemDelimiter
  40.   set the itemDelimiter=quote
  41.   set foundobj=0
  42.   repeat with obj in the actorlist
  43.     if item 2 of string(obj)=objname then
  44.       set foundobj=obj
  45.       exit repeat
  46.     end if
  47.   end repeat
  48.   set the itemDelimiter=oldDelimiter
  49.   return foundobj
  50. end
  51. on makeDescr startcast,endcast,prefix
  52.   repeat with index=startcast to endcast
  53.     set text=the text of member index
  54.     set the name of member index to prefix&(line 1 of text)
  55.   end repeat
  56. end
  57.  
  58. on getDrive
  59.   set drive=the moviepath
  60.   set oldDelimiter=the itemdelimiter
  61.   set the itemdelimiter=":"
  62.   set drive=(item 1 of drive)&":"
  63.   set the itemdelimiter=oldDelimiter
  64.   return drive
  65. end
  66.  
  67. on numbercast startcast,endcast,startval
  68.   if voidP(startval) then set startval=1
  69.   repeat with curcast=startcast to endcast
  70.     set the name of member curcast to (the name of member curcast)&(startval+curcast-startcast)
  71.   end repeat
  72. end
  73.  
  74. on setsoundpos castname,minpos,maxpos,orient
  75.   set spritenum=castsprite(castname)
  76.   puppetsprite spritenum,true
  77.   set pos=maxpos-(the soundlevel)*(maxpos-minpos)/7
  78.   if orient=#vert then
  79.     set the locV of sprite spritenum to pos
  80.   else
  81.     set the locH of sprite spritenum to pos
  82.   end if
  83.   updateStage
  84. end
  85.  
  86. on setSoundval minpos,maxpos,orient
  87.   set spritenum=the clickon
  88.   set soundlist=["mute","barely audible","very quiet","quiet","moderate","medium loud","loud","loudest"]
  89.   puppetsprite spritenum,true
  90.   set upcast=(the membernum of sprite spritenum)
  91.   set basename=the name of member upcast
  92.   set downcast=the number of member (basename&"Down")
  93.   set the membernum of sprite spritenum to downcast
  94.   repeat while the mousedown
  95.     if orient=#vert then
  96.       set the locV of sprite spritenum to min(max(the mouseV,minpos),maxpos)
  97.     else
  98.       set the locH of sprite spritenum to min(max(the mouseH,minpos),maxpos)
  99.     end if
  100.     updateStage
  101.     if orient=#vert then
  102.       set the soundlevel=7-min(max(integer((the locV of sprite spritenum)-minpos)*8/(maxpos-minpos),0),7)
  103.     else
  104.       set the soundlevel=7-min(max(integer((the locH of sprite spritenum)-minpos)*8/(maxpos-minpos),0),7)
  105.     end if
  106.     global gStatus
  107.     setBtnText gStatus,basename&"Down","The volume is "&getat(soundlist,the soundlevel+1)
  108.     puppetsound "LED05.AIF"
  109.   end repeat
  110.   set the membernum of sprite spritenum to upcast
  111.   updateStage
  112. end
  113.  
  114. on castsprite castname
  115.   set spritenum=0
  116.   repeat with index=1 to 48
  117.     if the membernum of sprite index>0 then
  118.       if the name of member (the membernum of sprite index)=castname then
  119.         set spritenum=index
  120.         exit repeat
  121.       end if
  122.     end if
  123.   end repeat
  124.   return spritenum
  125. end
  126.  
  127. on resetpuppets
  128.   repeat with spritenum=1 to 48
  129.     if the castnum of sprite spritenum>0 then
  130.       if the puppet of sprite spritenum then
  131.         set the puppet of sprite spritenum to false
  132.       end if
  133.     end if
  134.     set the visible of sprite spritenum to true
  135.   end repeat
  136. end
  137.