嗨即時嘗試使用FLVPlayback函數在emagazine翻轉 和我可以得到播放FLV,如果我從Flash文件中刪除所有代碼,然後開始播放。 但我需要它由我在這裏發佈的代碼來控制控制FLVPlayback與事件
當雜誌加載時,並且它應該開始播放包含FLVPlayback的Flash影片,如果觀看者翻到下一頁,則會有一個名爲onpageLeave的事件發送信號stopAnimation4,並且Flash影片和FLVPlayback應該暫停或停止。
有沒有人對我如何做到這一點有一個想法?
//Prevent automatic playback
stop();
FLVPlayback.pause();
//Import eMagStudio AS3 API
//import SWFHolderAPI.*;
//Initiate the EMSMediator class
EMSMediator.instance.init(this, eMagListener);
//Set variable that controls playing when the clip is called using playonce
if(playedOnce == undefined){
var playedOnce:Boolean = false;
}
//Callback function for events in the eMag. Responds to the broadcasts startAnimation and stopAnimation
function eMagListener(event:MessageEvent):void{
//Broadcast coming from eMagStudio
var eMagBrdcast:String = String(event.message);
if(eMagBrdcast == "startAnimation4"){
setTimeout(myFunction, 800);
function myFunction() {
play();
}
}else if(eMagBrdcast == "startAnimationOnce4"){
if(!playedOnce){
playedOnce = true;
play();
}
}
if(eMagBrdcast == "stopAnimation4"){
stop();
}else if(eMagBrdcast == "stopAnimationOnce4"){
if(!playedOnce){
playedOnce = true;
stop();
}
}
}