A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 28

Thread: dynamic text email link

  1. #1
    Member
    Join Date
    Apr 2001
    Posts
    39
    hi everyone,

    I have a dynamic text box on my stage in _level1, named "textcontent" that scrolls.

    I have this code for its content:

    _level1.textcontent = "blablalbablalabalbaablablablab \r
    balbalbablablablablablablaaalablabl \r [email protected] ";

    on _level3.

    I don't know how to make the part of the code that says, "[email protected]" actually mailto:[email protected].

    Also I would like to make all the text white except "[email protected]" which I would like to be blue.

    How is this possible? thanks

  2. #2
    Junior Member
    Join Date
    Jan 2001
    Posts
    15
    Code:
    <a href="mailto:[email protected]"><font color="#0099FF">[email protected] </font></a>

  3. #3
    Member
    Join Date
    Apr 2001
    Posts
    39

    ????

    I don't understand? Can you explain how this will make a mailto link in a dynamic text field?

    thanks

  4. #4
    Member
    Join Date
    Apr 2001
    Posts
    39

    sorry I forgot to mention

    this is a flash 5 project.


  5. #5
    Senior Member chi-styler's Avatar
    Join Date
    Jul 2001
    Location
    Bristol, UK
    Posts
    1,237
    hi,

    set the text box to accept html tags,

    and put this code in
    Code:
    addy = "[email protected]";
    myTextVar = "&#60;a href=\"mailto:" + addy + "\"&#62;&#60;font color=\"#0099CC\"&#62;" + addy + "&#60;/font&#62;&#60;/a&#62;";
    Chi

  6. #6
    Junior Member
    Join Date
    Jul 2002
    Posts
    14

    Same problem here...

    I'm having the same problem. I have a dynamic text box set to scroll. HTML text is turned on, and I set the url for the email link to "mailto:[email protected]". I've tried assigning this straight through flash MX and also through AS with no success either way. The links behave as if they were active (the cursor changes to a hand) but when they are clicked, outlook express doesn't open. The project is intended to be used for CD distribution so it will be saved as a projector. Any ideas?

  7. #7
    Senior Member chi-styler's Avatar
    Join Date
    Jul 2001
    Location
    Bristol, UK
    Posts
    1,237
    This definitely works here:
    Just place a text box, myText, on the screen without any settings and go
    Code:
    addy = "[email protected]";
    myText.html = true;
    myText.htmlText = "&#60;a href=\"mailto:" + addy + "\"&#62;&#60;font color=\"#0099CC\"&#62;" + addy + "&#60;/font&#62;&#60;/a&#62;";

  8. #8
    Junior Member
    Join Date
    Jul 2002
    Posts
    14

    still no go...

    still getting same effect... here's my actual code...

    Code:
    frankEmail = "[email protected]";
    sarahEmail = "[email protected]";
    charlieEmail = "[email protected]";
    aaronEmail = "[email protected]";
    tysonEmail = "[email protected]";
    alanEmail = "[email protected]";
    contactText.html = true;
    contactText.htmlText = "<TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FFFFFF\">Please give us a call to find out</FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FFFFFF\">more about Medimotion Products:</FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FFFFFF\"></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FF9900\"><A HREF=\"mailto:" + frankEmail +"\"><B>Frank Nobile</B></A><FONT COLOR=\"#FFFFFF\"> 800.776.8383 ext. 255<FONT COLOR=\"#FF9900\"></FONT></FONT></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FF9900\"><A HREF=\"mailto:" + sarahEmail +"\"><B>Sarah Armstrong</B></A><FONT COLOR=\"#FFFFFF\"> 800.776.8383 ext. 254<FONT COLOR=\"#FF9900\"></FONT></FONT></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FF9900\"><A HREF=\"mailto:" + charlieEmail +"\"><B>Charles Steward</B></A><FONT COLOR=\"#FFFFFF\"> Development Manager<FONT COLOR=\"#FF9900\"></FONT></FONT></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FF9900\"><A HREF=\"mailto:" + aaronEmail +"\"><B>Aaron Johnson</B></A><FONT COLOR=\"#FFFFFF\"> Developer<FONT COLOR=\"#FF9900\"></FONT></FONT></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FF9900\"><A HREF=\"mailto:" + tysonEmail +"\"><B>Tyson Willey</B></A><FONT COLOR=\"#FFFFFF\"> Developer<FONT COLOR=\"#FF9900\"></FONT></FONT></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FF9900\"><A HREF=\"mailto:" + alanEmail +"\"><B>Alan Pack</B></A><FONT COLOR=\"#FFFFFF\"> Programmer<FONT COLOR=\"#FF9900\"></FONT></FONT></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FFFFFF\">800.776.8383 ext. 207</FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FFFFFF\"></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FF9900\"><A HREF=\"mailto:[email protected]\"><B>[email protected]</B></A></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FFFFFF\">fax: 877.847.0120</FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FFFFFF\"></FONT></P></TEXTFORMAT>"
    does this help any?

    I'm using a completely regular textbox (dynamic, scrolling)..

    Aaron

  9. #9
    Junior Member
    Join Date
    Jul 2002
    Posts
    14
    why'd that happen? my code should've show up there shouldn't it?

    Aaron

  10. #10
    Senior Member chi-styler's Avatar
    Join Date
    Jul 2001
    Location
    Bristol, UK
    Posts
    1,237
    you posted html code with tags so it interpreted it such. replace the &#60; with '& # 6 0 ;' and &#62; with '& # 6 2 ;' (remove spaces)

  11. #11
    Junior Member
    Join Date
    Jul 2002
    Posts
    14
    thanks...

    Code:
    frankEmail = "[email protected]";
    sarahEmail = "[email protected]";
    charlieEmail = "[email protected]";
    aaronEmail = "[email protected]";
    tysonEmail = "[email protected]";
    alanEmail = "[email protected]";
    contactText.html = true;
    contactText.htmlText = "&#60;TEXTFORMAT LEADING=\"2\">&#60;P ALIGN=\"LEFT\">&#60;FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FFFFFF\">Please give us a call to find out&#60;/FONT>&#60;/P>&#60;/TEXTFORMAT>&#60;TEXTFORMAT LEADING=\"2\">&#60;P ALIGN=\"LEFT\">&#60;FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FFFFFF\">more about Medimotion Products:&#60;/FONT>&#60;/P>&#60;/TEXTFORMAT>&#60;TEXTFORMAT LEADING=\"2\">&#60;P ALIGN=\"LEFT\">&#60;FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FFFFFF\">&#60;/FONT>&#60;/P>&#60;/TEXTFORMAT>&#60;TEXTFORMAT LEADING=\"2\">&#60;P ALIGN=\"LEFT\">&#60;FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FF9900\">&#60;A HREF=\"mailto:" + frankEmail +"\">&#60;B>Frank Nobile&#60;/B>&#60;/A>&#60;FONT COLOR=\"#FFFFFF\"> 800.776.8383 ext. 255&#60;FONT COLOR=\"#FF9900\">&#60;/FONT>&#60;/FONT>&#60;/FONT>&#60;/P>&#60;/TEXTFORMAT>&#60;TEXTFORMAT LEADING=\"2\">&#60;P ALIGN=\"LEFT\">&#60;FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FF9900\">&#60;A HREF=\"mailto:" + sarahEmail +"\">&#60;B>Sarah Armstrong&#60;/B>&#60;/A>&#60;FONT COLOR=\"#FFFFFF\"> 800.776.8383 ext. 254&#60;FONT COLOR=\"#FF9900\">&#60;/FONT>&#60;/FONT>&#60;/FONT>&#60;/P>&#60;/TEXTFORMAT>&#60;TEXTFORMAT LEADING=\"2\">&#60;P ALIGN=\"LEFT\">&#60;FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FF9900\">&#60;A HREF=\"mailto:" + charlieEmail +"\">&#60;B>Charles Steward&#60;/B>&#60;/A>&#60;FONT COLOR=\"#FFFFFF\"> Development Manager&#60;FONT COLOR=\"#FF9900\">&#60;/FONT>&#60;/FONT>&#60;/FONT>&#60;/P>&#60;/TEXTFORMAT>&#60;TEXTFORMAT LEADING=\"2\">&#60;P ALIGN=\"LEFT\">&#60;FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FF9900\">&#60;A HREF=\"mailto:" + aaronEmail +"\">&#60;B>Aaron Johnson&#60;/B>&#60;/A>&#60;FONT COLOR=\"#FFFFFF\"> Developer&#60;FONT COLOR=\"#FF9900\">&#60;/FONT>&#60;/FONT>&#60;/FONT>&#60;/P>&#60;/TEXTFORMAT>&#60;TEXTFORMAT LEADING=\"2\">&#60;P ALIGN=\"LEFT\">&#60;FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FF9900\">&#60;A HREF=\"mailto:" + tysonEmail +"\">&#60;B>Tyson Willey&#60;/B>&#60;/A>&#60;FONT COLOR=\"#FFFFFF\"> Developer&#60;FONT COLOR=\"#FF9900\">&#60;/FONT>&#60;/FONT>&#60;/FONT>&#60;/P>&#60;/TEXTFORMAT>&#60;TEXTFORMAT LEADING=\"2\">&#60;P ALIGN=\"LEFT\">&#60;FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FF9900\">&#60;A HREF=\"mailto:" + alanEmail +"\">&#60;B>Alan Pack&#60;/B>&#60;/A>&#60;FONT COLOR=\"#FFFFFF\"> Programmer&#60;FONT COLOR=\"#FF9900\">&#60;/FONT>&#60;/FONT>&#60;/FONT>&#60;/P>&#60;/TEXTFORMAT>&#60;TEXTFORMAT LEADING=\"2\">&#60;P ALIGN=\"LEFT\">&#60;FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FFFFFF\">800.776.8383 ext. 207&#60;/FONT>&#60;/P>&#60;/TEXTFORMAT>&#60;TEXTFORMAT LEADING=\"2\">&#60;P ALIGN=\"LEFT\">&#60;FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FFFFFF\">&#60;/FONT>&#60;/P>&#60;/TEXTFORMAT>&#60;TEXTFORMAT LEADING=\"2\">&#60;P ALIGN=\"LEFT\">&#60;FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FF9900\">&#60;A HREF=\"mailto:[email protected]\">&#60;B>[email protected]&#60;/B>&#60;/A>&#60;/FONT>&#60;/P>&#60;/TEXTFORMAT>&#60;TEXTFORMAT LEADING=\"2\">&#60;P ALIGN=\"LEFT\">&#60;FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FFFFFF\">fax: 877.847.0120&#60;/FONT>&#60;/P>&#60;/TEXTFORMAT>&#60;TEXTFORMAT LEADING=\"2\">&#60;P ALIGN=\"LEFT\">&#60;FONT FACE=\"_sans\" SIZE=\"12\" COLOR=\"#FFFFFF\">&#60;/FONT>&#60;/P>&#60;/TEXTFORMAT>"

    sorry for the extremely long line of text... just thought I'd reproduce my situation...

    Aaron

  12. #12
    Junior Member
    Join Date
    Jul 2002
    Posts
    14
    I just did a little more testing and it turns out that I have the same problem with other text boxes in my movie, however when I change from a mailto: url to an http:// url the links work as expected. Is there a problem launching outlook or another email client from flash (the movie isn't being embeded in an html page, so this may have some bearing on the problem)

    Aaron

  13. #13
    Senior Member chi-styler's Avatar
    Join Date
    Jul 2001
    Location
    Bristol, UK
    Posts
    1,237
    strange, i just whacked that all in a new movie, and it worked fine, clicked on a name, then new message win came up with right address in. Maybe it's something to do with your default email program setting? have you tried just a very simple example to see?

  14. #14
    Senior Member chi-styler's Avatar
    Join Date
    Jul 2001
    Location
    Bristol, UK
    Posts
    1,237
    if you go to tools -> internet options -> programs, what's email set to?

  15. #15
    Junior Member
    Join Date
    Jul 2002
    Posts
    14
    outlook express... email links work on every other website... it just doesn't register in my flash.

  16. #16
    Junior Member
    Join Date
    Jul 2002
    Posts
    14
    geturl("mailto:[email protected]");
    doesn't work either... don't know what the problem is.

  17. #17
    Junior Member
    Join Date
    Jul 2002
    Posts
    14
    I just noticed something strange... when I checked the properties... although the target field is grayed out, it shows that it is set to "s"... don't know why or how.

    Aaron

  18. #18
    Senior Member chi-styler's Avatar
    Join Date
    Jul 2001
    Location
    Bristol, UK
    Posts
    1,237
    that might be the problem, change it back to static, and take it out

  19. #19
    Junior Member
    Join Date
    Jul 2002
    Posts
    14
    still not working... I can't even break the text, mask it, and scroll it that way, and turn the links into buttons because the geturl actions aren't working for me.

    Aaron

  20. #20
    Member
    Join Date
    Apr 2001
    Posts
    39

    worked out perfectly

    thanks for the tip!

    I guess working with html in flash is a little bit trickier than just the plain old code. all the \" and character symbols.

    do you know of any good resources that go through html code with action script in flash?

    Aubrey

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