Hi, I have a custom component that I want to define styles for. What is
the best way of setting up styles? I understand that if a style has been
set, getStyle never returns undefined? So, should I have something like:

 

public class MyClass extends UIComponent

{

            public function MyClass()

            {

                        this.setStyle("borderColor", 0xFF0000);

                        this.setStyle("borderAlpha", 1.0);

            }

 

            protected override function
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void

            {

                        super.updateDisplayList(unscaledWidth,
unscaledHeight);

 

                        var borderColor:uint =
this.getStyle("borderColor");

                        var borderAlpha:number =
this.getStyle("borderAlpha");

 

                        // Now do something with these colours!

            }

}

 

Any help much appreciated!

 

Mark

 

 

 

Reply via email to