# Checking if MC exists

**URL:** <https://forum.kirupa.com/t/checking-if-mc-exists/289094>\
**Category:** Uncategorized\
**Created:** [May 26, 2009, 10:44am UTC](https://forum.kirupa.com/t/checking-if-mc-exists/289094 "2009-05-26T10:44:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![monkeyrock](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@monkeyrock](https://forum.kirupa.com/u/monkeyrock)\
**Post date:** [May 26, 2009, 10:44am UTC](https://forum.kirupa.com/t/checking-if-mc-exists/289094/1 "2009-05-26T10:44:42Z")

</div>

I have a gallery loading jpegs from an xml file into a mc called mainPicArea, on frame 5. I have other content on frames 1,2,3,4,6,7.

I want to run an if statement to check whether mainPicAreaexists and if it does, then run a removeChild(mainPicArea), and if not do nothing.

[AS]  
if (MovieClip.mainPicArea){  
trace(“exists”);  
//removeChild(mainPicArea);  
}else{  
trace(“doesent exist”);  
}  
[/AS]

this is my code.

When I test, it comes back with the trace “doesent exist”, even though it does exist.

Any ideas much apreciated
