i believe my question is quite simple: I have a string, for example,
" this is a string containing silly characters like " and <<< and >>> and hey look a hyperlink http://www.google.com"
My question is how can I prepare this string to be displayed on an MXML view, using AS3?
any help is greatly appreciated!
http://forums.adobe.com/thread/756042
http://cookbooks.adobe.com/post_Hyperlink_Control-13867.html
These link gives you a information about how to create single link without any text like
http://www.google.com/
May these link will be helpfull to create a link!But you problem looks different, so first you have to make html string with all of the text and where you want a link at that point you must put a
<A>
tag with required attribut and where you want a special character you must use its hex code or escape sequence of html like for & =&
. my meaing is to say that make a html string without head tag. then give this string to<s:RichEditableText>
see example.First Way.
<s:RichEditableText> <s:content> <s:p> Here is a link: <s:a href="www.google.com"</s:a> </s:p> </s:content> </s:RichEditableText>
Second way.
//Your Actionscript code.
[Bindable] private var _testString:String= "<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="16" COLOR="#000000" LETTERSPACING="0" KERNING="0">" this is a string containing silly characters like <and > they look a hyperlink <FONT COLOR="#0000FF"><A HREF="http://www.google.com" TARGET="_blank"><B><I><U>http://www.google.com</U></I></B></A></FONT>"</FONT></P></TEXTFORMAT>";
// your mxml content
Good Luck!