How to mute the flv on start up?
I'm trying to work on a AS3 file with a video in it开发者_Python百科. Can someone please teach me how to have the flv muted on start up?
So far I have this script:
import flash.events.*;
import fl.video.*;
//-----------------
// Video control assignment
//-----------------
display.playPauseButton = skin_mc.play_btn;
display.stopButton = skin_mc.stop_btn;
display.seekBar = skin_mc.seek_bar;
display.muteButton = skin_mc.mute_btn;
There's no actual mute property, volume
is simply toggled between 0 and what it was prior to muting. So to have the volume "muted" on startup:
video.volume = 0;
Here's some code for a button that toggles mute on/off:
display.muteButton.addEventListener(MouseEvent.CLICK, _muteToggle);
function _muteToggle(e:MouseEvent):void
{
display.volume = display.volume == 1 ? 0 : 1;
MovieClip(e.target).gotoAndStop(display.volume+1);
}
This will stop the mute button on frame 1 if it's mute and frame 2 if it's not. It will have to be a MovieClip to work, not a Button.
精彩评论