LinkButton in Flex


 

LinkButton in Flex

In the current tutorial you will come to know about the LinkButton control of Flex. The Adobe LinkButton in Flex is much like the hyperlink option of HTML. It helps us to open a URL in a web browser. tag is used to define this control. The examples will help you to learn LinkButton more effectively

In the current tutorial you will come to know about the LinkButton control of Flex. The Adobe LinkButton in Flex is much like the hyperlink option of HTML. It helps us to open a URL in a web browser. tag is used to define this control. The examples will help you to learn LinkButton more effectively

LinkButton in Adobe Flex:

The LinkButton in Flex is much like the hyperlink option of HTML. It helps us to open a URL  in a web browser. <mx:LinkButton> tag is used to define this control.

We can put an id to this component if we intend to refer this control elsewhere in the current MXML file or ActionScript file. Whenever we move the mouse pointer over the button the color of the button changes. Following examples will help you to learn LinkButton in details:

Flex LinkButton Example:

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

<mx:Script>

<![CDATA[

import mx.controls.Alert;

public function textarea():void{

txtarea.text="Hello";

}

]]>

</mx:Script>

<mx:Panel width="200" height="200" title="LinkButton Example" horizontalCenter="10" verticalCenter="10">

<mx:VBox horizontalAlign="center" width="100%" height="100%">

<mx:LinkButton label="Click Me" click="textarea();"/>

<mx:TextArea id="txtarea"/>

</mx:VBox>

</mx:Panel>

</mx:Application>

 

Output:

Example:

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

<mx:Script>

<![CDATA[

import mx.formatters.DateFormatter;

0

import mx.controls.Alert;

public var dateForm:DateFormatter;

public var date:Date;

1

public var dispDate:String;

public function textarea():void{

dateForm=new DateFormatter();

2

date=new Date();

dispDate=dateForm.format(date);

Alert.show(dispDate);

3

}

]]>

</mx:Script>

4

<mx:Panel width="200" height="200" title="LinkButton Example" horizontalCenter="10" verticalCenter="10">

<mx:VBox horizontalAlign="center" width="100%" height="100%">

<mx:LinkButton label="Click Me" click="textarea();"/>

5

</mx:VBox>

</mx:Panel>

</mx:Application>

6

 

Output:

7

Ads