Skip to content
Browse files

Placing the sounds in a sound array for easier management

  • Loading branch information...
1 parent 65021e6 commit ccacac5228e34a35549ebed92fc4f6c33059b25e Edmore Moyo committed May 26, 2012
Showing with 10 additions and 6 deletions.
  1. +10 −6 public/javascripts/start.js
View
16 public/javascripts/start.js
@@ -1,16 +1,20 @@
-soundManager.url = 'soundmanager/swf';
+soundManager.url = 'soundmanager/swf/';
soundManager.debugMode = false;
soundManager.onready(function(){
+ var mySounds = [];
+
if( files.length > 0 ){
for( var i=0; i < files.length; i+=1 ){
- var mySound = soundManager.createSound({
- id: 'Sound'+ i,
+ mySounds.push( soundManager.createSound({
+ id: files[i][0],
url: "/play?filename=" + files[i][1]
- });
- console.log("Currently playing...." + files[i][0]);
- mySound.play();
+ })
+ );
}
+ console.log(mySounds);
+ mySounds[0].play();
+ mySounds[1].play();
}
});

0 comments on commit ccacac5

Please sign in to comment.
Something went wrong with that request. Please try again.