# Error #1006 .... not a function?

**URL:** <https://forum.kirupa.com/t/error-1006-not-a-function/286277>\
**Category:** Uncategorized\
**Created:** [April 13, 2009, 8:44am UTC](https://forum.kirupa.com/t/error-1006-not-a-function/286277 "2009-04-13T08:44:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![quicksmack](https://avatars.discourse-cdn.com/v4/letter/q/fbc32d/32.png) [@quicksmack](https://forum.kirupa.com/u/quicksmack)\
**Post date:** [April 13, 2009, 8:44am UTC](https://forum.kirupa.com/t/error-1006-not-a-function/286277/1 "2009-04-13T08:44:14Z")

</div>

i am trying to run 2 functions on the timeline from inside a movieclip and i cannot seem to understand why the “removeCharacter” function works while the “tlHolderReset” wont… flash gives me a message “tlHolderReset is not a function. at police1/::frame4()”

i have two movieclips in the library called “police1” and “police2”… they both have a “stop();” action on frame 1 and the following code on frame 4:

```auto
stop();
Object(root).removeCharacter(); //This works
Object(root).tlHolderReset(); // <<<< THIS IS MY PROBLEM

```

when the user clicks on the movieclip, it should play… and once it hits frame 4, the code above should run…

on the main timeline, this is the code…

```auto
var characterArray:Array = [new police1(), new police2()];

tlHolderReset();
var tl_holder:MovieClip;

function tlHolderReset():void
{
    tl_holder = new HolderClass();
    stageholder.addChild(tl_holder);
    tl_holder.x = 116
    tl_holder.y = 69

    var tl_timer:Timer = new Timer(3000, 1);
    tl_timer.addEventListener(TimerEvent.TIMER, ac_TL);
    tl_timer.start();
}

function ac_TL(event:TimerEvent):void
{
    var tl_character = characterArray[Math.floor(Math.random() * characterArray.length)];
    tl_holder.addChild(tl_character);
    tl_character.addEventListener(MouseEvent.MOUSE_DOWN, handleTarget);
}

function handleTarget(event:MouseEvent):void
{
    event.target.play();
}

function removeCharacter():void
{
    tl_holder.removeEventListener(Event.ENTER_FRAME, TL_window);
    stageholder.removeChild(tl_holder);
}

```
