此代碼導致我的f4v文件過早地停止播放。時間變化,但大約8-10秒英寸使用功能時奇怪的NetStream問題
loadSong();
function loadSong()
{
if(!songPlaying)
{
songPlaying = true;
var customClient:Object = new Object();
customClient.onCuePoint = cuePointHandler;
customClient.onMetaData = metaDataHandler;
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.client = customClient;
ns.play("song.f4v");
}
trace("HERE");
}
function cuePointHandler(infoObject:Object):void{
trace(infoObject.name);
}
function metaDataHandler(infoObject:Object):void {
trace("metaData");
}
這段代碼讓我們的f4v玩到最後。 WTF!?看來,當我通過函數調用它時會導致問題。僅供參考,代碼存儲在主時間軸的第一幀中,而F4v僅爲音頻。任何幫助,將不勝感激。
if(!songPlaying)
{
songPlaying = true;
var customClient:Object = new Object();
customClient.onCuePoint = cuePointHandler;
customClient.onMetaData = metaDataHandler;
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.client = customClient;
ns.play("song.f4v");
}
非常感謝martineno,這是一個愚蠢的錯誤! – Chris 2010-11-25 04:20:29