This content has been marked as final.
Show 2 replies
-
1. Re: How can I store the latest member of a random list?
SeanWilson Feb 11, 2014 9:52 PM (in response to Marta_dPE)Try the following (attached to your "speaker" sprite):
global newsoundlist property myCounter property mySoundList on beginSprite me mySoundlist = ["sound1", "sound2", "sound3", "sound4", "sound5"] myCounter = 0 end on mouseUp() if myCounter = 0 then -- first click, choose the sound to play vRandom = random(5) vPlay = mySoundlist[vRandom] newsoundlist = [vPlay] end if myCounter = myCounter + 1 if myCounter < 4 then -- sound available only for 3 times sound(1).play(member(newsoundlist[1])) else sound(1).stop() _player.alert("Sound no longer available") end if end mouseUp -
2. Re: How can I store the latest member of a random list?
Marta_dPE Feb 12, 2014 1:00 AM (in response to SeanWilson)Hi Sean,
many thanks for your post, it works as i need!!

