# removeChlid();

**URL:** <https://forum.kirupa.com/t/removechlid/296471>\
**Category:** flash\
**Created:** [September 15, 2009, 1:11pm UTC](https://forum.kirupa.com/t/removechlid/296471 "2009-09-15T13:11:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![becher](https://avatars.discourse-cdn.com/v4/letter/b/ecb155/32.png) [@becher](https://forum.kirupa.com/u/becher)\
**Post date:** [September 15, 2009, 1:11pm UTC](https://forum.kirupa.com/t/removechlid/296471/1 "2009-09-15T13:11:46Z")

</div>

Hi everybody,

need really help with removing movie clip from another movie clip. I’m not as3 coder at all, so any help will be really appreciated.

**Heres my code:**

[COLOR=“DarkRed”]stop();

import flash.utils.\*;

setInterval(showMessage,10000);

function showMessage(){

gotoAndPlay(2);  
}

//Create an empty Array with the name movieArray  
var mainmovieArray:Array = new Array();

//Put the MovieClips into the Array  
//The size of this Array is now 5  
mainmovieArray = [“yemimain”, “nobrumain”, “angeemain”, “nickmain”, “marekmain”];

// Declare variable to use later  
var myMainMovieClip:MovieClip;

if ((mainmovieArray[Math.floor(Math.random() \* 5)]) == “yemimain”) {  
// Create a new MovieClip  
myMainMovieClip = new yemimain();

} else if ((mainmovieArray[Math.floor(Math.random() \* 5)]) == “nobrumain”) {  
// Create a new MovieClip  
myMainMovieClip = new nobrumain();

} else if ((mainmovieArray[Math.floor(Math.random() \* 5)]) == “angeemain”) {  
// Create a new MovieClip  
myMainMovieClip = new angeemain();

} else if ((mainmovieArray[Math.floor(Math.random() \* 5)]) == “nickmain”) {  
// Create a new MovieClip  
myMainMovieClip = new nickmain();

} else if ((mainmovieArray[Math.floor(Math.random() \* 5)]) == “marekmain”) {  
// Create a new MovieClip  
myMainMovieClip = new marekmain();

} else { // In case the random number is 1  
myMainMovieClip = new yemimain();

}

MAINemptyMC\_mc.addChild(myMainMovieClip);

// Add the new MovieClip to the empty MovieClip  
// so that we can see it.

// Set the location if required  
MAINemptyMC\_mc.x = 605;  
MAINemptyMC\_mc.y = 131;[/COLOR]

…

It puts random movie clips to **MAINemptyMC\_mc** and then after time loop it jumps on previous empty frame and whole procedure starts again. Problem is, I probably (not sure if it is the problem) have to remove **myMainMovieClip** from **MAINemptyMC\_mc** somehow because otherwise after few loop it starts kind of jamming… See your self at [http://www.danceacademy.cz/fdemo.html](http://www.danceacademy.cz/fdemo.html)

Thank u very much in advance
