home *** CD-ROM | disk | FTP | other *** search
/ Boot Disc 2 / boot-disc-1996-10.iso / Multimed.dir / 00059_Script_59 < prev    next >
Text File  |  1996-08-09  |  5KB  |  174 lines

  1. on startmovie
  2.   resetAllText
  3. end
  4.  
  5.  
  6. on scroll delta,prefix
  7.   if voidP(prefix) then set prefix="d_"
  8.   set btnsprite=the clickon
  9.   set btn=the membernum of sprite btnsprite
  10.   set btndown=the number of member ((the name of member btn)&"Down")
  11.   puppetsprite btnsprite,true
  12.   set the membernum of sprite btnsprite to btndown
  13.   updateStage
  14.   repeat with index=1 to 48
  15.     set curcast=the membernum of sprite index
  16.     if curcast>0 then
  17.       if offset("d_",the name of member curcast)=1 then
  18.         set spritenum=index
  19.         exit repeat
  20.       end if
  21.     end if
  22.   end repeat
  23.   set pos=the scrolltop of member curcast
  24.   set textwidth=the bottom of sprite spritenum-the top of sprite spritenum
  25.   set totalheight=the height of member curcast
  26.   repeat while the mousedown
  27.   if the rightMouseDown then
  28.     set mult=5
  29.   else
  30.     set mult=1
  31.   end if
  32.     if delta>0 then
  33.       set pos=min(pos+delta*Mult,totalheight-textwidth)
  34.     else
  35.       set pos=max(pos+delta*mult,0)
  36.     end if
  37.     set the scrolltop of member curcast to pos
  38.   end repeat
  39.   set the membernum of sprite btnsprite to btn
  40.   updateStage
  41.   puppetsprite btnsprite,false
  42. end
  43.  
  44. on resetAllText prefix
  45.   if voidP(prefix) then set prefix="d_"
  46.   repeat with index=1 to the number of members
  47.     if the type of member index=#richText then
  48.       set the scrolltop of member index to 0
  49.     end if
  50.   end repeat
  51. end
  52.  
  53. on pressbtn
  54.   set spritenum=the clickon
  55.   set upcast=the membernum of sprite spritenum
  56.   set downcastname=the name of member (upcast)&"down"
  57.   set downcast=the number of member (downcastname)
  58.   puppetsprite spritenum,1
  59.   set the membernum of sprite spritenum to downcast
  60.   updatestage
  61.   repeat while the mousedown
  62.   end repeat
  63.   set the membernum of sprite spritenum to upcast
  64.   updateStage
  65.   puppetsprite spritenum,false
  66.   return rollover(spritenum)
  67. end
  68.  
  69. on setpuppets startpuppet,endpuppet,state
  70.   repeat with spritenum=startpuppet to endpuppet
  71.     puppetsprite spritenum,state
  72.   end repeat
  73. end
  74.  
  75. on getObj objname
  76.   set oldDelimiter=the itemDelimiter
  77.   set the itemDelimiter=quote
  78.   set foundobj=0
  79.   repeat with obj in the actorlist
  80.     if item 2 of string(obj)=objname then
  81.       set foundobj=obj
  82.       exit repeat
  83.     end if
  84.   end repeat
  85.   set the itemDelimiter=oldDelimiter
  86.   return foundobj
  87. end
  88. on makeDescr startcast,endcast,prefix
  89.   repeat with index=startcast to endcast
  90.     set text=the text of member index
  91.     set the name of member index to prefix&(line 1 of text)
  92.   end repeat
  93. end
  94.  
  95. on getDrive
  96.   set drive=the moviepath
  97.   set oldDelimiter=the itemdelimiter
  98.   set the itemdelimiter=":"
  99.   set drive=(item 1 of drive)&":"
  100.   set the itemdelimiter=oldDelimiter
  101.   return drive
  102. end
  103.  
  104. on numbercast startcast,endcast,startval
  105.   if voidP(startval) then set startval=1
  106.   repeat with curcast=startcast to endcast
  107.     set the name of member curcast to (the name of member curcast)&(startval+curcast-startcast)
  108.   end repeat
  109. end
  110.  
  111. on setsoundpos castname,minpos,maxpos,orient
  112.   set spritenum=castsprite(castname)
  113.   puppetsprite spritenum,true
  114.   set pos=maxpos-(the soundlevel)*(maxpos-minpos)/7
  115.   if orient=#vert then
  116.     set the locV of sprite spritenum to pos
  117.   else
  118.     set the locH of sprite spritenum to pos
  119.   end if
  120.   updateStage
  121. end
  122.  
  123. on setSoundval minpos,maxpos,orient
  124.   set spritenum=the clickon
  125.   set soundlist=["mute","barely audible","very quiet","quiet","moderate","medium loud","loud","loudest"]
  126.   puppetsprite spritenum,true
  127.   set upcast=(the membernum of sprite spritenum)
  128.   set basename=the name of member upcast
  129.   set downcast=the number of member (basename&"Down")
  130.   set the membernum of sprite spritenum to downcast
  131.   repeat while the mousedown
  132.     if orient=#vert then
  133.       set the locV of sprite spritenum to min(max(the mouseV,minpos),maxpos)
  134.     else
  135.       set the locH of sprite spritenum to min(max(the mouseH,minpos),maxpos)
  136.     end if
  137.     updateStage
  138.     if orient=#vert then
  139.       set the soundlevel=7-min(max(integer((the locV of sprite spritenum)-minpos)*8/(maxpos-minpos),0),7)
  140.     else
  141.       set the soundlevel=7-min(max(integer((the locH of sprite spritenum)-minpos)*8/(maxpos-minpos),0),7)
  142.     end if
  143.     global gStatus
  144.     setBtnText gStatus,basename&"Down","The volume is "&getat(soundlist,the soundlevel+1)
  145.     puppetsound "LED05.AIF"
  146.   end repeat
  147.   set the membernum of sprite spritenum to upcast
  148.   updateStage
  149. end
  150.  
  151. on castsprite castname
  152.   set spritenum=0
  153.   repeat with index=1 to 48
  154.     if the membernum of sprite index>0 then
  155.       if the name of member (the membernum of sprite index)=castname then
  156.         set spritenum=index
  157.         exit repeat
  158.       end if
  159.     end if
  160.   end repeat
  161.   return spritenum
  162. end
  163.  
  164. on resetpuppets
  165.   repeat with spritenum=1 to 48
  166.     if the castnum of sprite spritenum>0 then
  167.       if the puppet of sprite spritenum then
  168.         set the puppet of sprite spritenum to false
  169.       end if
  170.     end if
  171.     set the visible of sprite spritenum to true
  172.   end repeat
  173. end
  174.