This content has been marked as final. Show 4 replies
you assign a value to the 'name' property of each button and use getChildByName() method to get a reference to the component. Once you've this reference all you need to do is to pass it to removeChild() method.
of course, alternatively, you can keep the references of all the dynamically generated buttons in an array or something like that and then you don't have use getChildByName() method.
oh, well! looking at your code, if buttons are the only components on your container you can use removeChildAt() method.
You add and delete based on objects. So in your code above you lose the ability to delete all the buttons, and can only delete the last, which is represented by videoButton:
Thanks-- all of these replies were useful.