# TypeError: Error #1006: value is not a function. Please help

**URL:** <https://forum.kirupa.com/t/typeerror-error-1006-value-is-not-a-function-please-help/326602>\
**Category:** flash\
**Created:** [December 28, 2011, 12:11pm UTC](https://forum.kirupa.com/t/typeerror-error-1006-value-is-not-a-function-please-help/326602 "2011-12-28T12:11:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Availor](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@Availor](https://forum.kirupa.com/u/Availor)\
**Post date:** [December 28, 2011, 12:11pm UTC](https://forum.kirupa.com/t/typeerror-error-1006-value-is-not-a-function-please-help/326602/1 "2011-12-28T12:11:32Z")

</div>

Hello,

I’ve tried to figure out why this didn’t work. Please maybe someone can help me out.  
This is my code: I have 4 buttons that are named btn1, btn2, btn3, btn4.

if I do only trace(my\_btn) it returns btn1, btn2, btn3, btn4. But when I try to tell them to stop on frame, it returns  
TypeError: Error #1006: value is not a function.  
at project\_fla::MainTimeline/frame1()

This is my code

for (var i:int = 1 ; i \<= 4 ; i++ ) {  
var my\_btn = “btn”+i;  
trace(my\_btn);  
my\_btn.gotoAndStop(i);  
}

Thanks in advanced…
