My first Flex program

Flex is important tool to develop Rich Internet Applications(RIA). RIAs can be developed using Ajax, OpenLaszlo, Silverlight(??) etc. Today I started working on Flex and created my first Flex program. The example is simple. There is a Panel with a Textfield and a Button. Whenever a button is clicked or when enter is pressed on the textfield, a message appears with the content of the textfield.

The code is as follows:

<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml”>
<mx:Panel id=”panel” title=”Flex” ><mx:VBox id=”vbox” verticalAlign=”middle” horizontalAlign=”center” width=”203″ height=”84″>

<mx:TextInput id=”txtName” text=”Enter Something” enabled=”true” enter=”btnClicked()” />
<mx:Button id=”btnClick” label=”Click here” click=”btnClicked()”/>

</mx:VBox>
</mx:Panel>
<mx:Script>

<!&#91;CDATA&#91;
import mx.controls.Alert;
public function btnClicked():void
{
    Alert.show( txtName.text );
}

&#93;&#93;>



The beautiful output:

blog11.png

blog21.png

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s