0

我使用 Flsh CS5 AS3 Flvplayback 2.5。

第一个问题是:我在 Flvplayback 2.5 的同一页面中有 9 个按钮,当视频播放时,如果我的鼠标停在任何按钮上,没有点击任何东西,但视频会停止,然后如果我的鼠标移开,它将重新开始播放。我不想要,因为按钮会破坏视频。相同的 Flvplayback 按钮。我看到了输出 : in in in in in in in in,如果我喜欢 onece,我会看到: 2_Nat Geo Clips_Red Wolf Docu 被点击。我该如何解决????

感谢您抽出时间来帮助我!我希望你有一个阳光明媚的日子!

  import fl.video.*;
  import flash.events.MouseEvent;
  var flvPlayer:FLVPlayback = new FLVPlayback();
  addChild(flvPlayer);
  flash.events.Event.MOUSE_LEAVE
   //The next line assumes you have copied the skin file to the directory
   //that contains the published SWF file. If you are testing the 
   //application in Flash Professional, this is the same directory as the
   //FLA file, too.
   if (! myVideo.hasEventListener(MouseEvent.MOUSE_OUT))
   {
videoMask.addEventListener(MouseEvent.MOUSE_OVER, __onIn);
videoMask.addEventListener(MouseEvent.MOUSE_OUT, __onOut);

function __onIn(event:MouseEvent):void
{
    // TODO Auto-generated method stub
    trace("in");
    if (! myVideo.playing)
    {
        myVideo.play();

    }
}

function __onOut(event:MouseEvent):void
{
    // TODO Auto-generated method stub
    if (myVideo.playing)
    {
        myVideo.pause();

    }
}
}

var mybtn:Array = new Array       (Movie1_btn,Movie2_btn,Movie3_btn,Movie4_btn,Movie5_btn,Movie6_btn,Movie7_btn,Movie8_btn,Movie9_btn);
for (var i=0; i<mybtn.length; i++)
 {
mybtn[i].addEventListener(MouseEvent.CLICK,clickhandler);
function clickhandler(event:MouseEvent):void
{

    if (event.target == Movie1_btn)
    {
        myVideo.source = "1_Bad Water Sequence.mov";
    }
    else if (event.target==Movie2_btn)
    {
        myVideo.source = "2_Nat Geo Clips_Red Wolf Docu.mp4";
    }
    else if (event.target==Movie3_btn)
    {
        myVideo.source = "3_News_Anthrax_Postal Story.mov";
    }
    else if (event.target==Movie4_btn)
    {
        myVideo.source = "4_Energy Ducumentary 2 min Clip.mov";
    }
    else if (event.target==Movie5_btn)
    {
        myVideo.source = "5_Wildlife_Scenic_Reel.mov";
    }
    else if (event.target==Movie6_btn)
    {
        myVideo.source = "6_Intro Title Sequence for Mt.Rushmore Webcasts.mov";
    }
    else if (event.target==Movie7_btn)
    {
        myVideo.source = "7_PowWow Ancestry Dream Sequence.mov";
    }
    else if (event.target==Movie8_btn)
    {
        myVideo.source = "8_Fence Fixin-Western style-L.mov";
    }
    else if (event.target==Movie9_btn)
    {
        myVideo.source = "9_Docu_3 separate Clips.mov";
    }
}
 }

 function readyHandler(event:VideoEvent):void
 {
  // Pause until the video can play till the end
 myVideo.pause();
 myVideo.playWhenEnoughDownloaded();
}

 myVideo.addEventListener(VideoEvent.READY, readyHandler);

stop();
4

1 回答 1

0

将 Mouse Over 替换为 MouseEvent.CLICK,确保按钮有背景

于 2013-08-17T19:47:14.893 回答