Yordan Yanakiev
Yordan Yanakiev

Reputation: 2604

Flex Button missing its skin inside itemRenderer class

I have tried to create an instance of Button class inside an itemRenderer element instance, but the button instance appears without its skin. can someone explain me :

override protected function createChildren():void
{
    super.createChildren();

    btnControl           = new Button();
    btnControl.x         = 2;
    btnControl.y         = 22;
    btnControl.minHeight = 18;
    btnControl.minWidth  = 50;
    btnControl.height    = 18;
    btnControl.width     = Number( undefined );
    btnControl.label     = "контрол";
    btnControl.addEventListener( MouseEvent.CLICK, onBtnControlClick );
}

Upvotes: 0

Views: 386

Answers (1)

RIAstar
RIAstar

Reputation: 11912

As far as I can tell from your code you're not adding the button to the displayList. Add

addElement(btnControl);

at the end if this is a Spark component you're extending; if it's an mx component use

addChild(btnControl);

Upvotes: 1

Related Questions