override public function drawFocus(isFocused:Boolean):void
    {
        if (isFocused)
        {
            // For some composite components, the focused object may not
            // be "this". If so, we don't want to draw the focus.
/*
*when the component is not added to the stage, focusManager is null for
that component. so following condition has to be replace as this *
*if (!drawFocusAnyway && focusManager &&  focusManager.getFocus() != this)*
*/
            if (!drawFocusAnyway && focusManager.getFocus() != this)
                return;

            if (!focusObj)
            {
                var focusSkinClass:Class = getStyle("focusSkin");

                if (focusSkinClass)
                    focusObj = new focusSkinClass();

                if (focusObj)
                    super.addChildAt(focusObj, 0);
            }
            if (focusObj && "target" in focusObj)
                focusObj["target"] = this;
        }
        else
        {
            if (focusObj)
                super.removeChild(focusObj);
            focusObj = null;
        }
    }

-- 
*
Regards,
S. Jagan  Langa*

Reply via email to