Reputation: 2604
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
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