// then use the Producer.send() method to send it.
private function sendMessage():void {
var message: AsyncMessage = new AsyncMessage();
message.body = userName.text + ": " + msg.text;
producer.send(message);
msg.text = "";
}
]]>
</mx:Script>
<mx:Producer id="producer" destination="chat"/>
<mx:Consumer id="consumer" destination="chat"
message="messageHandler(event)"/>
<mx:TextArea id="ta" width="100%" height="100%"/>
<mx:TextInput id="userName" width="100%"/>
<mx:TextInput id="msg" width="100%"/>
<mx:Button label="Send"
click="sendMessage();"/>
</mx:Application>
Message filtering
The Messaging Service provides ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.