I am wondering if this is possible and maybe some code examples if it is. I am trying to have the presenter during a live address be able to hit a button when he is away. This button will then trigger a jpg or some kind of image on the clients side that says he is currently away and to also have it mute the presenter's microphone? Anyone have any ideas how this would be possible in FMIS 4 and AS3?
Yes, this is do-able. There's a bit of code to write. Here's a break down:
[Edit]
Adding some code to clarify how to use NetStream.send()
:
The presenter code:
private function onAwayButtonClick(event:Event):void
{
stream.send("toggleAwayImageDisplay"); // stream is a NetStream you created elsewhere
mic.gain = 0; // mic is the Microphone you attached to the stream
}
The subscriber code
When creating the NetStream, use the client property so it knows where to find the function "toggleAwayImageDisplay" we specified above:
private function someMethodThatCreatesNetStream(netConnection:NetConnection):void
{
stream = new NetStream(netConnection);
// you could use any object here, as long as it has the method(s) you are calling
stream.client = this;
// this might be nicer, you can reference functions from any class this way
// the key in this client object is a function name
// the value is a reference to the function
// var client:Object =
// { toggleAwayImageDisplay: toggleAwayImageDisplay,
// doSomethingElse: anotherObject.doSomethingElse };
// stream.client = client;
// be careful about memory leaks though :)
}
private function toggleAwayImageDisplay():void
{
// now show or hide the image
}