as3: too many sound files... no worky

I’ve created this little program to test with. It works perfectly for 5 or less sound files/for loops. As soon as I do more then that the sounds stop working. Everything else is fine… just no sound. My plan is to have the xml file determin how many movie clips with attached sound files to create. I’m planning on having tons of movie clips and sound files once this is all finished.

Is there a limit to how many sound files a swf can reference? Any other ideas why the sounds aren’t working for me?


//load xml
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML(); 
var xmlPath:String = "data.xml";
xmlLoader.load(new URLRequest(xmlPath));
trace("loading xml from: " + xmlPath);
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
     
function LoadXML(e:Event):void {
     trace("xml loading complete");
     xmlData = new XML(e.target.data);
     //load objects
     buildScroller();
}

function buildScroller():void{
     var tl:MovieClip=this;
     for (var i:Number = 0; i < 5; i++){

        //create movie clips
        var container_mc:container = new container();
        addChild(container_mc);
        container_mc.x = 325 * i;  // set the number here to the width of the movie clip being repeated
        
        //sound info
        tl["snd"+i] = new Sound();        
        tl["snd"+i].load(new URLRequest(xmlData.sound.loc*));
        container_mc.snd = tl["snd"+i];
        container_mc.addEventListener(MouseEvent.CLICK, playSound, false, 0, true);

        function playSound(event:MouseEvent):void {
            event.currentTarget.snd.play();
        }
     }
}

here is my xml that goes along with it.


<DATA>
    <object_count>20</object_count>

    <sound>
        <loc>fart.mp3</loc>
        <loc>burp.mp3</loc>
        <loc>creak128.mp3</loc>
        <loc>GateOpen.mp3</loc>
        <loc>bang.mp3</loc>
        <loc>pop.mp3</loc>
        <loc>slap.mp3</loc>
    </sound>
</DATA>