Hello,
I’m well and truely stuck. Using the following code to attach the audio of a netstream to an mc to enable volume control:
private function init():Void{
netCon = new NetConnection();
netCon.connect(null);
netStr = new NetStream(netCon);
netStr.setBufferTime(buffer);
container.screen_mc.attachVideo(netStr);
setAudio();
}
private function setAudio():Void{
var myClip:MovieClip =
container.createEmptyMovieClip("audio_mc", container.getNextHighestDepth());
myClip.attachAudio(netStr);
audio = new Sound(myClip);
audio.setVolume(0);
trace(audio.getVolume);//Traces as 0, but actual volume unchanged
}
If I use the code as above declaring the audio var above the constructor like so:
[LEFT]private var audio:Sound;
The trace will show the volume has changed, but the actual volume is uneffected.
However if I declare the audio var locally within the setAudio function, it works fine (but I can’t access audio from outside the function (which is the whole point).
[LEFT]
var audio:Sound = new Sound(myClip);
[/LEFT]
I’m well and truely stuck. Tried using this.audio, but no difference.
[/LEFT]