Playing players in sequence

Greg Wills gwills at ozemail.com.au
Fri May 10 07:19:01 EDT 2002


Thanks Rick for your suggestion to time each movie to wait until one 
movie is done before the next plays, eg "wait 230" etc. I had started 
off here, but each of the clips will be different lengths (and maybe 
many of them).

Thanks Klaus for the
switch the_player
     case "sound 1"
         start player "sound 2"
         break
     case "sound 2"
         start player "sound 2"
         break
end switch

  . . . solution. I could not get this to work, but I put it down to 
my lack of knowledge of the switch, case structure. (I could not find 
the correct form/word for the the_player. I tried a number of options 
but could not get it to work.)


Thanks Kurt for the;

on playstopped
play videoclip "sound2"
end playstopped

to go in sound2 player's script, etc, etc.

As I understand this situation, playstopped is sent to the card 
script. This being the case, I put this (above) script into the card 
script. The problem being, once the first clip is played (from a card 
button), the playstopped message is sent to the card, which plays the 
next clip, which sends the playstopped script to the card, which then 
loops and can't stop and plays the same clip over and over.


Below is what I have ended up with. This works fine, but I would be 
interested to have any feedback on a more efficient (or different) 
solution.

A card button starts the process with;
on mouseUp
   global bagged
   put empty into bagged
   play player "the"
end mouseUp



The card script captures the playstopped message and plays each 
player only once;
on playstopped
   global bagged
   add 1 to bagged
   wait 10 -- just to give a pause between words/clips
   if bagged = 1 then baggedOne
   if bagged = 2 then baggedTwo
   if bagged = 3 then baggedThree
   if bagged = 4 then baggedFour
   if bagged = 5 then baggedFive
end playstopped

on baggedOne
   play player "cat"
   add 1 to bagged
end baggedOne

on baggedTwo
   play player "sat"
   add 1 to bagged
end baggedTwo

   . . .  etc, etc

end baggedFive

Thanks again everyone for your help.

Greg



More information about the use-livecode mailing list