Skip to content

Commit

Permalink
Placing the sounds in a sound array for easier management
Browse files Browse the repository at this point in the history
  • Loading branch information
Edmore Moyo committed May 26, 2012
1 parent 65021e6 commit ccacac5
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions public/javascripts/start.js
Original file line number Diff line number Diff line change
@@ -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.