Thanks Scott,

Here is the workaround I did:
on openStack
 play ac "sound1.wav"
 send "mouseDoubleUp" to image "bigPlay" in 8 seconds
end openStack

in the script of image "bigPlay" I have:
on mouseDoubleUp
 play ac "sound2.wav"
end mouseDoubleUp

also in the script of image "bigPlay" I have
on mouseUp
 (do a bunch of other stuff too)
 stop playing ac "sound1.wav"
 stop playing ac "sound2.wav"
end mouseUp

What really BUGS me about LiveCode is that the documentation (example, wait with messages) is SO sketchy, that you cannot figure out how to use it. I'm constantly wasting my time fighting something that doesn't work and then ending up having to do a workaround as shown above.

And as an FYI in case you ever run into this: I imported a folder of audio files and LC inexplicably made my "bigPlay" image disappear - even when it says "visible" in the property inspector, is in the top layer and blendlevel is 0. After fighting that twice, I went back and had to import each audio file individually. Note that I'm using 6.1.1 (rc 4) on XP.

Anyway, thanks for the code below. I may end up using it somewhere sometime.
Larry


----- Original Message ----- From: "Scott Rossi" <sc...@tactilemedia.com>
To: "LiveCode Mail List" <use-livecode@lists.runrev.com>
Sent: Thursday, May 01, 2014 11:10 AM
Subject: Re: wait with messages


Hi Larry:

This is probably a situation where wait with messages will not work.  If
you want to cancel sound 2 independently of sound 1, the second sound
needs to have its own play message so it can be canceled separately.  This
is why I originally suggested the possibility of using a loop script or
similar.

You might try something like this (watch line wrap):

# PLAY SOUND 1
on openStack
  play ac "sound1.wav"
  send "playBack2" to me in 8 seconds
end openStack

# PLAY SOUND 2
command playBack2
  play ac "sound2.wav" looping
end playBack2

# CANCEL PLAYBACK OF SOUND 2
# BEFORE OR AFTER PLAYBACK HAS STARTED
command cancelPlayBack2
  cancel item 1 of line lineOffset("playBack2",pendingMessages()) of
pendingMessages()
  play stop
end cancelPlayBack2


Now, any control that user can press to cancel the playback of sound 2
needs to include a call to the above "cancelPlayBack2" command in its
script.  Note that this will also stop playback of any imported sound due
to the "play stop".


Regards,

Scott Rossi
Creative Director
Tactile Media, UX/UI Design




On 5/1/14 8:54 AM, "la...@significantplanet.org"
<la...@significantplanet.org> wrote:

I have a splash screen and want to play 2 sounds in it, but allow the
user to leave as soon as he/she wishes.

This was my previous code and it worked fine:

play audioclip "Sound1.wav"

wait 8 seconds

play audioclip "Sound2.wav" looping

the problem with the above code is that the "wait" command meant that the
user could not click on the button to go to the main screen until the 8
seconds was up.

and this is my new code:

play audioclip "Sound1.wav"

wait 8 seconds with messages

play audioclip "Sound2.wav" looping

the problem with the new code is this:

IF the user clicks on the button (to go to the main screen) AFTER the 8
seconds, then everything works fine - as it always did

but IF the user clicks on the button DURING the 8 seconds, then
everything goes completely CUCKOO!!

So, the only difference in the expected result and the cuckoo result is
that I added "with messages"

Therefore, I am assuming that I need to so something with messages if the
user clicks during the 8 seconds, but I have no idea what to do.

TIA for any help

Larry
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to