CrossPosting on FlashComm and FlashCoders.... forgive my transgression.
Hi, 
Im trying to build an flv player using as3. The server is FMS2, and I have no 
access to it. (yet) The thing that is tripping me up is the server is returning 
:
"Error #2044: Unhandled AsyncErrorEvent:. text=Error #2095: 
flash.net.NetConnection was unable to invoke callback onBWDone. 
error=ReferenceError: Error #1069: Property onBWDone not found on 
flash.net.NetConnection and there is no default value.
at VideoX$iinit()[C:\FlexStuff\VideoX\VideoX.as:22]" 
I know you can disable the "onBWDone" callback in flex 2 by specifying 
"autoDetectBandWidth = false" on the videoDisplay object; ive tried to handle 
it with a function in as3, and just hacked around, unsuccessfully, but in as3 
im not sure how to fix... 
Ideas, pointing out things Ive obviously overlooked appreciated. 
Jordan 
//code: 
package { 
import... 
public class VideoX extends Sprite{ 
private var video:Video; 
private var connection:NetConnection; 
private var stream:NetStream; 
private var fmsURL:String; 
private var flvURL:String; 
private var tf:TextField 
public function VideoX(){ 

video = new Video(); 

addChild(video); 
connection = new NetConnection(); 
connection.objectEncoding = flash.net.ObjectEncoding.AMF0; 
connection.addEventListener(NetStatusEvent.NET_STATUS,statusHandler); 
connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, 
netSecurityError); 
fmsURL = "rtmp://etc" 
flvURL = "etc"; 
connection.connect(fmsURL); 
} 
private function statusHandler(e:NetStatusEvent):void{ 
if(e.info.description =="Connection succeeded."){ 
stream = new NetStream(connection); 
video.attachNetStream(stream); 
stream.play(flvURL); 

var client:Object = new Object(); 
client.onBWDone = onBWDone; 
client.onCuePoint = cuePointHandler; 
client.onMetaData = metaDataHandler; 
stream.client = client; 
for(var i:String in client){ 
trace("client "+i+ " : "+stream.client[i]); 
} 
}else{ 
trace(e.info.code); 
trace(e.info.description); 
trace(e.info.level); 
} 
} 
public function onBWDone(p_bw):void{ 
trace(onBWDone); 
trace(p_bw); 
} 
private function cuePointHandler(infoObject:Object):void{ 
trace("cuePoint "+infoObject); 
} 
private function metaDataHandler(infoObject:Object):void{ 

for(var i:String in infoObject){ 
trace("metadata "+i+" : " + infoObject[i]); 
} 
} 
private function netSecurityError(e:SecurityErrorEvent):void{ 
trace("SecurityErrorEvent.SECURITY_ERROR" + e.toString()); 
} 
} 
} 

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to