Email button in as3

This is a discussion on Email button in as3 within the Graphics & Flash forums, part of the Web Design category; I need to add an email button to my flash file. I used this code: Code: myBtn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); function mouseDownHandler(event:MouseEvent):void ...


Reply
 
LinkBack Thread Tools Display Modes
Old 15th December 2009, 09:42 PM   #1
Member
 
Join Date: Jan 2009
Posts: 99
Thanks: 2
Thanked 0 Times in 0 Posts
trixiemay is on a distinguished road
Default Email button in as3

I need to add an email button to my flash file.

I used this code:

Code:
myBtn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
    navigateToURL(new URLRequest("mailto:me@iconadvertising.co.nz?subject=RSVP : Season Launch"));
}
However, when I tested the file on IE8, before opening the new message in Windows Mail it opened a blank page in the browser with an error message "Navigation to the webpage was cancelled"

How can I avoid this? Apart from this, the functionality works fine.
trixiemay is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Old 17th December 2009, 12:10 AM   #2
Junior Member
 
Join Date: Dec 2009
Location: San Francisco Bay Area
Posts: 24
Thanks: 0
Thanked 2 Times in 2 Posts
TheCosmonaut is on a distinguished road
Expertise: Web Development
Experience: Professional
Default

Hey there!

Two thoughts - first, it looks like there's a space between "subjec" and "t"; that might cause some weirdness. Second, try adding a target to the script. So it would look like:

Code:
myBtn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
    navigateToURL(new URLRequest("mailto:me@iconadvertising.co.nz?subject=RSVP : Season Launch"),"_self");
}
Let me know if that works!
TheCosmonaut is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!twitter
Reply With Quote
Reply

Tags
button, email

Thread Tools
Display Modes