Looping in quicktime movies

Ken Ray kray at sonsothunder.com
Sun Jul 2 00:35:22 EDT 2006


> Can someone suggest a good way of making a quicktime movie play continuously
> back and forth rather than starting from the beginning with each loop? This
> would be useful in creating a realistic continuous water wave motion that does
> not loop and jerk back to the beginning of the movie when the movie ends.

You could start the player object playing, then test to see when you reach
the end and then set the playRate to -1 to play it backwards, then test for
the beginning, set it back to 1, etc.

Try this:

on mouseUp
  set the playrate of player 1 to 1
  play player 1
  CheckPlayer
end mouseUp

on CheckPlayer
  if the playRate of player 1 is 1 then
    if the currentTime of player 1 is (the duration of player 1) then
      set the playRate of player 1 to -1
      play player 1
    end if
  else
    if the currentTime of player 1 is 0 then
      set the playRate of player 1 to 1
      play player 1
    end if
  end if
  if the optionKey is not down then  -- when you want it to stop
    send "CheckPlayer" to me in 100 milliseconds
  end if
end CheckPlayer


Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/






More information about the use-livecode mailing list