home *** CD-ROM | disk | FTP | other *** search
/ Reflux 1: The Becoming / Reflux.iso / shared.dxr / 00465.ls < prev    next >
Encoding:
Text File  |  1995-05-01  |  2.3 KB  |  85 lines

  1. on finalUpdate
  2.   repeat with i = 1 to the number of cast "SHARED" - 1
  3.     set tmpName to the fileName of cast i
  4.     set cType to the castType of cast i
  5.     set cName to the name of cast i
  6.     if length(tmpName) > 0 then
  7.       if cType <> #digitalVideo then
  8.         set cScript to the scriptText of cast i
  9.         if (cType = #bitmap) or (cType = #picture) then
  10.           set cPalette to the palette of cast i
  11.           puppetPalette(cPalette)
  12.         end if
  13.         importFileInto(cast i, tmpName)
  14.         set the scriptText of cast i to cScript
  15.         set the name of cast i to cName
  16.         if (cType = #bitmap) or (cType = #picture) then
  17.           set the palette of cast i to cPalette
  18.         end if
  19.         set nType to the castType of cast i
  20.         if nType <> cType then
  21.           put "*** Import failed cast " & i & tmpName
  22.         else
  23.           put "Imported " & tmpName & " into cast #" & i
  24.         end if
  25.       end if
  26.       next repeat
  27.     end if
  28.     if (i mod 100) = 0 then
  29.       put i
  30.     end if
  31.   end repeat
  32.   put "finished"
  33.   puppetPalette(0)
  34. end
  35.  
  36. on animate snd, chan, startCast, castCnt, fps, pic
  37.   puppetSprite(chan, 1)
  38.   if snd <> EMPTY then
  39.     puppetSound(snd)
  40.   end if
  41.   set nTicks to 60 / fps
  42.   set first to the number of cast startCast
  43.   set last to the number of cast startCast + abs(castCnt) - 1
  44.   if castCnt >= 0 then
  45.     repeat with n = first to last
  46.       set start to the ticks
  47.       set the castNum of sprite chan to n
  48.       updateStage()
  49.       repeat while (the ticks - start) < nTicks
  50.       end repeat
  51.     end repeat
  52.   else
  53.     repeat with n = last down to first
  54.       set start to the ticks
  55.       set the castNum of sprite chan to n
  56.       updateStage()
  57.       repeat while (the ticks - start) < nTicks
  58.       end repeat
  59.     end repeat
  60.   end if
  61.   if pic <> EMPTY then
  62.     set the castNum of sprite chan to the number of cast pic
  63.     updateStage()
  64.   end if
  65. end
  66.  
  67. on buttonPress snd, chan, onCast, offCast
  68.   if snd <> EMPTY then
  69.     puppetSound(snd)
  70.   end if
  71.   puppetSprite(chan, 1)
  72.   set the castNum of sprite chan to the number of cast onCast
  73.   updateStage()
  74.   repeat while the mouseDown
  75.   end repeat
  76.   set the castNum of sprite chan to the number of cast offCast
  77.   updateStage()
  78. end
  79.  
  80. on delay cnt
  81.   set start to the ticks
  82.   repeat while (the ticks - start) < cnt
  83.   end repeat
  84. end
  85.