Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Asign  custom skin for mx.containers.panel in Flex 3

Posted on 2011-10-11
4
Medium Priority
?
693 Views
Last Modified: 2012-05-12
Asign  custom skin for mx.containers.panel in Flex 3
0
Comment
Question by:hokyux
  • 2
  • 2
4 Comments
 
LVL 29

Expert Comment

by:dgofman
ID: 36953385
It's very simple.
You can create your custom class and override from HalloBorder or Panel skin class

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
	
	<mx:Script>
		<![CDATA[
			import mx.skins.halo.HaloBorder;
			import mx.skins.halo.PanelSkin;
		]]>
	</mx:Script>
	<mx:Panel width="100%" height="50%" borderSkin="{HaloBorder}"/>
	<mx:Panel width="100%" height="50%" borderSkin="{PanelSkin}"/>
</mx:Application>

Open in new window

0
 

Author Comment

by:hokyux
ID: 36964372
Sorry Sage, but I dont know nothing about Flex 3,

I would know it doit by Flex 4,
create a custom skin in mxml with hostcomponent to  spark.panel
and finally asigna  this custom skin to my  panel.skinclass

but for flex 3,
I need the entire example for asign custom skin to my  mx.container.panel(  flex 3)
the reason is because I am using FlexLib  for my project
in order to implement MDI ( sub windows into my main frame container)
beside I am using spark component for my App, MDI container uses flex 3 panels.


or the other good question is how to build MDI applications for Flex 4 with out FlexLib,
because its MDIWindow is very uggly. made in flex 3

0
 
LVL 29

Accepted Solution

by:
dgofman earned 1500 total points
ID: 36965720
I don't know how do you want to styling border skin for your Panel component, but here is example how can I override default background of PanelSkin if you will change in my skin class variable
var overrideAll:Boolean = false; to true. My code will create an yellow background
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
	<mx:Panel width="100%" height="50%" borderSkin="{CustomPanelSkin}"/>
</mx:Application>

Open in new window

CustomPanelSkin.as

package
{
	import flash.display.Graphics;
	
	import mx.core.mx_internal;
	import mx.skins.halo.PanelSkin;
	
	use namespace mx_internal;

	public class CustomPanelSkin extends PanelSkin
	{
		public function CustomPanelSkin(){
			super();
		}
		
		override mx_internal function drawBackground(w:Number, h:Number):void
		{
			super.drawBackground(w, h);
			var overrideAll:Boolean = false;
			if(overrideAll){
				var g:Graphics = graphics;
				g.clear();
				g.beginFill(0xffff00, 1);
				g.drawRect(x, y, w, h);
				g.endFill();
			}
		}
	}
}

Open in new window

0
 

Author Closing Comment

by:hokyux
ID: 37086631
HAve to read a lot
0

Featured Post

A Cyber Security RX to Protect Your Organization

Join us on December 13th for a webinar to learn how medical providers can defend against malware with a cyber security "Rx" that supports a healthy technology adoption plan for every healthcare organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
Often times it's very very easy to extend a volume on a Linux instance in AWS, but impossible to shrink it. I wanted to contribute to the experts-exchange community a way of providing a procedure that works on an AWS instance. It can also be used on…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month21 days, 4 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question