playing filmLoops


[ Zettels Traum ] [ search / suche ]

von dp am 28.Maerz 97 um 15:55:51:

zu: Perlen aus dem Strom der Nachrichten im direct_L von Daniel am 22.Dezember 96 um 02:00:59:

Here's the "new & improved" version for multiple filmloops:

-- frame script "playFilmloopOnce"

property frameCounter, nFrames

on exitFrame me
if not objectP(me) then return exitFrame(script the frameScript)
if voidP(frameCounter) then set frameCounter = 0


set frameCounter = frameCounter + 1
if frameCounter >= nFrames then
init me
go the frame + 1
else
go the frame
end if
end

on init me, totalFrames
-- reset the frameCounter & set the number of frames in the filmloop
-- e.g. call this on startMovie or when exiting filmloop before it is finished


set frameCounter = value(void)


if voidP(totalFrames) then
set nFrame = value(void)
else
set nFrames = totalFrames
end if
end

-- Before entering the frame, or at startMovie:

init(script "playFilmloopOnce", 42) -- play frames 1 to 42 of the filmloop

-- To exit a filmloop before it is finished:

init(script "playFilmloopOnce")
go the frame + 1


The previous version had a problem if the filmloop is at the last frame - it'd loop an extra frame. This version makes sure it advances to another frame. If you wish to have the filmloop hold on the last frame (of the filmloop) and the filmloop is at the last frame of the movie, you'd have to change the exitFrame handler to this:

on exitFrame me
if not objectP(me) then return exitFrame(script the frameScript)
if voidP(frameCounter) then set frameCounter = 1


set frameCounter = frameCounter + 1
if frameCounter < nFrames then
go the frame
else
init me
end if
end


Dave Yang



Dazu:























D. Plänitz