Skip to main content
Participant
November 23, 2010
Answered

How to create Hyper Link in flex

  • November 23, 2010
  • 4 replies
  • 11103 views

can you please tell me how to create Hyper Link in flex so that it need's to show hand Cursor on Mouse Over and it can abel to select the text on link.

    This topic has been closed for replies.
    Correct answer drkstr_1

    You can add a link to any RichEditableText.

    <s:RichEditableText>

         <s:content><s:p>Here is a link: <s:a href="www.google.com"</s:a></s:p></s:content>

    </s:RichEditableText>

    If you're using Flex 3, than you can use the htmlText property with an anchor tag.

    4 replies

    Participating Frequently
    June 18, 2012

    this's simplest way to do this

    you just need to set two properties true:

    buttonMode="true"

    useHandCursor="true"

    <s:Label id="home" text="HOME"  buttonMode="true" useHandCursor="true" click="home_clickHandler(event)"/>

    That's it..

    Ali

    drkstr_1
    drkstr_1Correct answer
    Inspiring
    November 23, 2010

    You can add a link to any RichEditableText.

    <s:RichEditableText>

         <s:content><s:p>Here is a link: <s:a href="www.google.com"</s:a></s:p></s:content>

    </s:RichEditableText>

    If you're using Flex 3, than you can use the htmlText property with an anchor tag.

    Adobe Employee
    November 23, 2010

    If you want the hand cursor upon mouseOver and are using RichEditableText in Flex 4, be sure to set editable=false. If editable=true (the default), you won't get the hand cursor and you will need to Ctrl+click to go to the link.

    Joan

    November 23, 2010

    @Maradolla,

    You can try this....

    /*css*/

    .linkMouseOver{
    font-family:Calibri;
    font-size:12;
    color:#357dae;
    text-decoration:none;
    font-weight:bold;
    }

    .linkMouseOut{
    font-family:Calibri;
    font-size:12;
    color:#FF0000;
    text-decoration:underline;
    font-weight:bold;
    }

    <mx:Label id="lblPrint" selectable="true" text="Print" buttonMode="true" click="navigateToURL(new URLRequest('http://www.google.com/'), '_blank')" styleName="linkMouseOut" mouseOver="{lblPrint.styleName='linkMouseOver'}" mouseOut="{lblPrint.styleName='linkMouseOut'}" textAlign="right" useHandCursor="true" buttonMode="true" mouseChildren="false"/>

    Thanks,

    Bhasker Chari.S

    MaradollaAuthor
    Participant
    November 23, 2010

    Hi Bhaskar,

    Thanks for your reply, I too tried the same way, but link is not abel to selected and not abel to copy, is there any other way to impliment same like HyperLink, so that we can perform click on that and we can select and copy the link, and we need to show hand cursor on mouseover.

    Thanks

    Ram

    Lee_Burrows
    Participating Frequently
    November 23, 2010

    if all the text is a hyperlink you can use mx:LinkButton

    Participant
    November 23, 2010

    <mx:LinkButton:id="button"
            label="
    WeCodeThings Code Library" usehandCursor='true'
            click="navigateToURL(
    new URLRequest('http://www.url.com/'), '_blank')" />

    mark this as correct answer if helpful