Offhand I'm not sure of the problem -- anyone else have an idea?

It could be as simple as the use of "False" rather than "false" in that last line. But I also wonder about two things:

First, I would expect a trace of the mySounds array to return a list of paths to the sounds, not "[Object Object]."

Second, I'm not sure of the implications of using _root as the scope for every testSound object where you're re-using the name for the Sound object. Since you're calling them in a single action sequence, I don't know if Flash has a chance to start loading one sound before it's replaced by the action to load another sound. At best, loading them sequentially into the same Sound object means you can only access the last sound to be loaded. So you might try assigning a unique name to each sound object.

- Marc


At 05:49 AM 3/10/2006, murder design wrote:

paths are ok, playing them without dynamically loading and placing into
arrays is fine. the trace of the array results in: [Object Object] four
times, however no play. here is my complete code, no errors, but no results:
when i give each sound object the same name, does that matter if there is a
pointer within an array element for each one? am i going about this wrong...


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";

// load all sounds in loop
function loadSounds() {
 for (var i:Number = 0; i < mySounds.length; i++) {
  sRef = _root;
  var testSound:Sound = new Sound(sRef);
  sounds_array.push(testSound);
  testSound.loadSound(mySounds[i], False);
 }
}


_______________________________________________
Flashcoders@chattyfig.figleaf.com
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