# Netstream.send()

**URL:** <https://forum.kirupa.com/t/netstream-send/307475>\
**Category:** Uncategorized\
**Created:** [April 4, 2010, 5:08am UTC](https://forum.kirupa.com/t/netstream-send/307475 "2010-04-04T05:08:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NoobieNoob](https://avatars.discourse-cdn.com/v4/letter/n/8e8cbc/32.png) [@NoobieNoob](https://forum.kirupa.com/u/NoobieNoob)\
**Post date:** [April 4, 2010, 5:08am UTC](https://forum.kirupa.com/t/netstream-send/307475/1 "2010-04-04T05:08:59Z")

</div>

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!
