# Simple string handling

**URL:** <https://forum.kirupa.com/t/simple-string-handling/245510>\
**Category:** flash\
**Created:** [November 30, 2007, 12:37pm UTC](https://forum.kirupa.com/t/simple-string-handling/245510 "2007-11-30T12:37:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ubermeowmix](https://avatars.discourse-cdn.com/v4/letter/u/7cd45c/32.png) [@Ubermeowmix](https://forum.kirupa.com/u/Ubermeowmix)\
**Post date:** [November 30, 2007, 12:37pm UTC](https://forum.kirupa.com/t/simple-string-handling/245510/1 "2007-11-30T12:37:11Z")

</div>

Doesnt seem to be so simple

Trying to take the string value of a button passed to a function and add “\_mc” on the end! It just keeps returning undefined? Any ideas?

function openBox(){  
var newName = this.split("\_level0.");  
trace(newName);  
var newName2 = newName.split(“Btn”);  
trace(newName2);  
var newName3 = newName2+"\_mc";  
//\_root[newString].\_visible = true;  
trace(newName3);  
}

It’s not even working when I switch to substr
