tags:

views:

17

answers:

0

I have a Custom SkinnableContainer that has nothing but 4 custom style properties on it. I have then given it a default Skin. which works fine. In the skin I have this :-

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

                updateTailSize();

                bgColor.color = hostComponent.getStyle("bgColor");
                strokeColor.color = hostComponent.getStyle("strokeColor");

                bgRect.radiusX = cornerRadius;
                bgRect.radiusY = cornerRadius;

                pathData = createPathData();

                super.updateDisplayList(unscaledWidth,unscaledHeight);
            }

The problem is that the defined in the Skin draws some line that go outside the bounds of the Skin's width/height. And that triggers another call to updateDisplayList() and that sends it in an infinite loop. Unless I explicitly set the width and height from outside. even 100% does not work. obviously that's not good.

what's the way around this ? I can only draw the Path after i know the width and height of the component.... it's late in the night and I can't think straight...hence, this question.