Welcome to my actionscript snippet library!

Actionscript Snips is a small repository of actionscript code that aims to save developers and designers time when developing a website.  

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 comments:

Rvicens said...

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?

Post a Comment