TwelvestoneFlash

PROBLEM: Getting errors trying to connect to FMS via an RTMP stream.


Sign in

  • Waiting for Godot ( 720 k posts )
    Just conversation.
  • Thunder Dome ( 23 k posts )
    Photoshop Tennis and Collabs.
  • Photography ( 4.8 k posts )
    For all you shutterbugs, sh...
  • Flash ( 18 k posts )
    ActionScripting to tweens, ...
  • Front End ( 5.8 k posts )
    general front end design an...
  • Back End ( 9.6 k posts )
    serverside scripting, progr...
  • Projects and Theory ( 12 k posts )
    This forum is for discussio...
  • FAQ ( 269 posts )
    All those nagging questions...
  • Design ( 17 k posts )
    graphics & all aspects of g...
  • Purgatory ( 3.6 k posts )
    12stone Jail, feel free to ...
derrickito
 
2008-10-24

//ERRORS ON EXPORT 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.

In googling these errors, I've found a lot of people saying you must have a function handling the AsyncErrorEvent, as FMS needs to use it, whether or not it does anything. I've read the same thing about onBWDone. However, I've yet to find a widely used way of satisfying either of those obligations that works with our code. And I've also not seen any example that satisfies BOTH of those problems.

NOTE:Using Actionscript 3 is imperative

//OUR CODE...NOTE: We need to pass an argument(movie) to this function. //That's why it's in a standard function residing inside the .fla //instead of a class on an included .as file. Also, a number of other //functions/variables need to be fired when onNetStatus() is fired.

function init(movie:String):void {

   videoConnection = new NetConnection();
   videoConnection.connect("rtmp://path/to/app");
   videoConnection.addEventListener(NetStatusEvent.NET_STATUS, onNetConnectStatus);

   function onNetConnectStatus(e:NetStatusEvent):void {
           videoStream = new NetStream(videoConnection);
           video.video.attachNetStream(videoStream);
           videoStream.play(movie);
           videoStream.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
           videoStream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, onAsyncError);
   }

   function onNetStatus(e:NetStatusEvent):void {
           if (e.info.code == "NetStream.Play.Start") {
                   //DO SOMETHING ON PLAY
           }
   }
   function onAsyncError(event:AsyncErrorEvent):void {
           //IGNORE...ONLY FOR FMS USE
   }

}

halp?

lithium
 
2008-10-26

the fms server automatically invokes onBWDone when it has completed detecting the bandwidth capabilities of the requesting client. It also calls a bunch of other methods too, like onLastSecond() and there's a few others i can't remember off the top of my head.

basically the netconnection instance needs a client class to handle all of these method invocations. You can either have a separate class that houses these methods, or you can pass the root timeline to the net connection and implement them there. for instance:

videoConnection = new NetConnection(); videoConnection.connect("rtmp://path/to/app"); videoConnection.client = this videoConnection.addEventListener(NetStatusEvent.NET_STATUS, onNetConnectStatus);

/* you now need to have a function declared called onBWDone() */

function onBWDone(...args):void { trace ( "onBWDone! : " + args ); }

similarly you can say:

videoConnection.client = new SpecialVideoConnectionClient();

where SpecialVideoConnectionClient is a class that just has

public function onBWDone ( ...args ):void {

}

public function onLastSecond ( ...args ):void {

}

/*... etc */

hope it helps. It's first thing monday morning here so i may not be as eloquent as i would've liked. k

cheers,

A.

Sorry, you must be a member to post to a conversation. Either log in or sign up to get involved.
TwelvestoneFlash

PROBLEM: Getting errors trying to connect to FMS via an RTMP stream.