2013-08-17 140 views
0

我使用Flsh CS5 AS3 Flvplayback 2.5。Flash CS5 As3 Flvplayback 2.5,爲什麼有些視頻只播放音頻?

第一個問題是:在Flvplayback 2.5的同一頁面中有9個按鈕,當視頻播放時,如果我的鼠標停留在任何一個按鈕上,沒有點擊任何東西,但視頻將停止,然後if我的鼠標移開,它會再次開始播放。我不想要,因爲按鈕分解了視頻。相同的Flvplayback按鈕。 我看到了:在in in in in,如果我登錄ince,我會看到: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(); 

回答

0

更換鼠標懸停與MouseEvent.CLICK,確保有是按鈕

+0

MOUSE_OVER重播MouseEvent.CLICK背景???你在說什麼背景?是在btn_button還是在舞臺上? – Lily

+0

我可以拿那個MOUSE_OVER OUT嗎?如果(!myVideo.hasEventListener(MouseEvent.MOUSE_OUT)) \t videoMask.addEventListener(MouseEvent.MOUSE_OUT,__onOut); \t功能__onOut(事件:MouseEvent)方法:無效 \t { \t \t // TODO自動生成方法存根 \t \t跡( 「OUT」); \t \t如果(myVideo.playing!) \t \t { \t \t \t myVideo.play(); \t \t \t \t \t} \t}} 我 – Lily

+0

只想說謝謝! – Lily

相關問題