Giving same/different color for border & background of Flex Alert control

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

<!-- giving colors to the text, border & background of an alert control-->

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
	layout="absolute"
	width="320"
	height="240"
	backgroundGradientColors="[#ffffff, #b0b0ff]"
	>

	<mx:Style>
		Alert{
			/*Change this to give different background colors
			{where the alert message is displayed}
			backgroundColor: #ffffff;*/

			backgroundColor: #b0b0ff;
			borderColor: #b0b0ff;
			color: #000000;
		}
	</mx:Style>

	<mx:Script>
		<![CDATA[
			import mx.controls.Alert;

			private var _alert:Alert;

			private function showAlert():void{
				_alert = Alert.show("The Alert message goes here","The Alert title goes here");
			}
		]]>
	</mx:Script>

	<mx:Button label="Show Alert" click="showAlert()" x="116" y="109"/>

</mx:Application>

Actions

Information

One response

22 10 2008
Justin

Wow! worked like a charm, Thanks :)
The look is really great, thanks for this article.

Leave a comment