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