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. __._,_.___


SPONSORED LINKS
Custom software development Database development software Embedded software development
Offshore software development Software development


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to