Copy link to clipboard
Copied
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>";
Copy link to clipboard
Copied
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";
Copy link to clipboard
Copied
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.
senderLoad.sendAndLoad("http://www.web.com/my.php",receiveLoad,"POST");
receiveLoad.onData = function(src) {
var messageA:Array = src.split(",,,");
messageA.pop();
var charCount = 0;
var formatIndices = new Array();
my_txt.html=true;
my_txt2.html=true;
for(var i:Number=0; i<messageA.length; i++){
var msgA:Array = messageA.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 = {startAt: charCount, endAt: charCount+msgA[0].length};
charCount = my_txt.text.length;
}
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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{
tf.setTextFormat(tf.text.indexOf(s),tf.text.indexOf(s)+s.length,tfor);
}
function loadText(s:String) {
var a:Array = s.split(",,");
fin_txt.text = a[1];
formatF(fin_txt,a[0],format1);
}
};
B:
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?

Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
In my code the <a> tag to creates the link and the asfunction executes the actionscript to load the data.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more