header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
nannu
Points:0
Posts:0

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



1
nannu
Points: 0
Posts:0
6/29/2010 12:26:14 AM



hi all,

i want notice to be displayed below the continue and cancel buttons

plzz help..

2
Flash_Guy
Points: 850
Posts:0
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>


3
nannu
Points: 0
Posts:0
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...

4
nannu
Points: 0
Posts:0
6/29/2010 1:03:53 AM



is it possible by extending or overriding the alert class?

plz provide me the sample code...

thanks

5
Hatim
Points: 0
Posts:0
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

}


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 8+8 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions