# Adding and Removing opaque child seems to layer?

**URL:** <https://forum.kirupa.com/t/adding-and-removing-opaque-child-seems-to-layer/238174>\
**Category:** flash\
**Created:** [September 7, 2007, 9:03pm UTC](https://forum.kirupa.com/t/adding-and-removing-opaque-child-seems-to-layer/238174 "2007-09-07T21:03:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Psaldorn](https://avatars.discourse-cdn.com/v4/letter/p/22d042/32.png) [@Psaldorn](https://forum.kirupa.com/u/Psaldorn)\
**Post date:** [September 7, 2007, 9:03pm UTC](https://forum.kirupa.com/t/adding-and-removing-opaque-child-seems-to-layer/238174/1 "2007-09-07T21:03:48Z")

</div>

Evening all,  
I come humbly before you to ask for assistance.

I currently have a map beacon on my map (natch) and have a toggle button that shows the user how far their character can move, displayed as a 0.2 opaque circle, centred on them.

I want this to be togglable, to prevent lots of data clouding the UI. I have made a button in my interface that, depending on the button’s state (up/down) will hide/show the circle.

I am using removeChild() to remove it, and also set it to null as recommended elsewhere. Delete doesn’t work because of it’s nature (dynamically drawn from a value in database)

I then use a method of my Map class to redraw/attach the circle. I thought this all worked fine, until I just started flipping the button repeatedly… and noticed the colour gradually getting darker.

I check each button press and it is only calling the creation method… so presumably the previously removed circle is still lurking? To test I commented out the creation code and just left the addChildAt() line in, whihc did nothing, as expected. Also tried specifically targeting it with getChildByName() and it returns null, as I expected.

I can’t seem to access the ‘opacity’ property, so I can’t see if it’s something there (the opacity is hard-coded, shouldn’t be altered by other things.

Any ideas are gratefully welcomed. Have a nice Friday 🙂
