Using a FlxTypedGroup
will allow you to specify the class that will be contained in the group (FlxGroup
is an alias for FlxTypedGroup
<FlxBasic
>).
This can be very useful when passing group-members to functions without having to cast
them.
// create a FlxTypedGroup called group, specifying that is contains Sprite objects, and has a maximum of 10
var group = new FlxTypedGroup<Sprite>(10);