6 Replies Latest reply on Sep 8, 2010 1:17 PM by Ron Colmen

    Add mailto:

    Ron Colmen Level 2

      How do I add mailto: to msgA[7] with a subject line (BC Sports)?


      my_txt2.htmlText +="<a href='asfunction:loadText,"+msgA[0]+",,"+msgA[0]+newline+msgA[1]+newline+msgA[2]+'  '+msgA[3]+'  '+msgA[4]+newline+msgA[5]+newline+'Contact: '+msgA[6]+newline+'Email: '+msgA[7]+"'>"+msgA[2]+"</a><br>";

        • 1. Re: Add mailto:
          Ned Murphy Adobe Community Professional & MVP

          I'm curious what you are expecting that to look like and work like when all those msgA[] elements are added in... it does not resemble any hyperlink format I've ever worked with.


          Other than that, I can't be sure what you really want, so here's the general form of adding a subject to a mailto...


          msgA[7] = "mailto:somebody@somewhere.com?subject=BC%20Sports";

          • 2. Re: Add mailto:
            Ron Colmen Level 2

            Thanks Ned. But doesn't seem to work correctly (when clicked on msgA[7]it gives a different email address in outlook). This is my code. I need to make the msgA[7] click-able in my_text2 with the mailto: function.



            receiveLoad.onData = function(src) {

                 var messageA:Array = src.split(",,,");


            var charCount = 0;

                 var formatIndices = new Array();



                 for(var i:Number=0; i<messageA.length; i++){

                       var msgA:Array = messageA[i].split(",,");

                       my_txt.htmlText +=msgA[0]+"<br>"+msgA[1]+"<br>"+msgA[2]+"  "+msgA[3]+"  "+msgA[4]+"<br>"+msgA[5]+"<br><b>Telephone: </b>"+msgA[6]+"<br><b>Email |  </b><a href='mailto:"+msgA[7]+"'>"+msgA[7]+"<\a><br><br><br>";

                       my_txt2.htmlText +="<a href='asfunction:loadText,"+msgA[0]+",,"+msgA[0]+newline+msgA[1]+newline+msgA[2]+'  '+msgA[3]+'  '+msgA[4]+newline+msgA[5]+newline+'Telephone: '+msgA[6]+newline+'''Email: '+'mailto:'+msgA[7]+'?subject=BC%20Sports'+"'>"+msgA[0]+"</a><br>";

               formatIndices[i] = {startAt: charCount, endAt: charCount+msgA[0].length};

                       charCount = my_txt.text.length;


            • 3. Re: Add mailto:
              Ned Murphy Adobe Community Professional & MVP

              I still have no idea what that all is supposed to look like when it's all filled out, especially since I have no idea what all the msgA values are, so I can't really offer any help beyond having answered the question you initially asked.  If the wrong address is being planted in the email, I have nothing to offer as to what it is to begin with.

              • 4. Re: Add mailto:
                Ron Colmen Level 2

                Oops! I've only pasted a part of my code. Below is the remaining few lines.


                function formatF(tf:TextField,s:String,tfor:TextFormat):Void{




                function loadText(s:String) {

                    var a:Array = s.split(",,");

                     fin_txt.text = a[1];






                when msgA[0] in my_txt2 is clicked, the relevant data is been pulled from a mysql db and shows the results in my_txt.


                Hope this is clear now. How do I add the mailto: function and subject line in my_txt2?



                • 5. Re: Add mailto:
                  Ned Murphy Adobe Community Professional & MVP

                  My response doesn't change.  If you can't show what that all looks like when the data gets processed into the textfields (what the actual html code looks like when it's all in there), there isn't much I can offer.  As I mentioned up front, I have not seen an html anchor tag that contains anything of the sort of the mixture you seem to be putting in it.

                  • 6. Re: Add mailto:
                    Ron Colmen Level 2




                    In my code the <a> tag to creates the link and the asfunction executes the actionscript to load the data.