home *** CD-ROM | disk | FTP | other *** search
/ MacFormat España 24 / MacFormat n. 24 (Spain) / MacFormat 24.bin / Demos / Jungle Activated! / JungleActivated Demo / jung DEMO d / 00065_Common Handlers.ls < prev    next >
Encoding:
Text File  |  1996-10-14  |  2.7 KB  |  96 lines

  1. on PlayBackTrack
  2.   global gBackgroundSound, gBackgroundVolume
  3.   set the volume of sound 2 to gBackgroundVolume
  4.   if soundBusy(2) = 0 then
  5.     sound playFile 2, getpn() & "Sounds:Bckgrd" & gBackgroundSound & ".aif"
  6.   end if
  7. end
  8.  
  9. on StudioSoundPopUp WhichSprite
  10.   set LeftLoc to the locH of sprite WhichSprite + (the width of sprite WhichSprite / 2) - 47
  11.   set TopLoc to the locV of sprite WhichSprite + (the height of sprite WhichSprite / 2) - 59
  12.   set RightLoc to the locH of sprite WhichSprite + (the width of sprite WhichSprite / 2) + 47
  13.   set BottomLoc to the locV of sprite WhichSprite + (the height of sprite WhichSprite / 2) + 61
  14.   set the rect of window "Stdsound.dir" to rect(LeftLoc, TopLoc, RightLoc, BottomLoc)
  15.   set LeftOrigin to the stageLeft
  16.   set TopOrigin to the stageTop
  17.   set the rect of window "Stdsound.dir" to rect(LeftOrigin + LeftLoc, TopOrigin + TopLoc, LeftOrigin + RightLoc, TopOrigin + BottomLoc)
  18.   set the windowType of window "Stdsound.dir" to 2
  19.   open(window "Stdsound.dir")
  20. end
  21.  
  22. on PlayMovie whichChannel, ReturnTo
  23.   if the movieTime of sprite whichChannel > 0 then
  24.     sound fadeOut 1, 120
  25.     set the volume of sound 1 to 0
  26.     sound fadeOut 2, 120
  27.     set the volume of sound 2 to 0
  28.   end if
  29.   if the movieTime of sprite whichChannel = the stopTime of sprite whichChannel then
  30.     go(ReturnTo)
  31.   end if
  32. end
  33.  
  34. on SmallPreload
  35.   global gMemorySize
  36.   if the preLoad of cast 15 = 0 then
  37.     preLoadCast(1, 15)
  38.   end if
  39.   preLoad("Let it Flow", label("Coming From") + 1)
  40. end
  41.  
  42. on BigPreload
  43.   global gMemorySize
  44.   if the preLoad of cast 30 = 0 then
  45.     preLoadCast(1, 30)
  46.   end if
  47.   preLoad("Let it Flow", label("Coming From") + 1)
  48. end
  49.  
  50. on GoStudioVideos WhichTrack
  51.   global gWhereFrom
  52.   set gWhereFrom to the frameLabel
  53.   repeat with i = 29 to 35
  54.     set the visible of sprite i to 0
  55.   end repeat
  56.   sound stop 2
  57.   go(WhichTrack)
  58. end
  59.  
  60. on OpenFillScreen
  61.   global gBackDrop
  62.   openXLib(getpn() & "RearWindow.XObj")
  63.   set red to 1500
  64.   set green to 1500
  65.   set Blue to 1500
  66.   if objectp(gBackDrop) then
  67.     gBackDrop(mdispose)
  68.   end if
  69.   set gBackDrop to RearWindow(mnew, "M")
  70.   set resultCode to gBackDrop(mRGBColorToWindow, red, green, Blue)
  71. end
  72.  
  73. on closeFillScreen
  74.   global gBackDrop
  75.   if objectp(gBackDrop) then
  76.     gBackDrop(mdispose)
  77.   end if
  78. end
  79.  
  80. on undoLoop
  81.   global gLastLoop, gWhichSound3, gWhichSound4, gWhichSound5, gWhichSound6, gWhichSound7, gWhichSound8, gWhichSound9, gWhichSound10
  82.   if gLastLoop > 0 then
  83.     set the foreColor of sprite (gLastLoop + 4) to 255
  84.     set gWhichSound3 to EMPTY
  85.     set gWhichSound4 to EMPTY
  86.     set gWhichSound5 to EMPTY
  87.     set gWhichSound6 to EMPTY
  88.     set gWhichSound7 to EMPTY
  89.     set gWhichSound8 to EMPTY
  90.     set gWhichSound9 to EMPTY
  91.     set gWhichSound10 to EMPTY
  92.     sound stop gLastLoop
  93.     set gLastLoop to 0
  94.   end if
  95. end
  96.