[AS3.0] Error #1069: Property onBWDone not found on flash.net.NetConnection and there is no default value.解决办法

在运用FMS录制视频时,假如出现这个错误,最直接的解决办法如下:

_netConnection.client = { onBWDone: function():void{ trace("onBWDone"); } };

 

不过也存在第二种解决办法:

_netConnection.client = this;
 
public function onBWDone(...rest):void
{ 
    var p_bw:Number; 
    if (rest.length > 0){
        p_bw = rest[0]; 
    }
    trace("bandwidth = " + p_bw + " Kbps."); 
} 

还有第三种解决办法:

_netConnection.client = new NetConnectionClient();
package
{
    public class NetConnectionClient
    {
        public function NetConnectionClient()
        {
        }
         
        public function onBWCheck(...rest):Number
        { 
            return 0; 
        } 
         
        public function onBWDone(...rest):void
        { 
            var p_bw:Number; 
            if (rest.length > 0){
                p_bw = rest[0]; 
            }
            trace("bandwidth = " + p_bw + " Kbps."); 
        } 
    }
}

 

posted on 2017-01-02 02:00  晏过留痕  阅读(287)  评论(0编辑  收藏