Sunday, August 2, 2009

AS3 mailto


var email:String = "mailto:youremail@address.com";

button.addEventListener(MouseEvent.MOUSE_DOWN,sendEmail);

function sendEmail(e:Event):void {
navigateToURL(new URLRequest(email), "_self");
}

1 comment:

  1. Hi there,

    I'm new with this, I hope you can help me. When I replace the word button (seccond line) with the instance name of my button, it kind of works but it takes me to google.com instead of gmail.com (I replaced the "mailto:" mail address with my gmail address. Is this correct?

    ReplyDelete