FORUMS: list search recent posts

mute bg sound while not muting video in flvplayback

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
neshoi aban
mute bg sound while not muting video in flvplayback
on Nov 9, 2010 at 11:56:12 am

There's a bg sound in the whole timeline, but there's a video page where I put flvplayback to hold the videos, so far I used stopallsounds on the buttons that will show the videos, and it mutes the sounds in video too,

how will I do it where the bg sound will mute or stop while it doesnt affect the sounds in the videos


Return to posts index

demetri tashie
Re: mute bg sound while not muting video in flvplayback
on Nov 9, 2010 at 6:25:06 pm

first of all, it really depends on how your background sound is playing.

ideally it should be played through a SoundChannel. then, your videoplay button can be scripted to stop the sound channel from playing, and also begin the video. SoundMixer.stopAll should not be a first line of defense to quit sounds.

here is some code to get you started. the video player's name is "flvPlayer" and the play button is "playButton"

var sound:Sound = new Sound();
var sc:SoundChannel = new SoundChannel();
sound.load(new URLRequest("myMP3.mp3"));
sc =sound.play();

playButton.addEventListener(MouseEvent.CLICK, stopAndPlaySounds);
function stopAndPlaySounds(e:MouseEvent):void{
sc.stop();
flvPlayer.play();
}

flvPlayer.source="myFLV.flv";
flvPlayer.autoPlay=false;


just be careful if you are using a timeline, not to reference something ( the "flvPlayer" ) before it is on the stage.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]