I am trying to create a reusable function to load sound objects, dynamically
naming them in sequence, and dynamically placing them into an array to hold
a pointer to them. however, they do not seem to be being created. any ideas?

// begin code
var mySounds:Array = new Array();
var sPath:String = "sound/loops/";
mySounds[0] = sPath + "Accident-Broadkas-8819.mp3";
mySounds[1] = sPath + "5-jakkob-2501.mp3";
mySounds[2] = sPath + "albert-Mikkel_M-204.mp3";
mySounds[3] = sPath + "delerium-queali-1634.mp3";

var sounds_array:Array = new Array();
var sBaseName:String = "sound";
function loadSounds() {
 for (var i:Number = 0; i < mySounds.length; i++) {
  sRef = _root["sound"+i]
  sounds_array.push(sRef = new Sound());
  sRef.loadSound(mySounds[i], False);
 }
}

// end code

i have no problems dynamically creating mcs and naming them dynamically, but
this method does not seem to be appliying to this scenario. just a direction
would be helpful..

-edward
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to