# Why does this work / not work?

**URL:** <https://forum.kirupa.com/t/why-does-this-work-not-work/295300>\
**Category:** flash\
**Created:** [August 27, 2009, 8:30pm UTC](https://forum.kirupa.com/t/why-does-this-work-not-work/295300 "2009-08-27T20:30:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![davec](https://avatars.discourse-cdn.com/v4/letter/d/a4c791/32.png) [@davec](https://forum.kirupa.com/u/davec)\
**Post date:** [August 27, 2009, 8:30pm UTC](https://forum.kirupa.com/t/why-does-this-work-not-work/295300/1 "2009-08-27T20:30:57Z")

</div>

I have a 10 frame movieClip which I can put on the timeline in a new movie like this:

```auto
var impPanel:MovieClip = new ImpPanel();
addChild(impPanel);

var btn:SimpleButton = new TBtn();
btn.addEventListener(MouseEvent.MOUSE_UP, setFrame);
addChild(btn);

function setFrame(myFrame:String):void {
	myFrame = "i4";
impPanel.goto(myFrame);
}	

```

the impPanel clip contains the function:

```auto
function goto(val:String):void{
	gotoAndStop(val);
	hideStuff();
}

```

so sending the variable myFrame to impPanel changes the frame in the clip and hides some subclips. This all works fine.

However if I do the same thing in a more populated FLA (impPanel is one of 6 objects on the stage), I get the following: **1120: Access of undefined property impPanel.**.

Any idea why this should be happening?
