I have this script placed at the root level:
backgroundAudio=new Sound();
backgroundAudio.attachSound(“movieAudio”);
backgroundAudioVolume=40;
_root.backgroundAudio.setVolume(backgroundAudioVolume);
_root.backgroundAudio.start(0,99999);
and this script placed on a volume up button:
on (release) {
backgroundAudioVolume++;
_root.backgroundAudio.setVolume(backgroundAudioVolume);
}
It works, but there’s one problem, when the volume up button is released and the volume increases by one unit, it does so from the beginning, resetting the backgroundAudioVolume to 0 and then increasing. How can I avoid this?