Hello everyone, i am having problems with stopping my main background music on the menu screen. The music starts when the scene loads up and i want the music to stop once i click the button to go to the next scene but the music just keep playing. I have looked at the audio tutorial but it does not show how to stop a sound so i looked up threads on here and saw that someone else had this same issue so i tried the things that were stated there but none of it is working. Can anybody help me with this? Thanks.
Can't get audio to stop when loading up the next scene.
Capital J Productionz May 9th, 2016
All 3 Comments
Gio May 9th, 2016
Hi
Not sure what you've tried, but this is how I normally do it...
When I play a long sound, e.g. some background music, I store a reference to it in the wade.app object, so it remains accessible from everywhere.
wade.app.soundtrack = wade.playAudio('soundtrack.ogg');
Then when it's time to stop the music (so before loading the next scene):
wade.stopAudio(wade.app.soundtrack);
Does this work for you?
Capital J Productionz May 10th, 2016
Thanks for responding Gio, where can i find wade.app object? Or do you mean a particular object that i have on the scene?
Capital J Productionz May 10th, 2016
Nevermind, i figured it out... Thanks for all your help Gio.
Post a reply
Add Attachment
Submit Reply
Login to Reply