The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Background music with mp3
inoculah
post Sep 24 2011, 09:03 PM
Post #1





Group: Members
Posts: 7
Joined: 11-April 11
Member No.: 14,315



Ok in my web design class a buddy helped me with some music on my site through midi songs. I was wondering if there is a way to use mp3 songs. for an example of my midi one here is the script my buddy helped me with. See that helped me really and it worked on my old website but I can't find any coding for mp3 and when I do it either doesn't work or it makes a player visible. If you can't give me coding that makes it to where it doesn't have a player visible. Is there a way to make the music player invisible so it seems the music is playing in the background?

CODE
<script language="JavaScript">
midis = 73
var mid1 = "jenova.mid"
var mid2 = "motorcycle.mid"
var mid3 = "a.mid"
var mid4 = "owa.mid"
var mid5 = "absolute.mid"
var mid6 = "aerith.mid"
var mid7 = "ahead.mid"
var mid8 = "anxious_heart.mid"
var mid9 = "attack.mid"
var mid10 = "barret.mid"
var mid11 = "blackcape.mid"
var mid12 = "blood.mid"
var mid13 = "bronco.mid"
var mid14 = "cait.mid"
var mid15 = "cannon.mid"
var mid16 = "canyon.mid"
var mid17 = "chocobo.mid"
var mid18 = "chocobo2.mid"
var mid19 = "chocobo3.mid"
var mid20 = "condor.mid"
var mid21 = "continue.mid"
var mid22 = "costa.mid"
var mid23 = "countdown.mid"
var mid24 = "darkness.mid"
var mid25 = "debut.mid"
var mid26 = "dispair.mid"
var mid27 = "don.mid"
var mid28 = "farm.mid"
var mid29 = "faster.mid"
var mid30 = "feet.mid"
var mid31 = "fighting.mid"
var mid32 = "fireworks.mid"
var mid33 = "flowers_church.mid"
var mid34 = "god.mid"
var mid35 = "gold.mid"
var mid36 = "heart.mid"
var mid37 = "highwind.mid"
var mid38 = "honeybee.mid"
var mid39 = "hurry.mid"
var mid40 = "judgement.mid"
var mid41 = "main.mid"
var mid42 = "mako_reactor.mid"
var mid43 = "materia.mid"
var mid44 = "mining.mid"
var mid45 = "mountain.mid"
var mid46 = "nanaki.mid"
var mid47 = "opening_bombing.mid"
var mid48 = "opressed.mid"
var mid49 = "parochial.mid"
var mid50 = "planet.mid"
var mid51 = "prelude.mid"
var mid52 = "racing.mid"
var mid53 = "racing2.mid"
var mid54 = "reunion.mid"
var mid55 = "rotting_pizza.mid"
var mid56 = "rufus.mid"
var mid57 = "sandy.mid"
var mid58 = "sea.mid"
var mid59 = "shinobi.mid"
var mid60 = "shinra.mid"
var mid61 = "snow.mid"
var mid62 = "temple.mid"
var mid63 = "thoughts.mid"
var mid64 = "tifa.mid"
var mid65 = "tower.mid"
var mid66 = "traitor.mid"
var mid67 = "turks.mid"
var mid68 = "victory.mid"
var mid69 = "warrior.mid"
var mid70 = "weapon.mid"
var mid71 = "whoami.mid"
var mid72 = "whoareyou.mid"
var mid73 = "wutai.mid"

num = parseInt(Math.random() * 73);
while (num > midis) {
    num = parseInt(Math.random() * 73);
    }
  if (num == 0) {
    document.write ("<embed src=\""+mid1+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 1) {
    document.write ("<embed src=\""+mid2+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 2) {
    document.write ("<embed src=\""+mid3+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 3) {
    document.write ("<embed src=\""+mid4+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 4) {
    document.write ("<embed src=\""+mid5+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 5) {
    document.write ("<embed src=\""+mid6+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 6) {
    document.write ("<embed src=\""+mid7+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 7) {
    document.write ("<embed src=\""+mid8+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 8) {
    document.write ("<embed src=\""+mid9+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 9) {
    document.write ("<embed src=\""+mid10+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 10) {
    document.write ("<embed src=\""+mid11+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 11) {
    document.write ("<embed src=\""+mid12+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 12) {
    document.write ("<embed src=\""+mid13+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 13) {
    document.write ("<embed src=\""+mid14+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 14) {
    document.write ("<embed src=\""+mid15+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 15) {
    document.write ("<embed src=\""+mid16+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 16) {
    document.write ("<embed src=\""+mid17+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 17) {
    document.write ("<embed src=\""+mid18+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 18) {
    document.write ("<embed src=\""+mid19+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 19) {
    document.write ("<embed src=\""+mid20+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 20) {
    document.write ("<embed src=\""+mid21+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 21) {
    document.write ("<embed src=\""+mid22+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 22) {
    document.write ("<embed src=\""+mid23+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 23) {
    document.write ("<embed src=\""+mid24+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 24) {
    document.write ("<embed src=\""+mid25+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 25) {
    document.write ("<embed src=\""+mid26+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 26) {
    document.write ("<embed src=\""+mid27+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 27) {
    document.write ("<embed src=\""+mid28+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 28) {
    document.write ("<embed src=\""+mid29+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 29) {
    document.write ("<embed src=\""+mid30+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 30) {
    document.write ("<embed src=\""+mid31+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 31) {
    document.write ("<embed src=\""+mid32+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 32) {
    document.write ("<embed src=\""+mid33+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 33) {
    document.write ("<embed src=\""+mid34+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 34) {
    document.write ("<embed src=\""+mid35+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 35) {
    document.write ("<embed src=\""+mid36+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 36) {
    document.write ("<embed src=\""+mid37+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 37) {
    document.write ("<embed src=\""+mid38+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 38) {
    document.write ("<embed src=\""+mid39+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 39) {
    document.write ("<embed src=\""+mid40+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 40) {
    document.write ("<embed src=\""+mid41+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 41) {
    document.write ("<embed src=\""+mid42+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 42) {
    document.write ("<embed src=\""+mid43+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 43) {
    document.write ("<embed src=\""+mid44+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 44) {
    document.write ("<embed src=\""+mid45+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 45) {
    document.write ("<embed src=\""+mid46+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 46) {
    document.write ("<embed src=\""+mid47+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 47) {
    document.write ("<embed src=\""+mid48+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 48) {
    document.write ("<embed src=\""+mid49+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 49) {
    document.write ("<embed src=\""+mid50+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 50) {
    document.write ("<embed src=\""+mid51+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 51) {
    document.write ("<embed src=\""+mid52+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 52) {
    document.write ("<embed src=\""+mid53+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 53) {
    document.write ("<embed src=\""+mid54+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 54) {
    document.write ("<embed src=\""+mid55+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 55) {
    document.write ("<embed src=\""+mid56+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 56) {
    document.write ("<embed src=\""+mid57+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 57) {
    document.write ("<embed src=\""+mid58+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 58) {
    document.write ("<embed src=\""+mid59+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 59) {
    document.write ("<embed src=\""+mid60+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 60) {
    document.write ("<embed src=\""+mid61+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 61) {
    document.write ("<embed src=\""+mid62+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 62) {
    document.write ("<embed src=\""+mid63+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 63) {
    document.write ("<embed src=\""+mid64+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 64) {
    document.write ("<embed src=\""+mid65+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 65) {
    document.write ("<embed src=\""+mid66+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 66) {
    document.write ("<embed src=\""+mid67+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 67) {
    document.write ("<embed src=\""+mid68+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 68) {
    document.write ("<embed src=\""+mid69+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 69) {
    document.write ("<embed src=\""+mid70+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 70) {
    document.write ("<embed src=\""+mid71+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 71) {
    document.write ("<embed src=\""+mid72+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 72) {
    document.write ("<embed src=\""+mid73+"\" loop=\"true\" hidden=\"true\">");
    }

</script>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
Brian Chandler
post Sep 25 2011, 09:08 AM
Post #2


Jocular coder
********

Group: Members
Posts: 2,239
Joined: 31-August 06
Member No.: 43



Incidentally, have you considered replacing this:

CODE

  if (num == 0) {
    document.write ("<embed src=\""+mid1+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 1) {
    document.write ("<embed src=\""+mid2+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 2) {
    document.write ("<embed src=\""+mid3+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 3) {
    document.write ("<embed src=\""+mid4+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 4) {
    document.write ("<embed src=\""+mid5+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 5) {
    document.write ("<embed src=\""+mid6+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 6) {
    document.write ("<embed src=\""+mid7+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 7) {
    document.write ("<embed src=\""+mid8+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 8) {
    document.write ("<embed src=\""+mid9+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 9) {
    document.write ("<embed src=\""+mid10+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 10) {
    document.write ("<embed src=\""+mid11+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 11) {
    document.write ("<embed src=\""+mid12+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 12) {
    document.write ("<embed src=\""+mid13+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 13) {
    document.write ("<embed src=\""+mid14+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 14) {
    document.write ("<embed src=\""+mid15+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 15) {
    document.write ("<embed src=\""+mid16+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 16) {
    document.write ("<embed src=\""+mid17+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 17) {
    document.write ("<embed src=\""+mid18+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 18) {
    document.write ("<embed src=\""+mid19+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 19) {
    document.write ("<embed src=\""+mid20+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 20) {
    document.write ("<embed src=\""+mid21+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 21) {
    document.write ("<embed src=\""+mid22+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 22) {
    document.write ("<embed src=\""+mid23+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 23) {
    document.write ("<embed src=\""+mid24+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 24) {
    document.write ("<embed src=\""+mid25+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 25) {
    document.write ("<embed src=\""+mid26+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 26) {
    document.write ("<embed src=\""+mid27+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 27) {
    document.write ("<embed src=\""+mid28+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 28) {
    document.write ("<embed src=\""+mid29+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 29) {
    document.write ("<embed src=\""+mid30+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 30) {
    document.write ("<embed src=\""+mid31+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 31) {
    document.write ("<embed src=\""+mid32+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 32) {
    document.write ("<embed src=\""+mid33+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 33) {
    document.write ("<embed src=\""+mid34+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 34) {
    document.write ("<embed src=\""+mid35+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 35) {
    document.write ("<embed src=\""+mid36+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 36) {
    document.write ("<embed src=\""+mid37+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 37) {
    document.write ("<embed src=\""+mid38+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 38) {
    document.write ("<embed src=\""+mid39+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 39) {
    document.write ("<embed src=\""+mid40+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 40) {
    document.write ("<embed src=\""+mid41+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 41) {
    document.write ("<embed src=\""+mid42+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 42) {
    document.write ("<embed src=\""+mid43+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 43) {
    document.write ("<embed src=\""+mid44+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 44) {
    document.write ("<embed src=\""+mid45+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 45) {
    document.write ("<embed src=\""+mid46+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 46) {
    document.write ("<embed src=\""+mid47+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 47) {
    document.write ("<embed src=\""+mid48+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 48) {
    document.write ("<embed src=\""+mid49+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 49) {
    document.write ("<embed src=\""+mid50+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 50) {
    document.write ("<embed src=\""+mid51+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 51) {
    document.write ("<embed src=\""+mid52+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 52) {
    document.write ("<embed src=\""+mid53+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 53) {
    document.write ("<embed src=\""+mid54+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 54) {
    document.write ("<embed src=\""+mid55+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 55) {
    document.write ("<embed src=\""+mid56+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 56) {
    document.write ("<embed src=\""+mid57+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 57) {
    document.write ("<embed src=\""+mid58+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 58) {
    document.write ("<embed src=\""+mid59+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 59) {
    document.write ("<embed src=\""+mid60+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 60) {
    document.write ("<embed src=\""+mid61+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 61) {
    document.write ("<embed src=\""+mid62+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 62) {
    document.write ("<embed src=\""+mid63+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 63) {
    document.write ("<embed src=\""+mid64+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 64) {
    document.write ("<embed src=\""+mid65+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 65) {
    document.write ("<embed src=\""+mid66+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 66) {
    document.write ("<embed src=\""+mid67+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 67) {
    document.write ("<embed src=\""+mid68+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 68) {
    document.write ("<embed src=\""+mid69+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 69) {
    document.write ("<embed src=\""+mid70+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 70) {
    document.write ("<embed src=\""+mid71+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 71) {
    document.write ("<embed src=\""+mid72+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 72) {
    document.write ("<embed src=\""+mid73+"\" loop=\"true\" hidden=\"true\">");
    }


by this

CODE

document.write ("<embed src=\"mid"+ (string)(num+1) +"\" loop=\"true\" hidden=\"true\">");


(I think this correctly converts num+1 to a string, but the explicit cast (string) is probably not necessary ... I'm not really a javascript person, I just get offended by ridiculous sequences of ifs.)

This post has been edited by Brian Chandler: Sep 25 2011, 09:10 AM


--------------------
Brian Chandler
Nothing in this post constitutes "commercial solicitation". PayPal does not solicit residents of Japan. Contents may settle in transit. "Legal mind" may or may not be brain-damaged.
User is online!PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
inoculah
post Sep 26 2011, 01:16 AM
Post #3





Group: Members
Posts: 7
Joined: 11-April 11
Member No.: 14,315



QUOTE(Brian Chandler @ Sep 25 2011, 09:08 AM) *

Incidentally, have you considered replacing this:

CODE

  if (num == 0) {
    document.write ("<embed src=\""+mid1+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 1) {
    document.write ("<embed src=\""+mid2+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 2) {
    document.write ("<embed src=\""+mid3+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 3) {
    document.write ("<embed src=\""+mid4+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 4) {
    document.write ("<embed src=\""+mid5+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 5) {
    document.write ("<embed src=\""+mid6+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 6) {
    document.write ("<embed src=\""+mid7+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 7) {
    document.write ("<embed src=\""+mid8+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 8) {
    document.write ("<embed src=\""+mid9+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 9) {
    document.write ("<embed src=\""+mid10+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 10) {
    document.write ("<embed src=\""+mid11+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 11) {
    document.write ("<embed src=\""+mid12+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 12) {
    document.write ("<embed src=\""+mid13+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 13) {
    document.write ("<embed src=\""+mid14+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 14) {
    document.write ("<embed src=\""+mid15+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 15) {
    document.write ("<embed src=\""+mid16+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 16) {
    document.write ("<embed src=\""+mid17+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 17) {
    document.write ("<embed src=\""+mid18+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 18) {
    document.write ("<embed src=\""+mid19+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 19) {
    document.write ("<embed src=\""+mid20+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 20) {
    document.write ("<embed src=\""+mid21+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 21) {
    document.write ("<embed src=\""+mid22+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 22) {
    document.write ("<embed src=\""+mid23+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 23) {
    document.write ("<embed src=\""+mid24+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 24) {
    document.write ("<embed src=\""+mid25+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 25) {
    document.write ("<embed src=\""+mid26+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 26) {
    document.write ("<embed src=\""+mid27+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 27) {
    document.write ("<embed src=\""+mid28+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 28) {
    document.write ("<embed src=\""+mid29+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 29) {
    document.write ("<embed src=\""+mid30+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 30) {
    document.write ("<embed src=\""+mid31+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 31) {
    document.write ("<embed src=\""+mid32+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 32) {
    document.write ("<embed src=\""+mid33+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 33) {
    document.write ("<embed src=\""+mid34+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 34) {
    document.write ("<embed src=\""+mid35+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 35) {
    document.write ("<embed src=\""+mid36+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 36) {
    document.write ("<embed src=\""+mid37+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 37) {
    document.write ("<embed src=\""+mid38+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 38) {
    document.write ("<embed src=\""+mid39+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 39) {
    document.write ("<embed src=\""+mid40+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 40) {
    document.write ("<embed src=\""+mid41+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 41) {
    document.write ("<embed src=\""+mid42+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 42) {
    document.write ("<embed src=\""+mid43+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 43) {
    document.write ("<embed src=\""+mid44+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 44) {
    document.write ("<embed src=\""+mid45+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 45) {
    document.write ("<embed src=\""+mid46+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 46) {
    document.write ("<embed src=\""+mid47+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 47) {
    document.write ("<embed src=\""+mid48+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 48) {
    document.write ("<embed src=\""+mid49+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 49) {
    document.write ("<embed src=\""+mid50+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 50) {
    document.write ("<embed src=\""+mid51+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 51) {
    document.write ("<embed src=\""+mid52+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 52) {
    document.write ("<embed src=\""+mid53+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 53) {
    document.write ("<embed src=\""+mid54+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 54) {
    document.write ("<embed src=\""+mid55+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 55) {
    document.write ("<embed src=\""+mid56+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 56) {
    document.write ("<embed src=\""+mid57+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 57) {
    document.write ("<embed src=\""+mid58+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 58) {
    document.write ("<embed src=\""+mid59+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 59) {
    document.write ("<embed src=\""+mid60+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 60) {
    document.write ("<embed src=\""+mid61+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 61) {
    document.write ("<embed src=\""+mid62+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 62) {
    document.write ("<embed src=\""+mid63+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 63) {
    document.write ("<embed src=\""+mid64+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 64) {
    document.write ("<embed src=\""+mid65+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 65) {
    document.write ("<embed src=\""+mid66+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 66) {
    document.write ("<embed src=\""+mid67+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 67) {
    document.write ("<embed src=\""+mid68+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 68) {
    document.write ("<embed src=\""+mid69+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 69) {
    document.write ("<embed src=\""+mid70+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 70) {
    document.write ("<embed src=\""+mid71+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 71) {
    document.write ("<embed src=\""+mid72+"\" loop=\"true\" hidden=\"true\">");
    }
  if (num == 72) {
    document.write ("<embed src=\""+mid73+"\" loop=\"true\" hidden=\"true\">");
    }


by this

CODE

document.write ("<embed src=\"mid"+ (string)(num+1) +"\" loop=\"true\" hidden=\"true\">");


(I think this correctly converts num+1 to a string, but the explicit cast (string) is probably not necessary ... I'm not really a javascript person, I just get offended by ridiculous sequences of ifs.)


Hm is there a way to maybe copy that kind of code and make it where I can play say about 4 songs?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 23rd October 2014 - 12:09 AM