For the code below, this is the scenario:
1) two button symbols with instance names btn1 and btn2 are placed inside a movieclip that has a linkage ID of MC.
2) there is a scrollpane on the stage with an instance name sp
3) The code below is placed on the main timeline (or whatever timeline sp is in). This way, the buttons' code can directly address the main timeline to do something.
sp.source = "MC"; // place the movieclip in the scrollpane
var menuClip:Object = sp.content; // get a target for the MC inside sp
// add event listeners/handler functions to the buttons in the MC inside the sp
menuClip.btn1.addEventListener(MouseEvent.CLICK, btn1Click);
menuClip.btn2.addEventListener(MouseEvent.CLICK, btn2Click);
function btn1Click(evt:MouseEvent):void {
gotoAndPlay(45);
}
function btn2Click(evt:MouseEvent):void {
trace("btn2 clicked");
}