home *** CD-ROM | disk | FTP | other *** search
- on finalUpdate
- repeat with i = 1 to the number of cast "SHARED" - 1
- set tmpName to the fileName of cast i
- set cType to the castType of cast i
- set cName to the name of cast i
- if length(tmpName) > 0 then
- if cType <> #digitalVideo then
- set cScript to the scriptText of cast i
- if (cType = #bitmap) or (cType = #picture) then
- set cPalette to the palette of cast i
- puppetPalette(cPalette)
- end if
- importFileInto(cast i, tmpName)
- set the scriptText of cast i to cScript
- set the name of cast i to cName
- if (cType = #bitmap) or (cType = #picture) then
- set the palette of cast i to cPalette
- end if
- set nType to the castType of cast i
- if nType <> cType then
- put "*** Import failed cast " & i & tmpName
- else
- put "Imported " & tmpName & " into cast #" & i
- end if
- end if
- next repeat
- end if
- if (i mod 100) = 0 then
- put i
- end if
- end repeat
- put "finished"
- puppetPalette(0)
- end
-
- on animate snd, chan, startCast, castCnt, fps, pic
- puppetSprite(chan, 1)
- if snd <> EMPTY then
- puppetSound(snd)
- end if
- set nTicks to 60 / fps
- set first to the number of cast startCast
- set last to the number of cast startCast + abs(castCnt) - 1
- if castCnt >= 0 then
- repeat with n = first to last
- set start to the ticks
- set the castNum of sprite chan to n
- updateStage()
- repeat while (the ticks - start) < nTicks
- end repeat
- end repeat
- else
- repeat with n = last down to first
- set start to the ticks
- set the castNum of sprite chan to n
- updateStage()
- repeat while (the ticks - start) < nTicks
- end repeat
- end repeat
- end if
- if pic <> EMPTY then
- set the castNum of sprite chan to the number of cast pic
- updateStage()
- end if
- end
-
- on buttonPress snd, chan, onCast, offCast
- if snd <> EMPTY then
- puppetSound(snd)
- end if
- puppetSprite(chan, 1)
- set the castNum of sprite chan to the number of cast onCast
- updateStage()
- repeat while the mouseDown
- end repeat
- set the castNum of sprite chan to the number of cast offCast
- updateStage()
- end
-
- on delay cnt
- set start to the ticks
- repeat while (the ticks - start) < cnt
- end repeat
- end
-