Search Flex Components Free

Custom Search

December 25, 2007

Flex Alert Window Source Code Sample

Flex Panels and Windows Sample Source Code:
Create a file:


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

<mx:Application xmlns:mx="" backgroundAlpha="0" xmlns="*">


import mx.controls.Alert;
private function clickHandler(event:Event) : void
{"Do you want to save your changes?", "Save Changes", 3, this,
if (event.detail==Alert.YES)
status.text="You answered Yes";
status.text="You answered No";
}, null, Alert.YES);


<mx:Panel width="100%" height="100%" horizontalAlign="center" paddingTop="20">
<mx:Text text="Click the button below to display a simple Alert window" width="100%" textAlign="center"/>
<mx:Button label="Click Me" click="'Hello World!', 'Message')"/>

<mx:Text text="Click the button below to display an Alert window and capture the button pressed by the user" width="100%" textAlign="center"/>
<mx:Button label="Click Me" click="clickHandler(event)"/>
<mx:Label id="status"/>


Related Flex Tutorials