Just popped out of dormancy to ask this:

In my root class's constructor function, I make an instance of a button. How do I make it so that the button, when clicked, calls one of the root class's methods?

looks kinda like this (preçised it to just the relevant parts)... class structure is set up such that we spend all of our time in the constructor function of Invasion_5; even the main game loop is an enterFrame function that's called from within the constructor function (I suppose that's weird, but for the life of me I couldn't find a better method).

basically we call begin("menu") to bring up the menu, and what I need is for the button to call begin("game").

Code:
package {
	// import stuff
	public class Invasion_5 extends Sprite {
		// declare loads of stuff and import sprites here
		public function Invasion_5() {
			function begin(mode:String) { // begin() takes you to a different screen (like frames)
				if (mode == "menu") {
					var myButton:menuButton = new menuButton(/*some parameters*/);
					addChild(myButton);
					// this is the button I want to use.
					// when clicked, it will need to call begin("game");
				} else if (mode == "game") {
					// starts game
				}
			}
			begin("menu"); // go to menu screen
		}
	}
}
so there's the main class, and here's how my button's set up:

Code:
package {
	// import stuff
	public class menuButton extends MovieClip {
		// declare loadsa stuff
		public function menuButton(/*some parameters*/):void {
			// initiate stuff, setup eventListeners
		}
		// a few functions for handling mosueOver, mouseOut, etc
		public function mouseUp(event:Event):void {
			// button has been released
			// at this point we want it to tell the parent, Invasion_5, to call begin("game");
			// but... _how_?
		}
	}
}
I think that explains the nature of the problem. Anyone have any thoughts? Ideally something which can slip into my current, weird class structure; I know this whole begin() system of switching between states is really non-standard. But it has the advantage that the whole game stays inside that same public function, Invasion_5, rather than moving into different functions; it seems to be the only way I can carry my variables and declarations across into the next 'frame' (or some similar reason; I never really understood it myself).

could it be that events could be a solution to this? for example, dispatching an "I have been clicked" event when the button is clicked, and having my root class listen out for the event, then call begin("game"); when that happens? I played around with this and came to the conclusion that I would only be able to call one of those public function with an event listener, as opposed to begin(), which is a function declared inside a public function. so that's probably not an option.

but yeah, really having trouble with this. any ideas?