Adding custom class to object


For the game I am making, I’m using a self-made sprite managing system.
I’ve got three classes: SpritesManager, SpriteGroup extends Movieclip and Sprite extends Movieclip.
The idea is: SpritesManager is holding an object: “mainSprites”, SpritesManager also has
a method “newGroup”, wich creates a new SpriteGroup in mainSprites.
In this way I want to make a system for creating and managing some sort of Movieclip-tree.
For example: mainSprites.enemies.badEnemy

The method newGroup in SpritesManager has a param “name” wich is the name of the SpriteGroup to create.
Here’s where I’m stuck: how do I create a new SpriteGroup referenced to as “name” in mainSprites? :puzzle:

Maybe a stupid question, but this is my first attempt at writing classes.

Thx, Josflos