RE: [flexcoders] Re: Custom Component Styles

2007-02-27 Thread Stephen Gilson
Hi Graham,
 
Isn't that similar to the example in the docs here:
http://livedocs.adobe.com/flex/201/html/skinstyle_149_7.html
 
Stephen
 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of g_odds
Sent: Monday, February 26, 2007 11:55 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Custom Component Styles



It would appear the link I gave is broken. But nevermind, I have
found the solution by delving through the framework source code, where
the developers do it differently from what is documented in the Live
Docs.

The solution is to use something along the lines of:

private static var stylesInitialised:Boolean = initStyles();

private static function initStyles():Boolean {
var sd:CSSStyleDeclaration =
StyleManager.getStyleDeclaration(AreaZoom);

if (!sd)
{
sd = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration(AreaZoom, sd, false);
}

sd.defaultFactory = function():void
{
this.borderColour = 0x017C98;
this.borderAlpha = 1;
this.fillColour = 0x96CEFD;
this.fillAlpha = 0.2;
}

return true;
}

Graham

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, g_odds [EMAIL PROTECTED] wrote:

 I have been looking through the Adobe documentation for a few hours
 now and have no suggestion of how to achieve what I want to do. I
 have a custom component that has some custom style attributes. I
 would like these style attributes to have default values. So, I
 followed what is described in the Live Docs

(http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/js/html/wwhelp.h
tm?href=Part2_DevApps_048_1.html
http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/js/html/wwhelp.h
tm?href=Part2_DevApps_048_1.html ).
 
 All is fine and dandy, except for a (rather major?) problem. This
 method of setting defaults forces someone using the component to set
 all the style values or none, because if they set a single style
 attribute the default values are not set for any of the other
 attributes. Am I missing something or is this styling malarky
 complicated?
 
 Cheers,
 
 Graham




 


Re: [flexcoders] Re: Custom Component Styles

2007-02-26 Thread Mike Britton

Graham,

You may also want to take a look at this:
http://www.scalenine.com/

You'll need the Flex 2.1 update to use it.

hth,

Mike Britton