views:

102

answers:

2

I have something like this:

private var myVideo:Video;
public var videoDisplay:UIComponent;
...
videoDisplay.addChild(myVideo);
...
nsPlay = new NetStream(nc);
nsPlay.addEventListener(NetStatusEvent.NET_STATUS, nsPlayOnStatus);
nsPlay.bufferTime = 0;
nsPlay.play(pro);
myVideo.attachNetStream(nsPlay);

anybody knows how can I change the volume of this stream, I would like to bind the volume to a slider

+1  A: 

Use the NetStream::SoundTransform property.

nsPlay.soundTransform.volume = slider.value;

To bind the value of slider to the volume:

BindingUtils.bindProperty(nsPlay.soundTransform, "volume", slider, "value");

Set the slider range as 0 to 1

Amarghosh
+1  A: 

Use the property soundTransform of the NetStream Object:

var st:SoundTransform=nsPlay.soundTransform;
st.volume=0.5; // 50% volume
nsPlay=st;
Patrick