# Removing a dynamic scrollpane

**URL:** <https://forum.kirupa.com/t/removing-a-dynamic-scrollpane/330216>\
**Category:** Uncategorized\
**Created:** [December 14, 2012, 11:03pm UTC](https://forum.kirupa.com/t/removing-a-dynamic-scrollpane/330216 "2012-12-14T23:03:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![capdetrons](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@capdetrons](https://forum.kirupa.com/u/capdetrons)\
**Post date:** [December 14, 2012, 11:03pm UTC](https://forum.kirupa.com/t/removing-a-dynamic-scrollpane/330216/1 "2012-12-14T23:03:29Z")

</div>

Hi,  
how do you remove a scrollpane created dynamically?  
I have tried a couple of ways but can’t find any examples on the net.  
this.createObject(“ScrollPane”, “cspScrollPane”, this.getNextHighestDepth());  
this.destroyObject(“cspScrollPane”); will not work and adding a listener like the one example in flash 8 won’t either.  
I know you could create it inside a empty clip and then get rid of the clip, but I’d like to know if there’s a way for the sake of learning.
