Why does this work / not work?

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

var impPanel:MovieClip = new ImpPanel();

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

function setFrame(myFrame:String):void {
	myFrame = "i4";

the impPanel clip contains the function:

function goto(val:String):void{

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?