|
-
Hi I got it sorted, needed to declare onClickedSend event as below, for anyone who cares!
//send script:
var mLocalConnection:LocalConnection;
mLocalConnection=new LocalConnection();
mLocalConnection.addEventListener(StatusEvent.STAT US, onLocalConnectionStatus);
sendButton.addEventListener(MouseEvent.CLICK, onClickedSend);
function onClickedSend(e:Event):void
{
mLocalConnection.send("myLocalConnection", "streamHandler");
}
function onLocalConnectionStatus(statusEvent:StatusEvent):v oid
{
if (statusEvent.level=="error")
{
trace(statusEvent.code);
}
}
//receive script:
var mLocalConnection:LocalConnection;
mLocalConnection=new LocalConnection();
mLocalConnection.connect("myLocalConnection");
mLocalConnection.client=this;
mLocalConnection.addEventListener(StatusEvent.STAT US, onLocalConnectionStatus);
function onLocalConnectionStatus(statusEvent:StatusEvent):v oid
{
if (statusEvent.level=="error")
{
}
}
function streamHandler():void {
// stops publishing the stream
nsStream.pause();
// deletes the source stream connection
ncConnection.close();
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|