# \[CS3\] Receiving the error: #1006 value is not a function

**URL:** https://forum.kirupa.com/t/cs3-receiving-the-error-1006-value-is-not-a-function/265531
**Category:** flash
**Created:** [July 9, 2008, 9:59pm UTC](https://forum.kirupa.com/t/cs3-receiving-the-error-1006-value-is-not-a-function/265531 "2008-07-09T21:59:33Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Gar\_Fonz](https://avatars.discourse-cdn.com/v4/letter/g/df705f/32.png) [@Gar\_Fonz](https://forum.kirupa.com/u/Gar_Fonz)
#### Post date: [July 9, 2008, 9:59pm UTC](https://forum.kirupa.com/t/cs3-receiving-the-error-1006-value-is-not-a-function/265531/1 "2008-07-09T21:59:33Z")

</div>

I have been looking around, and to no avail. Here is my code:

```auto
var btn9:SimpleButton = new title_btn();
addChild(btn9);
btn9.x = 362;
btn9.y = 216;
btn9.addEventListener(MouseEvent.MOUSE_DOWN, goto);
function goto(event:MouseEvent){
		trace(event.currentTarget.name);
}

```

and Here is my error message from the output dialogue: TypeError: Error #1006: value is not a function.  
at Fam\_fla::MainTimeline/goto()

I haven’t had any problems with eventListeners in the past, but I suspect that I am missing some fact or something about how they work-perhaps?  
I truely appreciate any help that can be offered.

---

<div class="post-metadata">

### Author: ![Gar\_Fonz](https://avatars.discourse-cdn.com/v4/letter/g/df705f/32.png) [@Gar\_Fonz](https://forum.kirupa.com/u/Gar_Fonz)
#### Post date: [July 9, 2008, 10:15pm UTC](https://forum.kirupa.com/t/cs3-receiving-the-error-1006-value-is-not-a-function/265531/2 "2008-07-09T22:15:33Z")

</div>

Thanks for your reply mattrock23. I have tried that a couple of times and I still receive the same error.

---

<div class="post-metadata">

### Author: ![Gar\_Fonz](https://avatars.discourse-cdn.com/v4/letter/g/df705f/32.png) [@Gar\_Fonz](https://forum.kirupa.com/u/Gar_Fonz)
#### Post date: [July 9, 2008, 10:21pm UTC](https://forum.kirupa.com/t/cs3-receiving-the-error-1006-value-is-not-a-function/265531/3 "2008-07-09T22:21:13Z")

</div>

Yeah, I’ve got title\_btn in the library, and it is designated to be exported for Actionscript.

---

<div class="post-metadata">

### Author: ![Gar\_Fonz](https://avatars.discourse-cdn.com/v4/letter/g/df705f/32.png) [@Gar\_Fonz](https://forum.kirupa.com/u/Gar_Fonz)
#### Post date: [July 9, 2008, 10:23pm UTC](https://forum.kirupa.com/t/cs3-receiving-the-error-1006-value-is-not-a-function/265531/4 "2008-07-09T22:23:57Z")

</div>

The other examples of this error(That I found by googling and searching Kirupa) were used in classes, and the function being called by the eventListener needed to be static. the property static is only used in classes, so it doesn’t apply to my instance. I am coding on the mainTimeline.

---

<div class="post-metadata">

### Author: ![Gar\_Fonz](https://avatars.discourse-cdn.com/v4/letter/g/df705f/32.png) [@Gar\_Fonz](https://forum.kirupa.com/u/Gar_Fonz)
#### Post date: [July 9, 2008, 10:35pm UTC](https://forum.kirupa.com/t/cs3-receiving-the-error-1006-value-is-not-a-function/265531/5 "2008-07-09T22:35:32Z")

</div>

ok, I am a moron. I didn’t post the actual code that I was having a problem with. The code I posted works, and then I took another look at the code I was having a problem with and found out that I was adding parenthesis to array.length, which calls an error.

this thread should be deleted.

I’m sorry to waste your time.
