# removeMovieClip()

**URL:** https://forum.kirupa.com/t/removemovieclip/199102
**Category:** Uncategorized
**Created:** [August 31, 2006, 3:03am UTC](https://forum.kirupa.com/t/removemovieclip/199102 "2006-08-31T03:03:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Nineteen](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/nineteen/32/2679_2.png) [@Nineteen](https://forum.kirupa.com/u/Nineteen)
#### Post date: [August 31, 2006, 3:03am UTC](https://forum.kirupa.com/t/removemovieclip/199102/1 "2006-08-31T03:03:52Z")

</div>

My Code:

```auto

//Pic Number
var picNumber:Number = 1;
preload.onLoadComplete = function(targetMC:MovieClip) {
    hideLoad();
    var myPic = "pic"+picNumber+"_mc";
    targetMC.active = true;
    targetMC.onRelease = function() {
        if(this.active == true) {
            _root.attachMovie("myPic", myPic, _root.getNextHighestDepth());
            targetMC.active = false;
        }
        else {
            _root.myPic.removeMovieClip();
            targetMC.active = true;
        }
    }
    picNumber++;
    play();
};

```

How can I make ‘myPic’ work as the Variable Name - Not the Instance Name…  
Eg: myPic should = pic1\_mc, the instance name… But instead it thinks myPic _is_ the instance name when it isn’t ☹

Anyone able to help please?
