I'm having a weird problem with sounds interrupting each other in an AS3 game.
Each enemy in the game world has a movieclip containing its graphics and sounds; game code calls gotoAndPlay() to play a particular animation with corresponding sound. (the movieclips are made in Flash and the .swc is imported into a Flashdevelop project)
The problem is that when more than one instance of a particular type of enemy is onscreen at the same time, their sounds "stomp" on each other: if enemies A and B are of the same type, and A is in the middle of playing a sound, B won't be able to play that sound -- gotoAndPlay results in correct animation, but the sound doesn't play.
Similarly, if A is playing a looping sound and B plays a frame containing a stop-sound event, it will stop A's loop.
It seems pretty clear that what's happening is the Flashplayer is only allocating a single channel per movieclip type, rather than per movieclip instance, however google isn't really showing me anything.
Are there best practices for this scenario? (i.e multiple instances of the same movieclip which has sound+animation on its timeline) What am I doing wrong?!
Thanks for your time.
[edit]
To explain a bit better what I mean, let's say there's a Baddie movieclip which contains several animations, e.g the enemy running, crouching, jumping, firing a gun.
There are two layers in the movieclip, one for graphics (animation), one for sound.
On frame 20 there's a muzzleflash (on the animation layer) and a corresponding gun-shot sound (on the sound layer); on frame 40 there's a jump animation and corresponding jump sound.
My problem is: if there are two or more of these movieclips on the stage at once, and one of them is in the middle of playing the gun-shot sound, the others won't play the gun-shot sound (they'll still animate correctly though).
It seems like the Flashplayer is only allocating a single audio channel for all instances of a certain movieclip. This seems like it can't be expected behaviour since it would be useless, so I'm guessing I've messed something up with embedding (maybe there's a parameter or flag hidden somewhere which lets me say "give each instance its own sound channel"?)