Apparently you want your action on a button, so you'd need the button's event handler.
on (release) {
_root.gotoAndPlay(2);
}

gparis