A new pause menu thing.

I missed the old FlxPause way of working. When you hit the p key and a pop up showed up. I had a few uses for that in mind. Then for some reason it was taken out with newer and newer versions of flixel. So subsequently, when I needed one of my own, and I saw a class of somebody elses that looked similar, I just modified it to fit my needs. As far as using this, here's an example in use:

package;

import nme.Assets;
import nme.geom.Rectangle;
import nme.net.SharedObject;
import org.flixel.FlxButton;
import org.flixel.FlxG;
import org.flixel.FlxPath;
import org.flixel.FlxSave;
import org.flixel.FlxSprite;
import org.flixel.FlxState;
import org.flixel.FlxText;
import org.flixel.FlxU;
import org.flixel.plugin.photonstorm.FlxMath;


class MenuState extends FlxState
{
	
	public var text:TypeText;
	
	public var pauze:FlxPauze;
	
	public var logo:FlxSprite;
	//Set this to 1 to display the message first thing. You can tie this to a 
	// key press too!
	public var startMessage:Int = 0;
	

	
	override public function create():Void
	{
		
		#if !neko
		FlxG.bgColor = 0xff9191FF;
		#else
		FlxG.camera.bgColor = {rgb: 0x9191FF, a: 0xff};
		#end		
		#if !FLX_NO_MOUSE
		FlxG.mouse.show();
		#end
		
		//add it here
		text = new TypeText(10, 200, FlxG.width, "Hello World \n Second line test", textCallback, "assets/data/beep.mp3");
		text._showing = false;
		text.fallback = textCallback;
		add(text);
		
		logo = new FlxSprite(180,64).loadGraphic("assets/data/logo.png", false);
		add(logo);
		
		
		
		//Don't forget it needs to be on top of everything else.
		pauze = new FlxPauze();
		!pauze.showing;
		//add(pauze);
		//pauze.kill();
	}
	
	override public function destroy():Void
	{		
		super.destroy();
	}

	override public function update():Void
	{
		
		//If the dialogue box is showing, stop everything else and just update the
		// dialogue box. Useful for tutorials and other things. Like pausing or menus.
		//Again, this too can be set to a key bind!
		//if (!text._showing && !pauze.showing)		
		if (!pauze.showing)		
		{
			
			
			
			//Stuff that happens after the text is done.
			logo.velocity.y += FlxG.elapsed*60;
		
		
		super.update();
		
		
		//Condition to activate the text. Can be anything. Player passing a sign.
		//Player talking to an npc, score certain number, etc.
		if (FlxG.keys.justPressed("ONE") && !pauze.showing) 
			{
				startMessage = 1;
				if (startMessage == 1 )
				{
					
					//Just showing the text won't work. You need to make a new object.
					//Which, isn't a problem since your going to kill the object when your done with it.
					text = new TypeText(10, 200, FlxG.width, "Hello World \n Second line test", textCallback, "assets/data/beep.mp3");
					text._showing = true;
					text.fallback = textCallback;
					add(text);
					
					
				}
			}
		
		
		if (FlxG.keys.justPressed("SPACE")) 
			{
				
				pauze = new FlxPauze();
				pauze.showing = true;
				add(pauze);
				
			}
		
			
			
			
		} else
		{
			

			
			pauze.update();
			
			//If we're not paused, update the text! Or, anything else. I think.
			if (!pauze.showing) text.update();
			
			
		}
		
		
	}	
	
	private function textCallback():Void
	{
		//If using kill, this does not show. However, since _showing is not tied
		//to the visible state of the object, the text object itself doesn't go away.
		
		
		text.resetMessage("Hello Again World!");
		!text._showing;
		startMessage = 2;
		after();
	}
	
	private function after():Void
	{
		
		text.kill();
	}
	
	
	
}

Enjoy!