# Button Instance problem

**URL:** <https://forum.kirupa.com/t/button-instance-problem/66647>\
**Category:** flash\
**Created:** [October 7, 2004, 4:12pm UTC](https://forum.kirupa.com/t/button-instance-problem/66647 "2004-10-07T16:12:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DizzEAngel](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@DizzEAngel](https://forum.kirupa.com/u/DizzEAngel)\
**Post date:** [October 7, 2004, 4:12pm UTC](https://forum.kirupa.com/t/button-instance-problem/66647/1 "2004-10-07T16:12:30Z")

</div>

## Hi, everyone. I’m a new member, so yay to me! :love: Of course, I have a problem…

I want the following to happen: when I press my button, it should get the instance name of the button. I have the following code:

_within the instance/flash actions window_  
on(release) {  
PressButton();  
}

_within an external .as file_  
function PressButton() {  
trace(NamesButton.\_name); /_I want to get the instance name of NamesButton._/  
}

* * *

I keep getting “undefined” as my answer. Furthermore, if I put trace(this.\_name) I get nothing (as in I get black on the output window). However, if I put in a string within the trace (such as ‘Hello’), it works. So, assume everything works but the whole NamesButton.\_names part. :upset: Please help! What am I doing wrong?

Thank you guys soooo much.
