creationComplete="myConsumer.subscribe();">
import mx.controls.Alert;
import mx.messaging.events.MessageEvent;
import mx.messaging.messages.AsyncMessage;
private function sendMessage():void
{
var message:AsyncMessage = new AsyncMessage();
message.body = "message";
message.headers.chatUser = "Tom";
myProducer.send(message);
}
private function messageHandler(event:MessageEvent):void
{
msgLog.text += event.message.headers.chatUser + ": " + event.message.body + "\n";
}