Controlling the volume of the video
You can control the volume for the dynamically loaded video by setting the soundTransform property on the NetStream object. The video jukebox application allows you to modify the volume level by changing the value of the volumeSlider Slider instance. The following code shows how you can change the volume level by assigning the value of the Slider component to a SoundTransform object which is set to the soundTransform property on the NetStream object:

private function volumeChangeHandler(event:SliderEvent):void
{
    volumeTransform.volume = event.value;
    ns.soundTransform = volumeTransform;
}

Cheers,
Craig Taylor



On May 8, 2008, at 3:57 PM, waynelll wrote:

HI!!

I am playing a FLV file in a VideoDisplay called bigVid.

Here is the code. Standard cookbook stuff

presentNetCon = new NetConnection();
presentNetCon.connect(null);    
presentStream = new NetStream(presentNetCon);   
presentStream.play(videoClip);
presentVideo = new Video();     
presentVideo.attachNetStream(presentStream);

bigVid.addChild(presentVideo);

The problem is that no matter what I do I can't change the volume.

I have tried to change the NetStream soundTransform volume but no luck.

presentStream.soundTransform.volume = 0;

I have tried to change the VideoDisplay.soundTransform.volume but no luck.

bigVid.soundTransform.volume = 0;

I have tried to change the the VideoDisplay.volume but no luck.

bigVid.volume = 0;

When I play the FLV without adding it as a child to the VideoDisplay ,
no video but the audio plays fine, I can control the volume, but once
I add the Video to the VideoDisplay
bigVid.addChild(presentVideo);

I can no longer control the audio.

Any ideas??

Thanks

WAYNEL




Reply via email to