import mx.rpc.events.ResultEvent;
import mx.rpc.http.HTTPService;
private function onKeyDown( event:KeyboardEvent ) : void {
if ( event.keyCode == Keyboard.ENTER ) {
var url:String = "http://localhost/add.php?user="+escape(user.text)+"&message="+escape(msg.text);
var htMessages:HTTPService = new HTTPService();
htMessages.url = url;
htMessages.send();
msg.text = '';
}
}