A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: Trouble with email link

  1. #1
    Junior Member
    Join Date
    Jun 2012
    Posts
    8

    Trouble with email link

    Hi there, I am using CS4,AS2 and I need some help/assistance with an email link(I also posted in Newbies).

    I have an invite I created in Flash and at the end of some animation some buttons appear, one of them being "RSVP". When selected it pops up that standard small window asking you to choose an email preference(in this case Yahoo). Once selected it goes to that email account or asks to to log in to proceed and then the reply email window shows and your ready to RSVP.

    Where I need help is:
    1 - I would like the invite I created to remain open and have the reply email window open in a separate/new window.

    2 - I am also having trouble getting the "Subject" to fill in correctly and sometimes the text "mailto:" appears in the email address window and causes an error when the email attempts to send.

    Below is what I am using for now:

    rsvp_btn.onPress=function () {
    getURL("mailto:me@blahblah.com");
    }

    and I have tried this with no luck:

    rsvp_btn.onPress=function () {
    mailto = "mailto:" + Address + "?subject=" + Subject;
    getURL("mailto:me@blahblah.com&?subject=Party Reply");
    }

    Any help would be greatly appreciated!

    Thanks.

  2. #2
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Did you test it in a browser? Press F12 to test your flash proyect in a browser and see if it works. If not, let me know to try to help you further.

  3. #3
    Junior Member
    Join Date
    Jun 2012
    Posts
    8
    F12 - Still not working correctly - does not open new window and does not populate Subject line.

    I had a reply that said to try this:

    rsvp_btn.onPress=function ()
    {
    var Address = "me@blahblah.com";
    var Subject = "Party Reply";
    var mailto = "mailto:" + Address + "?subject" + Subject;
    getURL(mailto, "_blank");
    }

    Same result: Still not working correctly - does not open new window and does not populate Subject line.

    Help!

  4. #4
    Senior Member Steven FN's Avatar
    Join Date
    Mar 2010
    Location
    CA, USA
    Posts
    276
    I tested your code and it seems to work out just fine. I noticed that i had to upload the SWF to get the subject line to be populated. When tested locally in browser, it would open email client and fill in address as expected but without subject.

    I think your source could be setup wrong perhaps, source code would be helpful.

    PS: I was testing with CS5.

  5. #5
    Member
    Join Date
    May 2012
    Posts
    51
    You need an equal sign after "subject". The code should be

    Actionscript Code:
    var mailto = "mailto:" + Address + "?subject=" + Subject;

  6. #6
    Junior Member
    Join Date
    Jun 2012
    Posts
    8

    Trouble with email link

    Hi,

    I was successful filling in the Subject, Thank You so much for that help.

    As far as opening the email reply in a new/separate window, what appears first as you hit the RSVP button is the "Launch Application" pop up asking you to choose an application( Gmail, Yahoo, Outlook, etc.) and once you choose one then it automatically opens in the same window. What I would like is this popup to go to a separate window once your email choice is made.

    Can this be accomplished?

    Thank you everyone again for all your help.

  7. #7
    Member
    Join Date
    May 2012
    Posts
    51
    Hmmm...that's tricky. I'm assuming you're talking about the Launch Application pop up in Firefox. What's you're trying to work around is a bug in the browser. I can't think of a good way of doing it. You can use window.open() to open the mailto: URL in a new browser window, but then if the user chooses Outlook or any other external mail program, you end up with a blank window.
    Last edited by cleong; 06-20-2012 at 09:20 AM.

  8. #8
    Junior Member
    Join Date
    Jun 2012
    Posts
    8


    Yes, this is the pop up that when selected i am trying to get to open in a new separate window. Any ideas?

  9. #9
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    I don't think that can be achieved, because once the "Launch application" pop up, pops out, you can't control it because is part of Firefox. Even if you get a workarround to "hack" firefox to open the selected email engine in another window, you can't make it happen on the users firefox. That is what i think, I don't know if there is a workarround in flash (actionscript or classes) to achieve that. Hope you can be helped ^_^

  10. #10
    Member
    Join Date
    May 2012
    Posts
    51
    There's no workaround for this I'm afraid.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center