# Remove instance of movieclip with click?

**URL:** <https://forum.kirupa.com/t/remove-instance-of-movieclip-with-click/305596>\
**Category:** Uncategorized\
**Created:** [February 28, 2010, 6:50am UTC](https://forum.kirupa.com/t/remove-instance-of-movieclip-with-click/305596 "2010-02-28T06:50:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mick\_special](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@mick\_special](https://forum.kirupa.com/u/mick_special)\
**Post date:** [February 28, 2010, 6:50am UTC](https://forum.kirupa.com/t/remove-instance-of-movieclip-with-click/305596/1 "2010-02-28T06:50:05Z")

</div>

Hi

I am using a loop to add 10 shapes to the stage, then i just want to click on one at a time, in any random order and make it alpha 0, im using this code… it gets rid of some shapes but not all. i dont get it?

```auto
var shape:MovieClip;

for (var i:Number = 0; i < 10; i++)
	{
	shape = new ShapeW();
	var randomX:Number = Math.random() * 550;
	addChild(shape);
	shape.rotation = i*4;
	shape.x = randomX;
	shape.y = randomX;
	shape.addEventListener(MouseEvent.CLICK, changeColour);
	}

function changeColour(e:MouseEvent):void
{
	
	e.target.alpha = 0;
}

```

any help would be sweet!
