Well, your script is working fine, but it doesn't work in my case
The problem is that I use the background music in the scene property for the looping sound ambiance (rain, etc).
Why? Because I don't use it for the music. In order to have dynamc music as explained before, I am using the action to play a sound.
Here basically is the action script I use:
I create a random value named "choice" that goes between 1 and 3 because I have 3 musics
I create a random value called "random_music" with a value between 20 and 60 (because I want the music to stop randomly between 20 and 60 seconds)
if value "choice" = 1
play sound landing.ogg
wait until sound landing.ogg is finished
pause (for "random_music" seconds)
jump to action part #1
end if
if value "choice" = 2
play sound stinger1.ogg
wait until sound stinger1.ogg is finished
pause (for "random_music" seconds)
jump to action part #1
end if
if value "choice" = 3
play sound stinger2.ogg
wait until sound stinger2.ogg is finished
pause (for "random_music" seconds)
jump to action part #1
end if
This script is working very well, but it is not using the background music channel. And the problem is that the music is stopped everytime I change of scene
Maybe I can put the music again in the background music property and use your script, then I could use this action script to play the ambiant sound. There would still be a pause between each scene though.