Skip to main content
Participating Frequently
September 6, 2007
Question

Controling volume of timeline streamed audio

  • September 6, 2007
  • 4 replies
  • 345 views

I have audio that is streamed into the main timeline of a movie clip. I'm trying to control the volume with a slider but having some problems with it. I can control the volume of audio that I attach from my library. But this one needs to have the audio streamed into the timeline because it is synched to some other animations.

How can I control the volume like this? I have no way of giving an instance name to the audio because it's on the timline where I need it to be?

Thanks for any help with this!
This topic has been closed for replies.

4 replies

Inspiring
September 7, 2007
no problems - you're welcome
Inspiring
September 7, 2007
You don't need the onEnterFrame.. that's just for demonstrating that it works.

Just you the s.setVolume(value)
D370_2Author
Participating Frequently
September 7, 2007
GWD,

Your code is perfecto!!! Works like a charm!!!

Thanks!!!
Inspiring
September 7, 2007
I just tried this with a sound on the timeline and it worked.

var s:Sound = new Sound()
this.onEnterFrame = function() {
var a=s.getVolume()
if (a>0) s.setVolume(a-1);

}
D370_2Author
Participating Frequently
September 7, 2007
I did some more research on this last night. Mostly all resources just use the attachSound function which isn't going to work for me on this project. I have animations that need to be synched with the audio so that's why the audio is placed on the timeline and set to stream. But I still need to control the volume. How do I do this when the audio is on the timeline and not attached with a var/ or instance name?

Thanks!