onemaxone Posted April 15, 2017 Share Posted April 15, 2017 Hi I have built an app in Phaser and want to create a sequence of two sounds: 1. "You have" (loaded and stored as audioSound[0]) 2. "Finished" (ditto, audioSound[1]) I can then keep re-using 1 and have different words/sentences in 2. To do this I need the sounds to play in sequence. At the moment using: audioSound[0].play(); audioSound[1].play(); othercode... Plays both at the same time. Any ideas on how to get the sounds to play in sequence and only continue to `othercode...` once the second one has finished? Thanks in advance! Link to comment Share on other sites More sharing options...
squilibob Posted April 16, 2017 Share Posted April 16, 2017 You should be able to use the onStop signal audioSound[0] .play() .onStop.add(audioSound[1].play, this); othercode... If you're going to reuse the first sound for other things then you can consider adding a property to it that will indicate which sound will be played next so you can just change that property instead of having to remove and re-add new onStop events to your first sound. Link to comment Share on other sites More sharing options...
onemaxone Posted April 20, 2017 Author Share Posted April 20, 2017 Thanks for this - works perfectly! Link to comment Share on other sites More sharing options...
Recommended Posts