Actually, I found this approach in IPE Controls by Ely Greenfield
(http://demo.quietlyscheming.com/IPE/). There are classes like this
there:

package qs.ipeControls
{
        import qs.ipeControls.classes.IPESlider;
        import mx.controls.HSlider;

        public class IPEHSlider extends IPESlider
        {
                public function IPEHSlider():void
                {
                        super();
                        editableControl = new HSlider();
                }
        }
}

In superclass IPESlider, editableControl setter is defined this way:

        protected function set editableControl(value:UIComponent):void
        {
                if(_editableControl != null)
                        removeChild(_editableControl);
                _editableControl = value;
                _editableControl.styleName = this;
                addChild(_editableControl);                             
                _editableControl.visible = _editable;
                facadeEvents(_editableControl,"dataChange");

                
_editableControl.addEventListener(FocusEvent.FOCUS_OUT,commitOnBlurHandler);
                
                invalidateDisplayList();
        }

And it works... What's wrong?

On 7/19/06, JesterXL <[EMAIL PROTECTED]> wrote:
> You're not supposed to create and add children in the constructor.  Do it in
> createChildren, like this:
>
> protected override function createChildren():void
> {
>     super.createChildren();
>
>     if ( my_txt == null)
>     {
>         my_txt = new TextInput();
>         addChild ( my_txt );
>     }
> }
>
> More info here:
> http://www.flex.org/ACDS/BuildingAFlexComponent.pdf


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Something is new at Yahoo! Groups.  Check out the enhanced email design.
http://us.click.yahoo.com/SISQkA/gOaOAA/yQLSAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to