# Eval problem

**URL:** <https://forum.kirupa.com/t/eval-problem/297812>\
**Category:** Uncategorized\
**Created:** [October 8, 2009, 4:29pm UTC](https://forum.kirupa.com/t/eval-problem/297812 "2009-10-08T16:29:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulscanlon\_99](https://avatars.discourse-cdn.com/v4/letter/p/0ea827/32.png) [@paulscanlon\_99](https://forum.kirupa.com/u/paulscanlon_99)\
**Post date:** [October 8, 2009, 4:29pm UTC](https://forum.kirupa.com/t/eval-problem/297812/1 "2009-10-08T16:29:30Z")

</div>

[FONT=Arial][SIZE=1]  
[/SIZE][/FONT][FONT=Arial][SIZE=2][FONT=Arial][SIZE=1][/SIZE][/FONT][/SIZE][/FONT]  
[FONT=Arial]Hi all, if anyone can help i’d appreciate it.[/FONT][FONT=&quot][/FONT]  
[FONT=Arial]I have a set of buttons attached in a for loop, and on clicking these buttons I need to work out which sub button has been clicked.[/FONT][FONT=&quot][/FONT]  
[FONT=&quot] [/FONT]  
[FONT=Arial]for (var i = 0; i\<numOfSubClips; i++) {  
this[whatSection].attachMovie([[whatSection]+“Sub”+i],[[whatSection]+“Sub”+i],this[whatSection].getNextHighestDepth());[/FONT][FONT=&quot][/FONT]  
[FONT=Arial]  
[/FONT][FONT=&quot][/FONT]  
[FONT=Arial]this[whatSection][[whatSection]+“Sub”+i].buyBtn.onRelease = function() {[/FONT][FONT=&quot][/FONT]  
[FONT=Arial] eval(this[whatSection][[whatSection]+“Sub”+i])[/FONT][FONT=&quot][/FONT]  
_[FONT=Arial]what section will have already been set at this point nav0, or nav1, or nav2[/FONT]_

_[FONT=Arial][/FONT]_[FONT=&quot][/FONT]  
[FONT=Arial]If I trace this I get:[/FONT][FONT=&quot][/FONT]  
[FONT=Arial]\_level0.main.nav0.nav0Sub0.buyBtn[/FONT][FONT=&quot][/FONT]  
[FONT=Arial]Or [/FONT][FONT=&quot][/FONT]  
[FONT=Arial]\_level0.main.nav0.nav0Sub1.buyBtn[/FONT][FONT=&quot][/FONT]  
[FONT=Arial]Or[/FONT][FONT=&quot][/FONT]  
[FONT=Arial]\_level0.main.nav0.nav0Sub2.buyBtn[/FONT][FONT=&quot][/FONT]  
[FONT=Arial] [/FONT][FONT=&quot][/FONT]  
[FONT=Arial]This is cool but what I’d like to know is can you grab just a portion of that info. What i really need is the ‘nav0Sub0’ bit[/FONT][FONT=&quot][/FONT]  
[FONT=Arial]Can I get this out of eval or is there a better way like getProperty, \_name or something?[/FONT]
