Hey guys, I’m having a little trouble with calling send() on a netstream.
I am using Flash CS4, programming with AS3
I’m trying to make a P2P Video Conference, and want to periodically send data from one client to another.
This is what I have:
function startPublishing():void {
[INDENT]publishStream = new NetStream(connection, NetStream.DIRECT_CONNECTIONS);
publishStream.attachAudio(mic);
publishStream.attachCamera(camera);
var publishStreamClient:Object = new Object();
publishStreamClient.onPeerConnect = function(callerns:NetStream):Boolean {
[INDENT]trace("Connected to " + callerns.farID);
return true;[/INDENT]
}
publishStream.client = publishStreamClient;
publishStream.publish(“ClientVideo”);[/INDENT]
}
function startPlaying(playID:String):void {
[INDENT]playStream = new NetStream(connection, playID);
playStream.client = this;
incomingVideo.attachNetStream(playStream);
playStream.play(“ClientVideo”);[/INDENT]
}
function doSomeStuff(str:String):void {
[INDENT]trace(str);[/INDENT]
}
Then, later in the code, I try calling
[INDENT]publishStream.send(“doSomeStuff”, “HELLO THERE!!!”);[/INDENT]
… but I never get the trace message “HELLO THERE” !!! What is wrong here!!!
Thanks so much for the help!