Hyperlinking In FLEX

June 24, 2008

Hi,

 

Probably Hyperlinking is one of the most commonly seen thing to navigate to other page.

But to write this ppost here i thanks to one of mine Orkut friends querry.

 

For such querries i am always welcome.. So lets get on with example

 

The label, text, and textarea controls can dispatch a link event when the user selects a hyperlink in the Htmltext property.

 

About link Event :

 

link : Dispatched when a user clicks a hyperlink in an HTML-enabled text field, where the URL begins with "event:".

 

To generate the link event, prefix the hyperlink destination with event:

 

 As the following example shows

 

<?xml version=”1.0″?>

 

<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml”

    borderStyle=”solid”

    backgroundGradientColors=”[#FFFFFF, #FFFFFF]“>

   

    <mx:Script>

        <![CDATA[

            import flash.events.TextEvent;

 

            public function linkHandler(event:TextEvent):void {

                myLabel.text="link occured.";

                // Open the link in a new window.

                navigateToURL(new URLRequest(event.text), '_blank');

            }

        ]]>

    </mx:Script>

   

    <mx:Label selectable=”true” link=”linkHandler(event);”>

        <mx:htmlText><![CDATA[<a href='event:http://www.adobe.com'>Adobe</a>]]></mx:htmlText>

    </mx:Label> 

 

    <mx:TextArea id=”myLabel”/>

</mx:Application>

 

 

Thanks and regards

 

Shashank Kulkarni

 

Feel free to mail me J shashank.pawan@gmail.com

Entry Filed under: Best of Flex Utillity. Tags: , .

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Blogroll

Date

June 2008
M T W T F S S
« Apr   Aug »
 1
2345678
9101112131415
16171819202122
23242526272829
30  

Tags

Recent Comments

shashankkulkarni on Unit Testing with FlexUni…
Kris on Unit Testing with FlexUni…
Adi Reddy on About
How I Lost Thirty Po… on Adobe Flex Builder 3 is F…
shashankkulkarni on Flex Builder cannot locate the…

Pages

Category Cloud

1 Best of Flex Utillity FLEX Flex(Amazing Errors) Meaning of Shashank

Top Clicks

Top Posts

Blog Stats

Recent Posts

Categories