Hi Gordon,
Thanks for the clarification!
Yes, the double hit on file size makes sense, that is why I am trying to get
the css file approach correct. I am having some issues with it and assets.
One other thing.
You have the defaults, how do I create something similar and 'compile it in'
when I make the SWC file.
I have had no luck with the library project doing this. Embeded assets inside
the css file were not getting included. In a linked directory the css file in
the library project wasn't even getting recognized and compiled into the SWC.
Any thoughts?
Is there any one that could give a 'quick and dirty' procedural step process
for the benefit of this list?
Peace, Mike
On 8/8/06, Gordon
Smith <[EMAIL PROTECTED]com>
wrote:
This approach is fine,
and it's what the mx.charts classes do.
But for the standard Flex
components, we decided to use the defaults.css approach instead. That makes it
possible to restyle them easily by editing a single CSS file. Also, if they get
styled in this way via autogenerated code, there is no need to have the
superceded class-initialization-code-that-sets-up-styles, which adds
to SWF size.
- Gordon
Hi, knock knock, echo, echo
Can any Adobe peoplz tell me why
putting a variation of the following in a component class to initializes styles
is bad?
// SizerOverlay
style = StyleManager.getStyleDeclaration
("SizerOverlay");
if (!style)
{
style = new
CSSStyleDeclaration();
StyleManager.setStyleDeclaration("SizerOverlay",
style, false);
}
if ( style.factory == null)
{
style.factory =
function():void
{
this.cornerRadius = 5;
this.fillAlpha = 1;
this.fillColor = 0xffcc00;
this.horizontalCursorXOffset = -9;
this.horizontalCursorYOffset = -5;
this.leftDiagonalCursorXOffset = -9;
this.leftDiagonalCursorYOffset = -8;
this.realtimeResize = true;
this.realtimeResizeAlpha = 0;
this.rightDiagonalCursorXOffset = -9;
this.rightDiagonalCursorYOffset = -5;
this.sizerAlpha = 1;
this.sizerClientButtonRenderer = com.teotiGraphix.managers.sizerManagerClasses.SizerOverlayButton;
this.sizerOverlayAlpha = 0;
this.sizerOverlayOffset = true;
this.sizerOverlaySkin = mx.skins.halo.ButtonSkin;
this.sizerOverlayThickness = 10;
this.verticalCursorXOffset = -9;
this.verticalCursorYOffset = -9;
};
}
Since this is what the compiler actually does anyway.
Specifically,
// SizerOverlay
style = StyleManager.getStyleDeclaration("SizerOverlay");
if (!style)
{
style = new
CSSStyleDeclaration();
StyleManager.setStyleDeclaration("SizerOverlay",
style, false);
}
I am not really agreeing with littering my classes with if() checks everywhere
for default styles.
Maybe something is not thought through all the way. If I am wrong, can someone
from Adobe please clarify the exact procedure for initializing default styles
and skins for a commercially distributed component?
Peace, Mike
--
What goes up, does come down.
--
What goes up, does come down.