Have button trigger random audio file - possible?


I'm looking to have a button trigger an audio file randomly selected from a set of mp3s.

I.e., there are 10 sound files, a through j, and when you click the button, one of those 10 files plays based on random selection.

I'd also like this action to trigger a layer to show while the audio is playing, then hide again upon completion.

Is it possible to have a button trigger a randomly selected audio file like this?



1 Reply
Ashley Terwilliger

Hi Ryan,

I haven't seen something like that, but I would suspect you'll either need to set up a random variable generation first (something like in this thread or this one), and based on that variable it would trigger the audio. That, or some Javascript which I'm not equipped to offer advice on.