7.13. Adding an Email Link to Static Text

Problem

You want to add an email link to static text such that when the user clicks on it, a new email message is opened.

Solution

Apply a hyperlink to the text (see Recipe 8.12) in which the URL is in the form of mailto:.

Discussion

Recipe 8.12 shows you how to apply a hyperlink to static text. Using the mailto protocol, you can also open a new email message. For example, to enter a value into the URL link field that opens a new email message with as the recipient, use mailto:.

You can also specify the subject and body values by appending URL-encoded variables after the email address. For example, mailto:?subject=you rock opens a new email message to with a subject of “you rock,” and mailto: adds a message body of “a message for you.”

The email hyperlink technique works only when the movie is being played in a web browser, because Flash relies on the web browser to have the capability to open the user’s mail program. Therefore you cannot control what application is used to create the email message. The application choice is dependent on what default email client has been configured for the web browser. Also, be aware that while the subject and body attributes work for the majority of email clients, there are some for which these attributes are ignored.

Get Flash 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.