Home Tutorial Flex Flex-components LinkButton in Flex

 
 

Share on Google+Share on Google+
LinkButton in Flex
Posted on: January 25, 2010 at 12:00 AM
Advertisement
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;

import mx.controls.Alert;

public var dateForm:DateFormatter;

public var date:Date;

public var dispDate:String;

public function textarea():void{

dateForm=new DateFormatter();

date=new Date();

dispDate=dateForm.format(date);

Alert.show(dispDate);

}

]]>

</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:VBox>

</mx:Panel>

</mx:Application>

 

Output:

Advertisement

Related Tags for LinkButton in Flex:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: January 25, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com