# Help with removing and duplicating movieclip

**URL:** <https://forum.kirupa.com/t/help-with-removing-and-duplicating-movieclip/221619>\
**Category:** Uncategorized\
**Created:** [April 5, 2007, 5:42pm UTC](https://forum.kirupa.com/t/help-with-removing-and-duplicating-movieclip/221619 "2007-04-05T17:42:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![smith1302](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@smith1302](https://forum.kirupa.com/u/smith1302)\
**Post date:** [April 5, 2007, 5:42pm UTC](https://forum.kirupa.com/t/help-with-removing-and-duplicating-movieclip/221619/1 "2007-04-05T17:42:53Z")

</div>

i have this function that everytime i click the screen a box appears.

function box () {  
\_root.onMouseDown = function(){  
movie = \_root.attachMovie(“mcBox”, “mcBox”, \_root.getNextHighestDepth());  
movie.\_x = \_xmouse;  
movie.\_y = \_ymouse;  
}  
}

how can i make it so i only have one box on the screen at a time  
like this

if (there is a box on the screen) {  
function = false  
} else { continue function; }

i cant figure out how to do that in actionscript.
