Advertisement
Guest User

Untitled

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