Skip to main content
Participating Frequently
March 8, 2010
Question

AS2 Independent volume control of sound object and streaming audio

  • March 8, 2010
  • 1 reply
  • 3315 views

I've got a presentation that features an audio loop for background music and streaming audio on the timeline for the voice over.

When I try to lower the volume of the background music (sound object), it also effects the voice over (streaming).

I'm a total novice, so try to use laymen's terms

This is on Frame 1:

snd = new Sound(myLoopMC);
snd.attachSound("myLoop01");

onLoad = function () {
    snd.start(0,5);
};
n = 0;
snd.setVolume(n);

And this is on the Frame that contains the movieclip with the voice over.  I'm trying to fade the background music ONLY:

onEnterFrame = function () {
    n += -1;
    if (n<=10) {
        n = 10;
    }
    snd.setVolume(n);
};

stop();

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
March 9, 2010

if your other sound object is NOT attached to myLoopMC, you can control the sounds independently.

witwormAuthor
Participating Frequently
March 9, 2010

Thanks for your response, kglad.

One is a sound object and the other is a streaming sound on the timeline.  Yet, when I reduce the sound of the sound object, the streaming volume also decreases.  Doesn't make sense to me.  I'm using snd.setVolume(n); which should target the object defined as 'snd'.

kglad
Community Expert
Community Expert
March 9, 2010

is the streaming sound on myLoopMC's timeline?

if yes, using a different movieclip to in your new Sound() constructor.