Copy link to clipboard
Copied
In all of my AS2 and AS3 sites, the mailto: links work wonderfully in; Firefox, Safari, IE but not in Chrome. A regulare HTML mailto: will work in Chrome but not my AS2 or AS3 generated ones. In Chrome if the link is set to go to mailto:name@domain.com, Chrome then puts mailto:name@domain.com in the address bar and gives the message:
This webpage is not available
The webpage at mailto:name@domain.com might be temporarily down or it may have moved permanently to a new web address.
Error code: ERR_UNKNOWN_URL_SCHEME
If I refresh this page that is set to go to mailto:name@domain.com , then it works.
Example here: http://villagegreenstudios.com/view11/
The top "Email Button" is an AS3 coded Flash button.
The middle "Email Text" is a Flash generated text link.
The bottom "html email text" is HTML coded in the the index.html page itself.
All 3 work in all browsers except Chrome where only the bottom one works.
My computer has my Entourage set as the default email program. If I use the Chrome gmail plugin, the top 2 will work but then on FF and Safari the links try to open a Chrome window and this misses the point anyway as I want sites that I built for clients to have operable mailto: links in all browsers.
The Flash version in above version is 11.4 but even in older versions, including AS2 versions, they do the same thing. I have tried various versions of the code with no luck. If it helps, here is the code used the above "Email Button" version:
//email button//
function goemail(event:MouseEvent):void {
navigateToURL(new URLRequest("mailto:name@domain.com"));
}
emailBtn.addEventListener(MouseEvent.CLICK,goemail);
In AS2 I simply use:
on (release) {
getURL("mailto:curt@curtbyk.com");
}
Help?
Copy link to clipboard
Copied
What version of Chrome?
Copy link to clipboard
Copied
Thanks for replying.
Version 29.0.1547.65
Google Chrome is up to date.
Copy link to clipboard
Copied
On Mac? It works for me but I just had a client complain just today about this same problem using the exact same version of Chrome. I got here googling to research it. I'm on WIndows with a slightly older version of Chrome (.57 instead of .65), but I'm going to update Chrome and see if I can reproduce it, and try workarounds. I'll let you know how it goes.
I'm going to try using ExternalInterface to trigger the mailto link.
-Aaron
Copy link to clipboard
Copied
Thanks Aaron. The version of Chrome as the issue would make sense as I
don¹t have hundreds of clients emailing me in despair. If you figure it
out, please let me know.
Copy link to clipboard
Copied
Well I updated Chrome and it installed Version ... ".66 m", not .65, and your example works for me. I'm suspecting this a Chrome/Mac issue, but I asked some Mac colleages if they have this issue in an app of mine and they don't.
Would you mind updating to .66 and see if you can still reproduce it?
-Aaron
Copy link to clipboard
Copied
Aha, I got it to happen by disabling my downloaded Flash Player and enabling Google's Pepper Flash Player. Ugh. Looking into workarounds now...
-Aaron
Copy link to clipboard
Copied
From what I see on my ³About Chrome² page and on the Chrome website, version
.65 is the most current for Mac. I downloaded the the version that was
offered and installed it over the one I had and it was .65 and the problem
still exist. Unless there is a .66 beta for Mac that I can't find, I think
I'm stuck.
Copy link to clipboard
Copied
Gotcha. Anyway it looks like this is a problem with Google's Pepper Flash Player (that doesn't exist with Adobe Flash Player) not a Mac/Chrome issue.
- Aaron
Copy link to clipboard
Copied
Great detective work Aaron. Thank you. If I go to chrome://plugins/ and
disable the "Adobe Flash Player" (which below is defined as
PepperFlashPlayer.plugin) then the mailto: links work as they should as now
the Shockwave Flash player is handling it.
The drag is that I'm guessing the Pepper version is the default in Chrome
and until it is fixed, most Chrome users are gonna be lacking mailto:
ability.
Copy link to clipboard
Copied
Yeah you're right... most Chrome users are likely running Pepper Flash Player. Honestly, Google's self-managed Flash Player causes more problems than it does good.
Copy link to clipboard
Copied
Try using Javascript via ExternalInterface:
// window.location
ExternalInterface.call("function(link){window.location.href = link}", "mailto:email@domain.com");
// window.open
ExternalInterface.call("window.open", "mailto:email@domain.com");
I tried it but couldn't get it to work locally, Pepper Flash didn't seem allow any JS even though I had set it to be a trusted location (Adobe Flash of course worked fine.) I'm not able to easily test it online at the moment...
-Aaron
Copy link to clipboard
Copied
// window.location
ExternalInterface.call("function(link){window.location.href = link}", "mailto:email@domain.com");
// window.open
ExternalInterface.call("window.open", "mailto:email@domain.com");
I got a test up and both these ExternalInterface/JS based methods seem to work:
http://abeall.com/files/flash/mailto-test/mailto-link-test.html
-Aaron
Copy link to clipboard
Copied
Ha! That worked. It opens a new window/tab in Chrome but it works. I'll
use this from here on out but dread having to update hundreds of sites...
Yet, it is a viable solution. Thank you so much!
Copy link to clipboard
Copied
I got it working here http://villagegreenstudios.com/view11/ on the top
link while the middle link is still the previous method.
Copy link to clipboard
Copied
Waaaaaaiiiiiiit! The window.loaction version works without opening a new
tab! You the man Aaron!!!!
Copy link to clipboard
Copied
Yeah hopefully this gets fixed so using JS is a temporary workaround...
Copy link to clipboard
Copied
Working fine with AS2? I'm trying window.open call but doesn't work with Chrome version 30.0.1599.69 m.
Copy link to clipboard
Copied
Hi, i deal same problem (I apologize for my English).
Aaron Beall wrote:
Try using Javascript via ExternalInterface:
// window.location
ExternalInterface.call("function(link){window.location.href = link}", "mailto:email@domain.com");
// window.open
ExternalInterface.call("window.open", "mailto:email@domain.com");
I tried it but couldn't get it to work locally, Pepper Flash didn't seem allow any JS even though I had set it to be a trusted location (Adobe Flash of course worked fine.) I'm not able to easily test it online at the moment...
-Aaron
This JS code is write in swf file? In the HTML code, I do not see JS script.
Can you please send me FLA and HTML file? Thanks
Copy link to clipboard
Copied
Yes this code is just in Flash itself, no HTML JS is needed. You could define the JS function in HTML though:
<script>
function mailTo(email){
window.location.href = "mailto:" + email;
}
</script>
Then call it from Flash like this:
ExternalInterface.call("mailTo", "email@domain.com");
Keep in mind that ExternalInterface only works if enabled by the SWF embed code, which by default it is, but it might not be if you are trying to get this to work on a social platform or something like that (in which you don't control the SWF embed params.) You can use ExternalInterface.available to check this.
-Aaron
Copy link to clipboard
Copied
Now i see. Great, it works well. But I had to rewrite all links
Thank You very much for the explanation
Do you think that the next version of Chrome will be fixed? For the same functionality as in Firefox
Copy link to clipboard
Copied
I wouldn't count on it (browser makers are increasingly hostile towards Flash and plugins, it seems) but I would hope so. I really don't know.
-Aaron
Copy link to clipboard
Copied
Thanks Aaron, the JS ExternalInterface workaround got me out of a jam. Kudos!
Copy link to clipboard
Copied
Hello,
I work on the flash runtime team and we'd like to investigate your problem further.
Could you please log a new bug on this over at https://bugbase.adobe.com/ for adobe flash player.
When adding the bug, please include sample code so we can quickly test this out internally. If you would like to keep this private, feel free to e-mail the attachment to me (jiyuan@adobe.com) directly and I will attach it to the bug for internal use only.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now