# Trouble Targeting Clip

**URL:** <https://forum.kirupa.com/t/trouble-targeting-clip/179544>\
**Category:** flash\
**Created:** [February 21, 2006, 4:24am UTC](https://forum.kirupa.com/t/trouble-targeting-clip/179544 "2006-02-21T04:24:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pyromunky](https://avatars.discourse-cdn.com/v4/letter/p/8e8cbc/32.png) [@pyromunky](https://forum.kirupa.com/u/pyromunky)\
**Post date:** [February 21, 2006, 4:24am UTC](https://forum.kirupa.com/t/trouble-targeting-clip/179544/1 "2006-02-21T04:24:13Z")

</div>

I’m having trouble targeting a clip using variables. All the code works, except the lines targeting the clip. “currentMenu” and “nextMenu” keep coming up undefined. The following code is on the root timeline, targeting a clip embedded in the mainClip instance. Can someone tell me what is wrong with my syntax?

```auto

this.onEnterFrame = function() {
    if (currentNum != nextNum) {
        currentMenu = this["menuClip_"+currentNum];
        nextMenu = this["menuClip_"+nextMenu];
        mainClip.currentMenu.targetFrame = 2;
        if (mainClip.currentMenu._currentframe == 3) {
            mainClip.nextMenu.targetFrame = 31;
            currentNum = nextNum;
        }
    }
};

```
