# Problem w/ function targeting movie clip

**URL:** <https://forum.kirupa.com/t/problem-w-function-targeting-movie-clip/175549>\
**Category:** Uncategorized\
**Created:** [January 15, 2006, 6:36pm UTC](https://forum.kirupa.com/t/problem-w-function-targeting-movie-clip/175549 "2006-01-15T18:36:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![CBarraford](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@CBarraford](https://forum.kirupa.com/u/CBarraford)\
**Post date:** [January 15, 2006, 6:36pm UTC](https://forum.kirupa.com/t/problem-w-function-targeting-movie-clip/175549/1 "2006-01-15T18:36:46Z")

</div>

hey everyone. So I am trying to get this button to run my function. Here is my code

```auto
load = function (target_mc:MovieClip) {
    this.onEnterFrame = function():Void {
        this._parent.mcViewer.gotoAndStop(this._parent.mcViewer._currentframe - 1);
        if (this._parent.mcViewer._currentframe == 1) {
            delete onEnterFrame;
            this._parent.mcViewer.ladybug._visible = false;
            this._parent.mcViewer.muzac._visible = false;
            this._parent.mcViewer.saks._visible = false;
            this._parent.mcViewer.snowflake._visible = false;
            this._parent.mcViewer.bmg._visible = false;
            this._parent.mcViewer.career3._visible = false;
            this._parent.mcViewer.career4._visible = false;
            this._parent.mcViewer.macys._visible = false;
            this._parent.mcViewer.rockefeller._visible = false;
            this._parent.mcViewer.pats._visible = false;
            this._parent.mcViewer.play();
            this._parent.mcViewer.target_mc._visible = true;
        }
    }
}

```

the function is being called and run ok. The problem is when i call “load(pats);” later on, the movieclip “pats” does not turn visible. Anyone know how to run a function with a targeted movieclip?
