February
---
2003




Flash Communication Server experiment

A quick little experiment with Flash Communication Server. This server software allows video streaming into a Flash application. The green dot in the top right corner indicates a succesful connection. I have a very limited account so it may be busy from time to time.

aspx.cs code

#include "NetDebug.as"

client_nc = new NetConnection();
client_nc.connect("rtmp://your_serverpath");
client_nc.onStatus = onconnect;

function onconnect(returnObj) {
   if (returnObj.code == "NetConnection.Connect.Success") {
      RunClip();
   } else if (returnObj.code == "NetConnection.Connect.Rejected") {
      alert("I've limited the amount of connections to the server.
      \\rPlease try again later.");
      client_nc.onStatus=null;
   } else if (returnObj.code == "NetConnection.Connect.Closed") {
      alert("The connection has been closed.\\rPlease try again.");
   }
}

function RunClip(){
   poep = status.code
   myInputStream = new NetStream(client_nc);
   vidBoxPlay.attachVideo(myInputStream);
   myInputStream.setBufferTime(1);
   myInputStream.play("dirtcat");
}

//------------------------------------------------------------
function alert(retval){
   if (_root._url.substr(0,4)=="file"){
      trace (retval);
   } else {
      getURL ("javascript:alert('" + retval + "')");
   }
}

stop();