How do I create an email link in Flash using action script 3?

Copy link to clipboard
Copied
I am a Web Design student and I just finished a class on Adobe Flash. I have created a simple web page for a friend using Flash 5.0 with ActionScript 3.0.
I have an emaill address on my page but I do not know how to write the script to create the link. This is not a subject we covered in class, nor could I find the info I needed in out book or on-line.
Can someone please help me? I need specifics!
Thank you.
Su-Jobi Web Design (Name of my future business!!)
Copy link to clipboard
Copied
if you can accept using the client default email program (if they have one), use:
navigateToURL(new URLRequest("mailto:info@whoever.com?subject=yoursubject&body=your message"));

Copy link to clipboard
Copied
OK. Do I type it exactly like it is written or do I substitute anything??
Sue
Susan Blair Cheatham
Su-Jobi Web Design
mailto:scheath2@eaglespace.northgatech.edu
Cell: 706 949-6035
Thank you for choosing Su-Jobi Web Design
We appreciate your trust!

Copy link to clipboard
Copied
I want it to work on the click of a mouse: when I run or test the page the email comes up immediately. Here is what I have so far:
navigateToURL(new URLRequest("mailto:mailto:dale@swingswing-along.com?subject=yoursubject&body=your message"));
/* Mouse Click Event
Clicking on the specified symbol instance executes a function in which you can add your own custom code.
Instructions:
1. Add your custom code on a new line after the line that says "// Start your custom code" below.
The code will execute when the symbol instance is clicked.
*/
button_3.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_6);
function fl_MouseClickHandler_6(event:MouseEvent):void
{
// Start your custom code
// This example code displays the words "Mouse clicked" in the Output panel.
trace("Mouse clicked");
// End your custom code
}
So how do I get the email to open ONLY when the mouse clicks on the link??
Sue
Susan Blair Cheatham
Su-Jobi Web Design
mailto:scheath2@eaglespace.northgatech.edu
Cell: 706 949-6035
Thank you for choosing Su-Jobi Web Design
We appreciate your trust!
Copy link to clipboard
Copied
Just replace the trace line in your button's event handler function (trace("Mouse clicked");) with the line that opens the email.
Copy link to clipboard
Copied
use:
var subject:String="Email From Flash"; // <-replace this
var message:String="this is the message from flash; // <- replace this
button_3.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_6);
function fl_MouseClickHandler_6(event:MouseEvent):void
{
navigateToURL(new URLRequest("mailto:mailto:dale@swingswing-along.com?subject="+subject+"&body="+message));
}

Copy link to clipboard
Copied
Thank you - but I still have not resolved my issue of the email link opening without a click from the mouse. As soon as my page starts to load the link opens and you don't get to see the cute animations I did for the web site...
But thank you for all your help.
Sue
Susan Blair Cheatham
Su-Jobi Web Design
mailto:scheath2@eaglespace.northgatech.edu
Cell: 706 949-6035
Thank you for choosing Su-Jobi Web Design
We appreciate your trust!
Copy link to clipboard
Copied
then you're not using the code i suggested. or, you are but you're also using code that's causing the problem.
create a new fla, add your button_3 to the stage and copy and paste the suggested code and use no other code.

Copy link to clipboard
Copied
It is working thank you.
Sue
Susan Blair Cheatham
Su-Jobi Web Design
mailto:scheath2@eaglespace.northgatech.edu
Cell: 706 949-6035
Thank you for choosing Su-Jobi Web Design
We appreciate your trust!
Copy link to clipboard
Copied
you're welcome.
p.s. in the future, please mark correct/helpful responses, if there are any.
Copy link to clipboard
Copied
If you still have this line by itself at the top, remove it, that is what is causing it to happen...
navigateToURL(new URLRequest("mailto:mailto:dale@swingswing-along.com?subject=yoursubject&body=your message"));

Copy link to clipboard
Copied
Thank you: it is now working ...
Sue
Susan Blair Cheatham
Su-Jobi Web Design
mailto:scheath2@eaglespace.northgatech.edu
Cell: 706 949-6035
Thank you for choosing Su-Jobi Web Design
We appreciate your trust!

