Page 1 of 1
Want to check more than 1 checkbox.
Posted: Tue Feb 12, 2013 4:16 am
by abanowBUSTfGf
I have four checkboxes and want to be able to check more than one. If I do this the
system responds as if only the last one is checked. How can I get around this.
Thanks.
Re: Want to check more than 1 checkbox.
Posted: Tue Feb 12, 2013 4:21 am
by sturgis
Are they checkboxes or radio buttons? If they're checkboxes they should all be checkable individually. If they're radio buttons, and in a group, only 1 can be selected at a time. If they're outside a group (or in different groups) they can be selected individually. If you're using radio buttons inside a group and you wish them to behave separately, open the property inspector for the group and take the check out of the radioBehavior button. (might be called something slightly different depending on your preferences)
If you're speaking of checkboxes, and they aren't behaving as expected, can you explain how you set them up (in a group, out of group, what scripts are involved) so that its easier to help?
Re: Want to check more than 1 checkbox.
Posted: Tue Feb 12, 2013 7:39 am
by abanowBUSTfGf
Hi, thanks, what I've done is set up 4 checkboxes (not grouped) and want to perform a sound the boxes have
been checked. What I'm getting is only 1 sound even if I click 2 or more boxes. The script is
if the hilite of button "EnglishLang"is true then
put specialFolderPath("engine") & "/soundwavs/Bell.mp3" into tSndPath
play tSndPath
end if
if the hilite of button "FrenchLang" is true then
put specialFolderPath("engine") & "/soundwavs/Bugle.mp3" into tSndPath
play tSndPath
end if
if the hilite of button "SpanishLang" is true then
put specialFolderPath("engine") & "/soundwavs/Bird.mp3" into tSndPath
play tSndPath
end if
if the hilite of button "IndonesianLang" is true then
put specialFolderPath("engine") & "/soundwavs/Banjo.mp3" into tSndPath
play tSndPath
end if
Regards
Re: Want to check more than 1 checkbox.
Posted: Tue Feb 12, 2013 10:25 am
by Simon
Hi,
Are you asking to play Bell and Bugle at the same time? Or any combinations of your sounds?
Because that is what you've asked, but not what you coded.
Simon
Re: Want to check more than 1 checkbox.
Posted: Tue Feb 12, 2013 11:57 am
by abanowBUSTfGf
Hi Simon yes I want all the selected sounds to play in sequence
But somehow they don't - just 1 plays
Re: Want to check more than 1 checkbox.
Posted: Tue Feb 12, 2013 12:42 pm
by Klaus
Still no look into the "Release Notes"?
----------------------------------------------------------
play soundFile [ looping ]
Executing such a command will first stop any currently playing sound, and then attempt to load the given sound file.
----------------------------------------------------------
"play" will one play ONE sound at a time, and that is the reason why you will only hear one sound and that is the one
of the last checked checkbox!
You could "collect" all sounds in a list, "queue" them and then use "mobilePlaySoundOnChannel sound, channel, type"
to play them one after another.
Re: Want to check more than 1 checkbox.
Posted: Wed Feb 13, 2013 6:11 am
by abanowBUSTfGf
I am new to Livecode. What is the easiest way to play four MP3 sound files one after the next
perhaps with a 1second interval between them?
The sounds as follows play fine individually:
put specialFolderPath("engine") & "/soundwavs/Bird.mp3" into tSndPath
play tSndPath
put specialFolderPath("engine") & "/soundwavs/Cat.mp3" into tSndPath
play tSndPath
put specialFolderPath("engine") & "/soundwavs/Dog.mp3" into tSndPath
play tSndPath
put specialFolderPath("engine") & "/soundwavs/Elephant.mp3" into tSndPath
play tSndPath
but I can't get them to run in sequence.
Thanks
Re: Want to check more than 1 checkbox.
Posted: Wed Feb 13, 2013 6:49 am
by Simon
You just need the playStopped message.
Simon
Re: Want to check more than 1 checkbox.
Posted: Wed Feb 13, 2013 1:09 pm
by Klaus
The answer can be found in the "Android/iOS Release Notes" under "Basic sound playback support"!
Code: Select all
...
repeat for each item tSound in "Bird.mp1,Cat.mp2,Toad.mp3,Dodo.mp4,Archeopterix.mp5"
put specialFolderPath("engine") & "/soundwavs/" & tSound) into tSndPath
play tSndPath
## !!!
wait until the sound = "done"
end repeat
...
Did I mention already that the "Release Notes" are better than their reputation?

So it is not a bad idea to look up one thing or another there...