How to stop duplicate music playing?

For questions about using Classic.

Post » Thu Jul 30, 2009 11:28 pm

When I go to a different part of the menu on my game, and go back, the game automatically plays the song again, even though I don't want this. Any way to fix it? I don't like hearing 2 of the same track playing.
B
2
G
4
Posts: 16
Reputation: 1,082

Post » Fri Jul 31, 2009 2:06 am

Is the menu in a different layout? My guess is your song is set to play in the startup event in the layout? What behavior do you want? Do you want to pause the song or stop the song entirely and not play it when you return from the menu?

Either way you should be able to set a global variable that indicates that the song has already been played and then check it during startup. I'd need more details to say exactly what to do beyond that.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Fri Jul 31, 2009 3:33 am

you could also make XAudio a global object, this would only allow one music playing at any given time
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Fri Jul 31, 2009 4:50 am

Yes, what Madster said... ;-) My description was practically gibberish.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: Google [Bot] and 7 guests