Many times when creating dynamic effects or especially in Flash video games, you'll find yourself pulling movieclips from the library dynamically, or loading them in from outside .SWFs. These are done using the attachMovie or loadMovie methods. Each of these methods require that you load the new movieclip on a specific layer.
In Flash, everything that appears visually on the screen exists in it's own layer. Say, for example, you had a Flash Asteroids game. If the player ship is on level 10 and you then load a new asteroid into level 10, the player's ship will be removed from the game.
Keeping track of levels can be a simple process if you only have one object attaching movieclips. But in situations where you may have multiple objects managing multiple movieclips, there needs to be an organized way of keeping everything on a unique level.
The technique I use most often is one that I got from Sham Bhangal a few years ago. The technique is basically to set a global variable to a reasonably high number that you know nothing in your movie already exists in (I usually use 10,000 or 100,000) and then every time you need to attach a movie, you call a function that returns that global number and then increments it by one, so the next time you call the function, you get a new unique number.