Home Tutorial Flex Flex4 Components TextInput in Flex4

 
 

Share on Google+Share on Google+
TextInput in Flex4
Posted on: April 22, 2010 at 12:00 AM
Advertisement
TextInput control is a Text entry control that allows the user to enter and edit the uniformatted text in a single line

TextInput in Flex4:

TextInput control is a Text entry control that allows the user to enter and edit the uniformatted text in a single line. A new Text Layout Framework (TLF) is used in Flex4 for text editing with high quality typography. In Flex4 TextInput control uses the new Text Layout Framework(TLF).

TextInput control uses the String property for entering the value. The user can format the text by using CSS styles like fontStyle, width, height and fontWeight etc. The minimum size of TextInput Control is 2*2 pixels , maximum size 10000*10000 pixels while default size is 188*22 pixels. The tag of TextInput is <s:TextInput/>.

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">

<fx:Script>

<![CDATA[

import mx.controls.Text;

public function text():void{

var text1:Text = new Text();

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

myVGroup.addElement(text1);

}

]]>

</fx:Script>

<s:Panel title="TextInput control Example" width="254" height="161">

<s:VGroup horizontalAlign="center" paddingLeft="5" paddingTop="5" id="myVGroup" x="12" y="3">

<s:HGroup>

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

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

</s:HGroup>

<s:HGroup>

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

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

</s:HGroup>

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

</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 TextInput 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 22, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com