# \[FMX\]Please some explanation on substr

**URL:** <https://forum.kirupa.com/t/fmx-please-some-explanation-on-substr/109304>\
**Category:** Uncategorized\
**Created:** [May 4, 2004, 12:04pm UTC](https://forum.kirupa.com/t/fmx-please-some-explanation-on-substr/109304 "2004-05-04T12:04:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dboers](https://avatars.discourse-cdn.com/v4/letter/d/bbe5ce/32.png) [@dboers](https://forum.kirupa.com/u/dboers)\
**Post date:** [May 4, 2004, 12:04pm UTC](https://forum.kirupa.com/t/fmx-please-some-explanation-on-substr/109304/1 "2004-05-04T12:04:11Z")

</div>

For quite some time I use the following code to control, behaviors of some buttons and other content:

```auto
for (var i in this) {
if (this*._name.substr(0, 4) == "btn_") {
setKnop(this*._name);
}
}
 
function setKnop(clip) {
var clip = eval(clip);
clip.onRollOver = function() {
new Color(clip).setRGB(0x000000);
}; 

```

Etc, etc.

I used this code because somebody adviced me to do so. So in this case btn\_ is always followed by some other name. Now I bought the book Foundation actionscript from FriendsOfEd and they advice to use btn as a suffix “\_btn” as well as Colin Moock did in his book Actionscript the definite guide.

Is there somebody who can explain me a little bit more about the use of “\_name, substr” etc

What i would like to find out is how the this code:

```auto
_name.substr (0, 4) 

```

would look like if I start working with btn as suffix, as the adviced in the mentioned books?

Thanks in advance 😉
