PDA

View Full Version : var string into html tags



lolomedia
January 5th, 2009, 05:52 PM
hello everyone,

I have an issue I have been dealing with for a couple of days now... can't seen to figure this one out...

I have a var string that I would like to make sure is linkable here is my code

ActionScript Code:

public static function getEmail(meetingDetails:MeetingDetails,confRoom:Co nferenceRoom):String {
var iphoneUrl:String = meetingDetails.url.replace("https", "fuze");
var info:String = "Click the following link:\n" +
<a href="iphoneUrl">iphoneUrl</a> + ;
return info;
}



so what this does is open your email client and the body will be already fill out with bunch of meeting info, so you can click send or edit this email. my issue is that the iphonUrl is not translated properly... all i'm getting is the following:

To join the web meeting thru your iPhone:

Click the following link:
iphoneUrl

so there is no link... the link is a unique protocol : fuze://fuzeweb.someapp.com/blabla/444

so my question is how can i make this line completely linkable

ActionScript Code:

<a href="iphoneUrl">iphoneUrl</a> + "\n\n" +

ayumilove
January 5th, 2009, 07:35 PM
Mini example. Paste this in your .fla to try it out.


var ayumiText:TextField = new TextField;
ayumiText.text = "HelloWorld";
ayumiText.addEventListener(MouseEvent.CLICK, linkHandler);
addChild(ayumiText);


function linkHandler(e:MouseEvent):void {
navigateToURL(new URLRequest("http://www.kirupa.com/"), "_self");
}//linkHandler{}


Useful links:
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/events/TextEvent.html#LINK
http://troyworks.com/blog/2008/03/14/flash-textfield-actionscript-hyperlink-in-as30/

lolomedia
January 5th, 2009, 07:48 PM
I know that would def work but i won't be displaying this on a .swf but instead this will be translated into text into the email client of the user. then the user will be able to modify the email if he or she wants then send.

so in that case... having an event listener won't work once you see your text on your email client...

any other suggestions... i just need that string variable to be translated into a link which throws fuze://callwave.com/blablabla/103 so my problem is that fuze:// is not being underlined or linkable... :h:

ayumilove
January 6th, 2009, 08:48 AM
If its plain text, I don't think this can be done.
If its a html, probably you could assign a variable to hold the value "<href=>"
and the link "http://kirupa.com" and another variable to hold </a>

and it will be shown it will be presented as <a href="http://kirupa.com">Hello World</a>

and the other stuff will be interpreted by the email, if it supports those tags like how a forum would do.

BenBart
January 6th, 2009, 08:54 AM
hello everyone,

I have an issue I have been dealing with for a couple of days now... can't seen to figure this one out...

I have a var string that I would like to make sure is linkable here is my code

ActionScript Code:

public static function getEmail(meetingDetails:MeetingDetails,confRoom:Co nferenceRoom):String {
var iphoneUrl:String = meetingDetails.url.replace("https", "fuze");
var info:String = "Click the following link:\n" +
<a href="iphoneUrl">iphoneUrl</a> + ;
return info;
}



so what this does is open your email client and the body will be already fill out with bunch of meeting info, so you can click send or edit this email. my issue is that the iphonUrl is not translated properly... all i'm getting is the following:

To join the web meeting thru your iPhone:

Click the following link:
iphoneUrl

so there is no link... the link is a unique protocol : fuze://fuzeweb.someapp.com/blabla/444

so my question is how can i make this line completely linkable

ActionScript Code:

<a href="iphoneUrl">iphoneUrl</a> + "\n\n" +



If you are making a link the actual link is where it says href="link goes here". No clue if you can use that funky protocal, but a link in html would be like this:


<a href="fuze://fuzeweb.someapp.com/blabla/444">iphoneUrl</a>