5/6/2010 9:12:26 PM
Title:
Alternative to alertwindow
AlertWindow stops the entire background action. Anyother alternative for alertwindow in flex?
Inder
Points: 2980
Posts:0
5/6/2010 10:01:59 PM
No alternative required you can pass a flag in Alert Window to disable its background so that while Alert window is being showed you are able to click on the background components. here is how to pass the flag to disable Modal.
alert = Alert.show("The quick brown fox jumped over the lazy dog.", "title", 0x8000);
5/6/2010 10:34:32 PM
Hi Deepa, You can popup a title window. Here's the code:
MainFile.mxml:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Canvas id="cnv" width="301" height="182" x="390" y="182" backgroundColor="#F45353" borderColor="#0191F5" borderStyle="solid" borderThickness="3">
<mx:Button id="btn" click="popUpMsg()" label="Create Pop Msg" x="90.5" y="79" color="#FB0202"/>
</mx:Canvas>
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
private function popUpMsg():void{
PopUpManager.createPopUp(this, TitleWin);
}
]]>
</mx:Script>
</mx:Application>
TitleWin.mxml File:
<?xml version="1.0"?>
<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" showCloseButton="true" width="394" height="198" horizontalAlign="center" verticalAlign="middle">
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
private function RemoveMsg():void {
PopUpManager.removePopUp(this);
}
]]>
</mx:Script>
<mx:HBox width="360" height="52" verticalAlign="middle" horizontalAlign="center">
<mx:Button click="RemoveMsg();" label="OK" width="99" height="36" fontSize="16"/>
<mx:Spacer id="spc" width="44" height="8"/>
<mx:Button click="RemoveMsg()" label="Cancel" width="111" height="38" fontSize="16"/>
</mx:HBox>
</mx:TitleWindow>
I think this will solve your problem of "stop application".
So like this, you can use other components also.
Regards:
ANKUSH
5/6/2010 11:47:32 PM
But when we use alertwindow we cannot customize for our needs rt?.When we customize a window is it possible to resize. Do u have any example for window customisation?
5/7/2010 2:00:57 AM
you can always resize a window by giving width and height properties ? what kind of customization do you require
5/7/2010 2:39:10 AM
When we use alert it stops background action and show it blur,there is not cacel,minimum or maximum in that window.
I want the same functionality of alert , it should not allow any other action to perform but should not be in blur, should have cancel button
5/7/2010 3:08:38 AM
you can have cancel button in Alert window , also you can set the background blur to false and transparency to 0 to make the background elements visible and not look blur. The back ground elements are disabled. Also the cancel button is there. If you need minimise and maximise functionality you may have to extend the Alert class to add such functionality or use popUpwindow.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="init()">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
private function init():void{
Alert.show("This Alert is without backgroud Blur and everything else disabled", "Alert with cancel",0x0008);
}
]]>
</mx:Script>
<mx:Style>
Alert{
modal-transparency-blur:false;
modal-transparency:0;
}
</mx:Style>
<mx:Button x="31" y="46" label="Button"/>
</mx:Application>
5/7/2010 3:24:20 AM
Thanks Dave. But don't want the cancel button. I meant cancel (x) at the top right corner of the window.
5/7/2010 6:43:42 AM
then you can use the method suggested by ankush. Open a popupwindow and add functionality like this in it