1
我有这个循环flv视频,我有一个随机电影,是在电影运行时播放。我需要当我玩其他电影shaker
被禁用,或停止随机循环。谢谢删除计时器事件
ns.addEventListener(NetStatusEvent.NET_STATUS, NCListener);
function NCListener(e:NetStatusEvent){
if (e.info.code == "NetStream.Play.Stop") {
ns.play("video_2.flv");
shaker(null);
}
};
addEventListener(Event.COMPLETE,shaker);
function shaker (event:Event):void{
var mcArray:Array = [loader.button_01_mc,loader.button_02_mc,loader.button_03_mc,loader.button_04_mc,loader.button_05_mc];
var clipTimer:Timer = new Timer(4000);
clipTimer.addEventListener(TimerEvent.TIMER, playClips);
function playClips(event:TimerEvent):void{
var i:Number=Math.floor(Math.random() * mcArray.length);
var movieClipToEdit:MovieClip=mcArray[i] as MovieClip;
movieClipToEdit.gotoAndPlay (1);
}
clipTimer.start();
}
loader.button_01.addEventListener(MouseEvent.CLICK, play_video_01);
loader.button_01.addEventListener(MouseEvent.ROLL_OVER, play_effect_01);
function play_video_01 (event:MouseEvent){
ns.play("video_3.flv");
loader.button_01_mc.gotoAndPlay (41);
它的工作就是这样。但是,当我播放video_3.flv并等待它结束时启动video_2.flv。当video_2.flv播放时,有2个随机的电影剪辑从'mcArray'播放。在另一个周期后,有3个电影剪辑播放? – Kircho
,你想要停止?或只有一个人玩?让它停止你所要做的就是:把clipTimer.stop();在ns.play(“video_2.flv”)之前;在相同的功能里面。要获得只有一个播放:你想创建一个var refCurrent:MovieClip之外的playClips函数和内部检查,看看refCurrent.currentFrame == refCurrent.totalFrames之前告诉新的movieClipToEdit播放和不要忘记存储refCurrent声明中的movieClipToEdit。 – bnns
我只需要一个人玩。你可以把它作为代码请给它。谢谢。 – Kircho