var form:Formulaire; sendForm = function () { form.send(); form.onSend = Delegate.create(this, onSend); form.onReceive = Delegate.create(this, onReceive); } onSend = function(pEvent:Object):Void { trace("envoi en cours > "+pEvent); } onReceive = function(pEvent:Object):Void { trace("envoi terminé > "+pEvent.success); } form = new Formulaire("/scripts/sendMail.php", "POST"); form.addInput("nom", txtNom); form.addInput("mail", txtMail); form.addInput("message", txtMessage); btnEnvoyer.onRelease = Delegate.create(this, sendForm);