Hello, sorry for the duplicate email if you are on the FlexCoders list as
well. No one there was able to help.
I am putting together a component library and am looking for direction on
the way to include styles. I am mostly extending existing Flex components,
adding a little new functionality and new default skins. I would like for
the components to look right in Flex Builder when dragged onto a new Flex
app that uses them. Using themes doesn't allow them to look right in Flex
Builder's live preview, only in the app is run. I have put the styles into
the constructors of the components, but then they get set on a
component-by-component basis and aren't overrideable by stylesheets. I've
then put them in static functions that get called at start-up using:
var css:CSSStyleDeclaration = StyleManager.getStyleDeclaration("global") ||
new CSSStyleDeclaration("global");
css.setStyle("fontFamily", "_sans");
css = StyleManager.getStyleDeclaration ("Application") || new
CSSStyleDeclaration("Application");
css.setStyle("borderSkin", ApplicationSkin);
.....etc.
This puts the styles on the global manager instead of each component, but
they end up there after any stylesheets in your app are parsed, effectively
overriding styles set by the end app.
I have looked and looked for the solution that Adobe has (or ought to have)
provided for this. I must be looking in the wrong places. How does the
original Flex components do it? Is it a standard way available to us?
Please, if anyone can help I would be very grateful. Thanks in advance!
--
Jacob Wright
Within Code LLC