Home Tutorial Flex Flex4 Components Button in Flex4

 
 

Share on Google+Share on Google+
Button in Flex4
Posted on: April 21, 2010 at 12:00 AM
Advertisement
The rectangular button is usually used by the Button component in Flex 4 which looks like to be suppressed.

Button in Flex 4:

The rectangular button is usually used by the Button component in Flex 4 which looks like to be  suppressed. The text label is the default label of this button.Whenever the select the control button to perform any actioin, it uses event listeners. As soon as the button control is clicked through mouse, it  enables and dispatches a click event and a buttonDown event. A button can perform various events like  mouseMove, mouseOver, mouseOut, rollOver, rollOut, mouseDown, and mouseUp events whether it is enabled or disabled.

The button size ranges between minimum 21*21pixels to 10000*10000 pixels maximum.

Example: 

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

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

xmlns:s="library://ns.adobe.com/flex/spark"

xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%">

<fx:Script>

<![CDATA[

import mx.controls.Text;

public var text1:Text = new Text();

public function text():void{

text1.text = "My Name is::"+myTextInput1.text;

myVGroup.addElement(text1);

}

public function text12():void{

myTextInput1.text="";

text1.text="";

}

]]>

</fx:Script>

<s:Panel title="Button control Example"

width="250" height="160" x="18" y="18">

<s:VGroup horizontalAlign="center" paddingLeft="5" paddingTop="5"

id="myVGroup"  x="28" y="9">

<s:HGroup>

<s:Label text="Enter Name :"/>

<s:TextInput id="myTextInput1" width="100" />

</s:HGroup>

<s:Button id="submit" label="Submit" click="text()"/>

<s:Button id="reset" label="Reset" click="text12()"/>

</s:VGroup>

</s:Panel>

</s:Application>

Output: 

Running Application:

To view this page ensure that Adobe Flash Player version 10.0.0 or greater is installed.

Download this code

Advertisement

Related Tags for Button in Flex4:


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: April 21, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com