Advertisement
Guest User

Untitled

a guest
Apr 11th, 2013
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2. var nameArray=new Array();
  3.     nameArray[0]="I'm gunna give you a fun problem";
  4.     nameArray[1]="I think that's a stupid number";
  5.     nameArray[2]="Jesus God";
  6.     nameArray[3]="Hold on, let me finish";
  7.     nameArray[4]="No, I have no faith in aliens";
  8.     nameArray[5]="It's also possible you could walk through the wall";
  9.     nameArray[6]="By the way, the heart is an incredible organ";
  10.     nameArray[7]="There's very little activity out here";
  11.     nameArray[8]="Wow, I wanna hit that";
  12.     nameArray[9]="Idiot";
  13.     nameArray[10]="There's no more Mexicans here, how in the hell am I gunna keep my yard?";
  14.     nameArray[11]="Political Bullshit";
  15.     nameArray[12]="This is Wacko";
  16. var baseurl = "http://dl.dropbox.com/u/109430408/bob/";
  17. var i;
  18. var sub;
  19. function runLoop(){
  20.     var container = $('<div />');
  21.     var clips = $('<div />');
  22.     $(document).ready(function(){
  23.         $(document.body).append(container);
  24.         $(document.body).append(clips);
  25.         nameArray.forEach(function(label,i) {
  26.             var snd = $('<audio id="sound'+i+'" src="'+baseurl+i+'.ogg"></audio>');
  27.             clips.append(snd);
  28.  
  29.             var btn = $('<button value="'+label+'">'+label+'</button>');
  30.             container.append(btn).click(function() {
  31.                         var audio=document.getElementById('sound'+i);
  32.                 console.log("this shit is working");
  33.                 audio.play();
  34.     });
  35. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement