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=””>
<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()”/>


import mx.controls.Alert;
public function btnClicked():void
{ txtName.text );


The beautiful output:




Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s