FlxGroup is a way to separate, and layer FlxObjects. This can be useful to ‘force’ your objects’ draw-order, or to help with overlap/collision detection, etc. You can optionally limit the number of objects a group can hold.

// create a FlxGroup called group, limiting it to 50 objects
var group = new FlxGroup(50);

// add sprite to group
group.add(sprite);

Demonstration

package;

import flixel.FlxG;
import flixel.FlxSprite;
import flixel.FlxState;
import flixel.group.FlxGroup;
import flixel.system.FlxAssets.FlxGraphicAsset;

class PlayState extends FlxState
{
	var groupA:FlxGroup;
	var groupB:FlxGroup;
	
	override function create()
	{
		super.create();
		
		add(groupA = new FlxGroup());
		add(groupB = new FlxGroup());
		
		for (i in 0...50)
		{
			groupA.add(createSprite("assets/bigbox.png"));
			groupB.add(createSprite("assets/sprite.png"));
		}
	}
	
	function createSprite(graphic:FlxGraphicAsset):FlxSprite
	{
		var sprite = new FlxSprite(graphic);
		sprite.x = FlxG.random.int(0, Std.int(FlxG.width - sprite.width));
		sprite.y = FlxG.random.int(0, Std.int(FlxG.height - sprite.height));
		return sprite;
	}
}