# Error: Is not a function

**URL:** <https://forum.kirupa.com/t/error-is-not-a-function/245659>\
**Category:** flash\
**Created:** [December 2, 2007, 5:28pm UTC](https://forum.kirupa.com/t/error-is-not-a-function/245659 "2007-12-02T17:28:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![corvenus](https://avatars.discourse-cdn.com/v4/letter/c/3ab097/32.png) [@corvenus](https://forum.kirupa.com/u/corvenus)\
**Post date:** [December 2, 2007, 5:28pm UTC](https://forum.kirupa.com/t/error-is-not-a-function/245659/1 "2007-12-02T17:28:04Z")

</div>

Hi everyone,

I get the following output error:  
TypeError: Error #1006: init is not a function.  
at website\_fla::MainTimeline/website\_fla::frame1()

when i run the following code:

```auto

    public class LanguageManager {
        public function init(lang:String = null):void {
            if (lang == null)
                _currentLanguage = Languages.FRA;
            else
                _currentLanguage = lang;
        }
    }

```

The init function is called on frame 1 of the main timeline like this:

```auto
LanguageManager.init(Languages.ENG);

```

Strangely, if i define the function as being “public static” i don’t get the error.

Thanks for any advice!
