Topic: Local Flash Peer to Peer connection using NetConnection/ipMulticast
Hello,
I'm working on an art gallery installation that uses several networked computers using Flash Player 10. I have them communicating over the LAN using a NetConnection/ipMulticast (bypassing servers and internet connection), as outlined in this blog entry:
http://www.flashrealtime.com/local-flas … ut-cirrus/
It's working great on my networked computers running on the same LAN. It does pop up the Flash Player Settings window where you need to allow 'Peer Assisted Networking'.
I tried using the SWF as a private widget on my Infocast 8" (which is updated to run AS3) and the app opens but doesn't allow any of the networking capabilities over LAN. Is there any way to get this kind of local network functionality to work with the Infocast?
Thanks for any help!
Brent
PS: I've pasted the AS3 code below:
var nc:NetConnection;
var group:NetGroup;
var userName:String;
var connected:Boolean = false;
btnSend.addEventListener(MouseEvent.CLICK, btnSend_clickHandler);
function connect():void
{
nc = new NetConnection();
nc.addEventListener(NetStatusEvent.NET_STATUS, netStatus);
nc.connect("rtmfp:");
userName = "user" + Math.round(Math.random() * 1000);
}
function netStatus(event:NetStatusEvent):void
{
writeText(event.info.code);
switch (event.info.code)
{
case "NetConnection.Connect.Success" :
setupGroup();
break;
case "NetGroup.Connect.Success" :
connected = true;
break;
case "NetGroup.Posting.Notify" :
receiveMessage(event.info.message);
break;
}
}
function setupGroup():void
{
var groupspec:GroupSpecifier = new GroupSpecifier("myGroup/groupOne");
groupspec.postingEnabled = true;
groupspec.ipMulticastMemberUpdatesEnabled = true;
groupspec.addIPMulticastAddress("225.225.0.1:30303");
group = new NetGroup(nc,groupspec.groupspecWithAuthorizations());
group.addEventListener(NetStatusEvent.NET_STATUS,netStatus);
}
function sendMessage(txt:String):void
{
var message:Object = new Object();
message.text = txt;
message.sender = group.convertPeerIDToGroupAddress(nc.nearID);
message.userName = txtUser.text;
group.post(message);
receiveMessage(message);
}
function receiveMessage(message:Object):void
{
writeText(message.userName+": "+message.text);
}
function writeText(txt:String):void
{
txtHistory.text += txt + "\n";
}
function btnSend_clickHandler(event:MouseEvent):void
{
sendMessage(txtMessage.text );
}
connect();