# Shorten the length of "e.target.name"?

**URL:** <https://forum.kirupa.com/t/shorten-the-length-of-e-target-name/321377>\
**Category:** flash\
**Created:** [April 18, 2011, 4:01pm UTC](https://forum.kirupa.com/t/shorten-the-length-of-e-target-name/321377 "2011-04-18T16:01:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manx\_Mariner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@Manx\_Mariner](https://forum.kirupa.com/u/Manx_Mariner)\
**Post date:** [April 18, 2011, 4:01pm UTC](https://forum.kirupa.com/t/shorten-the-length-of-e-target-name/321377/1 "2011-04-18T16:01:11Z")

</div>

Is there an easy way to shorten the length of a target name? As you can see in the code below I have added “\_snd” to “e.target.name”.

Let’s say “e.target.name” equals “square\_1” so the code below returns “square\_1\_snd”, when the square is clicked on.

What I want to know is how do I get “square\_snd” to return?

I would think if you can do (e.target.name + “\_snd”) then you could do (e.target.name - “\_1” + “\_snd”), to get just (square\_snd), but it doesn’t work.

```php

var ClassReference:Class = getDefinitionByName(e.target.name + "_snd") as Class;
	var mySound = new ClassReference();
	mySound();

```
