简体   繁体   English

在Flash as3中播放视频后,使影片剪辑可重新单击

[英]Making a movie clip re-clickable after a video has played in flash as3

So I am trying to build a platform where from a menu type page, a user can click a movieclip to watch a video, then after its finished, the video disappears and then they can click another movieclip and this starts another video. 因此,我正在尝试构建一个平台,在该平台上,用户可以单击动画片段以观看视频,然后在完成后视频消失,然后可以单击另一个动画片段并开始另一个视频。

Whenever you watch one video though, all that you can click after the video is finished, is the same movieclip to start it again, you cannot click a different movie clip. 但是,无论何时观看一个视频,在完成视频后您可以单击的全部都是相同的动画片段以再次开始播放,因此您无法单击其他电影剪辑。

How do I make the other movie clips which start the other videos discoverable? 如何使开始播放其他视频的其他影片剪辑变得可发现? do i need to add a new eventListener that references the other movie clips, and put that within all of the movie clips? 我是否需要添加新的事件监听引用其它影片剪辑,并把该范围内的所有影片剪辑?

Here is what my code looks like for one of my movie clips 这是我的一个影片剪辑的代码外观

taffrail_click_play_mc.addEventListener(MouseEvent.MOUSE_DOWN, showTaffrailMovieBox);
taffrail_text_mc.addEventListener(MouseEvent.MOUSE_DOWN, showTaffrailMovieBox);

function showTaffrailMovieBox(e:MouseEvent):void
{

    MovieClip(root).taffrail_movie_mc.visible=true; 
    var myTaffTween = new Tween(MovieClip(root).taffrail_movie_mc, "alpha", Strong.easeIn, 0, 1, 1, true);

    var taffVideo:FLVPlayback = new FLVPlayback();
    var myTaffTween1 = new Tween(taffVideo, "alpha", Strong.easeIn, 0, 1, 1, true);
    taffVideo.source = "Wildlife.flv";
    addChild(taffVideo);
    taffVideo.play("Wildlife.flv");

    var cuePt:Object = new Object(); //create cue point object 
    cuePt.time = 3; 
    cuePt.name = "ASpt1"; 
    cuePt.type = "actionscript"; 

    taffVideo.addASCuePoint(cuePt);
    taffVideo.addEventListener(MetadataEvent.CUE_POINT, taff_vid_close);

    function taff_vid_close(eventObject:MetadataEvent):void { 
        var myTaffTween2 = new Tween(taffVideo, "alpha", Strong.easeIn, 1, 0, 1, true);
        var myTaffTween3 = new Tween(MovieClip(root).taffrail_movie_mc, "alpha", Strong.easeIn, 1, 0, 1, true);
        MovieClip(root).taffrail_movie_mc.visible=false;
    }
}

The reason the other movie clip was not clickable was because I didnt remove the video once it had finished playing, I needed to have 另一个影片剪辑不可点击的原因是,当视频播放完毕后,我没有将其删除,因此我需要

myCompbox3.addEventListener(TweenEvent.MOTION_FINISH, removeCompVideo);

    function removeCompVideo(e:TweenEvent):void
{
    removeChild(compVideo);
}

within my taff_vid_close function. 在我的taff_vid_close函数中。 Thank you, own brain. 谢谢你自己的大脑。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM