# Remove displaylist object created in different class

**URL:** <https://forum.kirupa.com/t/remove-displaylist-object-created-in-different-class/286471>\
**Category:** Uncategorized\
**Created:** [April 15, 2009, 11:34pm UTC](https://forum.kirupa.com/t/remove-displaylist-object-created-in-different-class/286471 "2009-04-15T23:34:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![phastings](https://avatars.discourse-cdn.com/v4/letter/p/e9bcb4/32.png) [@phastings](https://forum.kirupa.com/u/phastings)\
**Post date:** [April 15, 2009, 11:34pm UTC](https://forum.kirupa.com/t/remove-displaylist-object-created-in-different-class/286471/1 "2009-04-15T23:34:51Z")

</div>

Hi,  
I’m kind of new to as3 and am having an issue with the display list. i have two classes:  
videoPlayer(Document class) and videoControls(which is added to the stage by videoPlayer).

videoControls put an object on the stage at some point:

dp = new displayEnd();  
dp.name=“dpe”;  
addChild(dp);

the issue is that there’s a function in videoPlayer that i want to check for and remove the “dpe” at some later point if it’s on the stage. so in videoPlayer i use:

if (getChildByName(“dpe”)) {  
removeChild(getChildByName(“dpe”));  
}

any idea why this isn’t working? oh i have:  
public var dp;

set in videoControls.
