onBWDone problem Flash Media Server with AS3

February 19th, 2008

I ran into a small problem today while testing FMS 3, and had some problems finding the solution. I eventually found it and would like to share it with you.if you get the error:

ReferenceError: Error #1069: Property onBWDone not found on StreamTest and there is no default value.

Make sure that you map your NetConnection.client to a client class or the class you are working from. Then create the method onBWDone in the target Class. :

1
2
3
4
5
6
7
8
9
10
11
12
13
private function setConnection():void
 
{
 nc = new NetConnection();
 nc.client = this;
 nc.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
 nc.addEventListener(AsyncErrorEvent.ASYNC_ERROR, onAsyncError);
 nc.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);
 nc.connect(appURL);
}
 
public function onBWDone():void{
}

 Why is this happening?
Well if you look into the VOD application on the FMS server you will see that the application performs a BandWidth check and invokes this function on the client when it is done. You can measure the bandwidth speed in order to select a proper stream (assuming you have encoded multiple bitrates of one video). How to use this?
Take a look here.


16 Responses to “onBWDone problem Flash Media Server with AS3”

  1. Matt on February 22, 2008 4:09 am

    I was having the same error message with FMS 3. Worked around by setting client on the NetConnection instead - NetStream never complained. Thanks for the tip on defining a onBWDone method on the client - I missed this one ;)

  2. Toybot on February 22, 2008 5:58 pm

    You’re right, I pasted the wrong part of code. The client of the netstream is mapped to the class for the onMetaData. It has to be the netconnection. I fixed the post, thanks for pointing it out.

  3. RTG on April 27, 2008 6:48 pm

    Environment Flashdevelop/AS3(Flex 3 SDK). Your fix worked.

    THX RTG

  4. Dave Potts on June 24, 2008 4:41 pm

    Thank you!! I have been looking for this for days…

  5. Rob on August 21, 2008 11:55 pm

    All that is needed with a onBWDone error is to add in:


    nc.client = this;

    This will cause the component to send return calls to the client.

  6. Enrique Rodriguez on September 26, 2008 4:28 am

    Thanks !!!!!!!!! :)

  7. hasan on November 2, 2008 11:45 am

    Thank u!!!

  8. b! on November 6, 2008 3:39 pm

    Thanks a lot!

  9. Roberto on June 18, 2009 9:22 pm

    Muchas gracias!!!
    Thanks!!

  10. aa on June 27, 2009 12:21 am

    Obrigado!

  11. Boudewijn on July 30, 2009 3:24 pm

    Very useful. Thanks !

  12. Kevin Richardson on October 27, 2009 3:23 pm

    Thank you for that - saved me from further hair loss!

  13. Ciccio on March 12, 2010 4:31 pm

    Really thanks!!!
    I have been looking for this for hours…
    I was throwing my laptop outside the windows…:P

  14. Josh Nespodzany on February 1, 2011 5:03 pm

    Thanks!
    I also had to add the nc.client = this; line in to get to work.

  15. Flash Media Hosting on February 24, 2011 7:28 pm

    Glad you got it. Flash Media Server can be tricky sometimes.

  16. Rakesh on March 8, 2011 6:25 am

    Error gone, Thanks

Trackback URI | Comments RSS

Leave a Reply

Name (required)

Email (required)

Website

Speak your mind