Adobe Flex

Simple Alert in Flex

Sample code to understand Alert in Flex.

Step 1:
Create a New Flex Project in a Flex Builder with Application type “None”.

Step 2:
Then MXML file will be opened and ready to start.

Go to Design View

Step 3:
Drag a Button from the Flex Component.

Step 4:
Change the label of the Button and add click event to the button using the function name.

Sample code looks like

<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”; layout=”absolute”>
import mx.controls.Alert;
private function show():void
{“You have clicked the Button”,”Message Window”);
<mx:Button x=”271″ y=”84″ label=”Click Me” click=”show()”/>

Step 5:
Thats it all done.

Output looks


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