# Dynamic naming question

**URL:** <https://forum.kirupa.com/t/dynamic-naming-question/63631>\
**Category:** Uncategorized\
**Created:** [September 8, 2004, 4:25pm UTC](https://forum.kirupa.com/t/dynamic-naming-question/63631 "2004-09-08T16:25:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stermer](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@stermer](https://forum.kirupa.com/u/stermer)\
**Post date:** [September 8, 2004, 4:25pm UTC](https://forum.kirupa.com/t/dynamic-naming-question/63631/1 "2004-09-08T16:25:01Z")

</div>

ok, so i have this movie clip, that i am having duplicate and give the dynamic name of (“butt” + g), g being the variable. i need to later reference this number for that button name. so i was doing this

bigpic=String(this.\_name);  
r=bigpic.charAt(4);

which was working fine, up until i got up to number 10, the first two digit number. since it was only pulling the 4th character, it was reading anything in the teens and 1 and anything in the 20’s as 2. now is there a way to pull one, or two numbers from this string? or can i have it pull the string name - butt?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 10, 2004, 3:15pm UTC](https://forum.kirupa.com/t/dynamic-naming-question/63631/2 "2004-09-10T15:15:28Z")

</div>

i would name them  
"butt\_" + the number…

then to reference later:

bigpic=String(this._name);  
tRef = bigPic.split("_")  
r= Number(tRef[1])

this way you will always get the full number back correctly.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 10, 2004, 3:29pm UTC](https://forum.kirupa.com/t/dynamic-naming-question/63631/3 "2004-09-10T15:29:13Z")

</div>

haha. that’s exactly how i figured out how to do it yesterday, i even used the “\_”. great minds think alike huh?
