# Removing Parts of a MC Name

**URL:** <https://forum.kirupa.com/t/removing-parts-of-a-mc-name/219232>\
**Category:** flash\
**Created:** [March 14, 2007, 11:12pm UTC](https://forum.kirupa.com/t/removing-parts-of-a-mc-name/219232 "2007-03-14T23:12:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DeletedUser12345](https://avatars.discourse-cdn.com/v4/letter/d/9d8465/32.png) [@DeletedUser12345](https://forum.kirupa.com/u/DeletedUser12345)\
**Post date:** [March 14, 2007, 11:12pm UTC](https://forum.kirupa.com/t/removing-parts-of-a-mc-name/219232/1 "2007-03-14T23:12:08Z")

</div>

Hey all,

I need to remove parts of a movieclip name for an application I’m developing. In this application, clicking on one of the movieclips will trace out its name (and eventually pass the name to another function as an argument). When I click on the MC, it will trace out as “I clicked \_level0.mcName”. That’s fine for now, but when I have to pass the mcName to another function, I will have to get rid of the \_level0 part on the front. Can anyone help me with that?

Here’s my code:

```php

var teaArray:Array = new Array(); // holds all tea names and benefits
var teaMovieClips:Array = new Array(); // array to hold the names of the tea MCs

// Each tea gets its own array to hold the names of the benefits.
lemongrassArray = new Array("choice1", "choice2", "choice3");
chamomileArray = new Array("choice1", "choice2");

// Push each tea's array into teaArray, which will store everything
teaArray.push({teaName: "Lemongrass", teaBenefits: lemongrassArray});
teaArray.push({teaName: "Chamomile", teaBenefits: chamomileArray});

// For loop to give each teaName a blue-colored rectangle-shaped MC
for (var i:Number = 0; i < teaArray.length; i++) {
	teaMovieClips* = attachMovie("mcTea", teaArray*.teaName, _root.getNextHighestDepth());
	teaMovieClips*._x = Math.floor(Math.random() * (550-1));
	teaMovieClips*._y = 100 + Math.floor(Math.random() * (400 - 101));
	teaMovieClips*.txtTeaName.text = teaArray*.teaName;
	teaMovieClips*.onRelease = function() {
		trace("I clicked " + this);
	};
};

```

And my trace statement:

```auto

I clicked _level0.Chamomile
I clicked _level0.Lemongrass

```

And here is a link to [my FLA file](http://a.parsons.edu/~jrandolph/internetapps/teaChart.fla) if you want to download and try it out.

Thanks a lot!
