6/28/2010 11:52:28 PM
Title:
Alert box
hi all,
i want to have an alert box with the following functionalities
two buttons with continue and cancel and at the bottom i want to display note in a text box
is it possible?
plz provide the sample code?
thanks
6/29/2010 12:26:14 AM
hi all,
i want notice to be displayed below the continue and cancel buttons
plzz help..
6/29/2010 12:29:06 AM
here is the example code in actionscript 3 and flex to display an alert box with Continue and Cancel functionality
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.CloseEvent;
private function alertButtonListener(eventObj:CloseEvent):void {
if (eventObj.detail==Alert.YES) {
//code here for ok button click
}
}
]]>
</mx:Script>
<mx:Button id="myButton"
label="Show Alert"
click='Alert.yesLabel = "Continue";
Alert.buttonWidth=100;
Alert.show("Text message here.", "Alert window",
Alert.YES | Alert.CANCEL, this,
alertButtonListener, null, Alert.YES);'/>
</mx:Application>
6/29/2010 12:41:31 AM
hi Flash_Guy ,
thanks for ur early response,but dude i need the message to be displayed below the buttons as "note"
can it be done using popup manager...
6/29/2010 1:03:53 AM
is it possible by extending or overriding the alert class?
plz provide me the sample code...
thanks
6/29/2010 10:59:13 AM
I think you should extend the alert class and add a textfield for your text by overriding the createchildren function. its something like this
override protected function createChildren():void {
super.createChildren();
//add text field and position its x,y position
}