A Live Chat App for My Mum

My mum recently got hooked up with her own lap top and due to the distance between us got a web cam to chat with my kids, nice move! Problem was her first trial with Instant Messenger started of with a few hurdles in the registration process and ultimately ended up with the blue screen of death on first flicker of live video???

So I thought I would develop a 1 to 1 video chat application using Flash Media Server and Flash to get the kids talkin’ to grandma :) I wanted a super simple, no entering text or jump any hurdles solution with client id to be handled server side. The server side script for handling clients is below:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
if( application.clients.length == 0 )
  {
      trace( "Me: "+ client.id );
      application.acceptConnection( client );
  } else if( application.clients.length == 1 )
  {
      trace( "Me Mum: "+ client.id );
      application.acceptConnection( client );
      application.clients[0].call( "ready", null, application.clients[0].id, application.clients[1].id );
      application.clients[1].call( "ready", null, application.clients[1].id, application.clients[0].id );
  } else
  {
      trace( "REJECT: "+ client.id );
      var err = new Object();
      err.message = "This is a AB chat so C your way out!";
      application.rejectConnection( client.id, err );
  }

Called mum gave the URL and hey presto, kids and grandma chatting away happily and no blue screen of death!!!

Comments