Showing 1 - 1 of 1 total. RSS Feed WordPress RSS Feed

On This Page:

  1. 1  Extending a custom component

    Extending a custom component

    If you are trying to extend a custom component and you get the following error

    "Multiple sets of visual children have been specified for this component (base component definition and derived component definition)."

    the problem is that you have created an MXML component with some children hardcoded;

    Surfing the net I've found an interesting discussion here but the solution provided there hasn't convinced me at all.

    After some attempts I've finally found a nice solution that is not to hardcode components inside the MXML but create components using actionscript and then add them to the displayList in the createChildren method.
    override protected function childrenCreated():void{

    super.childrenCreated();

    if(!btn){

    btn = new Button();
    btn.label = "my as button";
    addChild(btn);

    }

    }
    Showing 1 - 1 of 1 total. RSS Feed WordPress RSS Feed

    On This Page:

    1. 1  Extending a custom component