You are on page 1of 2

stop();

vdeo.stop();
playBtn.addEventListener(MouseEvent.CLICK, fl_ClickToPlayVideo);
function fl_ClickToPlayVideo(event:MouseEvent):void
{
vdeo.play();
}
pauseBtn.addEventListener(MouseEvent.CLICK, fl_ClickToPauseVideo);
function fl_ClickToPauseVideo(event:MouseEvent):void
{
vdeo.stop();
}
stopBtn.addEventListener(MouseEvent.CLICK, fl_ClickToStopVideo);
function fl_ClickToStopVideo(event:MouseEvent):void
{
vdeo.gotoAndStop(1);
}
function setMute(vol)//for whole flash
{
var mySound:SoundTransform = new SoundTransform(1,0);
mySound.volume = vol; SoundMixer.soundTransform = mySound;
}
var Mute:Boolean = false;
muteLogo.visible = false;
muteLogo.mouseEnabled = false;
InstanceNameHere.addEventListener (MouseEvent.CLICK,toggleMuteBtn);
function toggleMuteBtn(event:Event)
{
if(Mute)
{
Mute = false; setMute(1);
muteLogo.visible = false;
}
else
{
Mute = true; setMute(0);
muteLogo.visible = true;
}
}
----------------------------------------
import flash.media.Sound
import flash.net.URLRequest;
stop();
SoundMixer.stopAll();
playBtn.addEventListener(MouseEvent.CLICK, fl_ClickToPlayStopSound);
var fl_SC:SoundChannel;
var fl_ToPlay:Boolean = true;
var pausePosition:int;
stopBtn.addEventListener(MouseEvent.CLICK, fl_ClickToStopAllSounds);
function fl_ClickToStopAllSounds(event:MouseEvent):void
{
fl_ToPlay = true;
pausePosition = 0;
SoundMixer.stopAll();
}
function fl_ClickToPlayStopSound(event:MouseEvent):void
{
if(fl_ToPlay)
{
var s:Sound = new Sound(new URLRequest("one thing.mp3"));
fl_SC = s.play(pausePosition);
//fl_SC = s.play();
}
else
{
pausePosition = fl_SC.position;
fl_SC.stop();

}
fl_ToPlay = !fl_ToPlay;
}

You might also like