Well…this is embarrassing, but….what does this code do? Been working on this game for three years and can’t remember why I wrote this code…
WG_Game(parent).ServiceExitToMainMenu();
WG_Game is my game Class and ServiceExitToMainMenu is a non-static public function within WG_Game. This line of code is in my WG_Pause Class and is executed when the player leaves the game during a pause.
private function MaskFadeIn(e:Event):void
{
if (fadeMask.alpha > 0.5) fadeMask.alpha += 0.1; else fadeMask.alpha += 0.15;
if (fadeMask.alpha > 1.0)
{
fadeMask.alpha = 1.0;
fadeMask.removeEventListener(Event.ENTER_FRAME, MaskFadeIn);
exitToMainMenu = true;
if (destFrame == "ReStart") replay = true;
WG_Game(parent).ServiceExitToMainMenu();
}
}
More specifically…what does the (parent) do that enables me to call a function in the WG_Game Class from the WG_Pause Class? and the function being called is not static.