Sharp Mind

one more blog for people who like to work in flex

Adding color to application background

I was running through a simple tutorial for loading XML into Flex and displaying it in a thumbnail when I got the following error:

appBgCol.mxml


<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
	<mx:Script>
		<![CDATA[
		import mx.events.ColorPickerEvent;
		public function changeEvt(event:ColorPickerEvent):void
		{
			var clrs:Array = new Array();
			/*
			IF YOU WANT GRADIENT COLORS FOR BACKGROUND
			clrs.push(0x990000);
			clrs.push(myCP.selectedColor);
			this.setStyle("backgroundGradientColors",clrs);
			*/
			this.setStyle("backgroundColor",myCP.selectedColor);
		}
		]]>
	</mx:Script>
	<mx: Panel width="80%" height="80%" >
		<mx:ColorPicker id="myCP" change="changeEvt(event);"/>
	</mx: Panel>
</mx:Application>


appbgcol.jpg
appbggradient.jpg

January 2, 2008 - Posted by Kanu Wadhwa | Flex | | No Comments Yet

No comments yet.

Leave a comment