I don't know of any way to prevent an inheriting style from being inherited except to write a custom component. However, you can use CSS to your advantage by having a default style and your custom style. Apply the custom style to the outer panel and then the default style to the inner panels (which will then propagate to the inner panels' children).
 
THe following example illustrates this:
 
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">
 
 <mx:Style>
  outerStyle {
   headerColors:#CC66CC,#3366CC;
  }
  innerStyle {
   headerColors:#E1E5EB, #F4F5F7;
  }
 </mx:Style>
 
 <mx:Script><![CDATA[
 
 ]]></mx:Script>
 
 <mx:Panel className="outerStyle">
  <mx:Button id="b1" label="Button 1" />  
  <mx:Panel className="innerStyle">
   <mx:Button id="b2" label="Button 2" />  
   <mx:Panel>
    <mx:Button id="b3" label="Button 3" />  
   </mx:Panel>
  </mx:Panel>
 </mx:Panel>
</mx:Application>
 
HTH,
 
matt horn


From: Scott Barnes [mailto:[EMAIL PROTECTED]
Sent: Friday, March 11, 2005 12:19 AM
To: [email protected]
Subject: [flexcoders] mx:Panel and disabling CSS Inheritance.

Hi All,

I have an mx:Panel, with a simple headerColors=[col1,col2] approach,
easy enough.

BUT...

How do i prevent its children Panels/Controls from also inheriting
that style? At the moment the only way i can think of is to do a long
winded custom ActionScript which manipulates the instance of the
mx:Panel itself - but there has to be a better way no?

--
Regards,
Scott Barnes
http://www.mossyblog.com
http://www.flexcoder.com

Reply via email to