Sequencing the playing of sounds via players
Posted: Sun Feb 14, 2010 8:12 pm
Hello,
I'm trying to upgrade some simple code to get rid of the evil "wait" command, and I thought I'd use it to learn about using the "send" system.
My old code:
My new approach, using the send command, looks like this:
This works great for the first two players ("knock" and "knockAgain"), but it doesn't work for the variable knockResponse (no sound plays) -- presumably because Rev is looking for a player that's actually named "knockResponse."
So my questions:
1) Am I approaching this in a good way, using the send command? Are there better ways to approach the sequencing of player playback?
2) Are there different ways to send the "start player" message? I tried -- send "start" to player "knock" -- but that didn't work.
3) Is there a way to include / use the variable name in the send command, so that I can vary the knockResponse sound that actually gets played, based on the value of the button?
Thanks, as always!
DougN
I'm trying to upgrade some simple code to get rid of the evil "wait" command, and I thought I'd use it to learn about using the "send" system.
My old code:
Code: Select all
global knockResponse -- set with a pull-down menu on the card
on mouseup
start player "knock"
wait 2 seconds
start player "knockAgain"
wait 4 seconds
start player knockResponse -- where knockResponse is a variable
end mouseup
Code: Select all
global knockResponse -- set with a pull-down menu on the card
on mouseup
start player "knock"
send "start player knockAgain" to me in 2 seconds
send "start player knockResponse" to me in 6 seconds -- where knockResponse is a variable
end mouseup
So my questions:
1) Am I approaching this in a good way, using the send command? Are there better ways to approach the sequencing of player playback?
2) Are there different ways to send the "start player" message? I tried -- send "start" to player "knock" -- but that didn't work.
3) Is there a way to include / use the variable name in the send command, so that I can vary the knockResponse sound that actually gets played, based on the value of the button?
Thanks, as always!
DougN