Default styles for 3rd party components is a rough spot in Flex 3. Default styles are usually defined in a CSS type selector (see defaults.css for examples), but third parties have to do a more difficult dance since they can't append to defaults.css. There is a pattern for doing this in the docs and has been discussed on this forum. In it involves a classConstruct() function IIRC
From: [email protected] [mailto:[email protected]] On Behalf Of Amy Sent: Wednesday, January 21, 2009 9:55 AM To: [email protected] Subject: [flexcoders] Re: What determines a component's initial skin? --- In [email protected]<mailto:flexcoders%40yahoogroups.com>, Pan Troglodytes <chimpathe...@...> wrote: > > I've been dinking with extending PopUpButton and have run into something > that really puzzles me - how does it know to load PopUpButtonSkin by > default? There is no code that mentions it in PopUpButton. Is it somehow > selected based on the class name? There's a globals.css that seems to get compiled in by default. > In my PopUpButton descendant, I want it to load a different skin by > default. Do I just have to hardcode it into the constructor (or somewhere > else that initializes the component), or is there some more > standard/graceful way? I couldn't find a way to fudge this that was any easier than just having a css declaration for the subcomponent. If you want it to travel with your component, though, I suspect you'll have to put it into the constructor, since you probably don't want to assume other developers have included your style declaration in their globals.css. HTH; Amy HTH; Amy

