Log In · Register

 
Need Help with my playlist please
johnjohn478
post Jul 25 2005, 12:12 AM
Post #1


Newbie
*

Group: Member
Posts: 2
Joined: Jul 2005
Member No: 182,842



ok, I was messing around with my xanga...found a script for a playlist and did what i thought i was supposed to...and I cant get it to work and can't figure out what Im doing wrong...help plzz

Here is the script thingy:


<!-- begin code provided by createblog.com -->
<OBJECT ID="Player" height="0" width="0" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
<PARAM NAME="uiMode" VALUE="invisible">
<PARAM NAME="Autostart" VALUE="False">
</object>

<FORM ID="form">

<SELECT ID="<span class='searchlite'>playlist</span>" size="1">

<!-- Add song info that appears in drop down list here -->
<option value="0">3 Doors Down- Kryptonite (live)</option>
<option value="1">AC/DC- You Shook Me All Night Long</option>
<option value="2">AC/DC- For Those About To Rock </option>
<option value="3">AC/DC- Hells Bells </option>
<option value="4">AC/DC- Dirty Deeds Done Dirt Cheap </option>
<option value=”5”>AC/DC- Back In Black </option>
<option value="6">Bryan Adams- Heaven</option>
<option value="7">Bryan Adams- Summer of ‘69</option>
<option value="8">Bryan Adams- I Fought The Law</option>
<option value="9">Aerosmith- Dream On</option>
<option value="10">Aerosmith- Dude(looks like a lady)</option>
<option value="11">Aerosmith- Walk This Way</option>
<option value="12">Alien Ant Farm- Smooth Criminal</option>
<option value="13">Alkaline Trio- We’ve Had Enough</option>
<option value="14">All American Rejects- Swing Swing</option>
<option value="15">Bad Company- Bad Company</option>
<option value="16">Beach Boys- California Girls</option>
<option value="17">Beach Boys- Surfin USA</option>
<option value="18">Beach Boys- Wouldn’t it be nice</option>
<option value="19">Beatles- Yellow Submarine</option>
<option value="20">Pat Benatar- Love is a Battlefield</option>
<option value="21">Berlin- Take My Breath Away</option>
<option value="22">Blink 182- Adam’s Song</option>
<option value="23">Blue Oyster Cult- Don’t Fear the Reaper</option>
<option value="24">Bon Jovi- You Give Love a Bad Name</option>
<option value="25">Boston- Amanda</option>
<option value="26">Boston- More Than a Feeling</option>
<option value="27">Boston- Peace of Mind</option>
<option value="28">Boston- A Man I’ll Never Be</option>
<option value="29">Bowling for Soup- Man I’ll Never Be</option>
<option value="30">Jimmy Buffet- Cheeseburger in Paradise</option>
<option value="31">The Caesars- Jerk it Out </option>
<option value="32">Cheap Trick- I Want You to Want Me</option>
<option value="33">Chicago- You’re the Inspiration</option>
<option value="34">Chicago- Look Away</option>
<option value="35">Chicago- Hard To Say I’m Sorry</option>
<option value="36">Coldplay- Yellow</option>
<option value="37">Counting Crows- Big Yellow Taxi</option>
<option value="38">Creed- Bullets</option>
<option value="39">Creed- My Sacrifice</option>
<option value="40">Bob Dylan- Knockin’ On Heaven’s Door</option>
<option value="41">Melissa Etheridge- Come To My Window</option>
<option value="42">Fall Out boy- Sugar, We’re Going Down</option>
<option value="43">Franz Ferdinand- This Fire</option>
<option value="44">Franz Ferdinand- Tell Her Tonight</option>
<option value="45">Five For Fighting- 100 Years</option>
<option value="46">Foo Fighters- Everlong</option>
<option value="47">Foreigner- Cold As Ice</option>
<option value="48">Foreigner- Double Vision</option>
<option value="49">Foreigner- Hot Blooded</option>
<option value="50">Foreigner- Feels Like the First Time</option>

</SELECT>

<BR>
<BUTTON ID="BackButton" onClick="Back(forms['form'].playlist);">&nbsp;<<&nbsp;</BUTTON>
<BUTTON ID="PlayPauseButton" onClick="PlayPause(forms['form'].playlist);"><FONT color="green">&nbsp;&nbsp;Play&nbsp;&nbsp;</FONT></BUTTON>
<BUTTON ID="NextButton" onClick="Next(forms['form'].playlist);">&nbsp;>>&nbsp;</BUTTON>&nbsp;
<BUTTON ID="StopButton" onclick="Stop();"><FONT color="maroon">Stop</FONT></BUTTON>
<b><font size="3" color="black">Shuffle</font></b><INPUT TYPE=checkbox CHECKED ID="ShuffleSwitch" onclick="ToggleShuffle(this);" value="ON">

</FORM>
</CENTER>


<comment ID="PlayHTML"><FONT color="green">&nbsp;&nbsp;Play&nbsp;&nbsp;</FONT></comment>
<comment ID="ShuffleOnHTML"><INPUT TYPE=checkbox CHECKED ID="ShuffleSwitch" onclick="ToggleShuffle(this);"></comment>
<comment ID="ShuffleOffHTML"><INPUT TYPE=checkbox UNCHECKED ID="ShuffleSwitch" onclick="ToggleShuffle(this);"></comment>


<script ID="Main" Language="JavaScript">

var songs = new Array();

//*******************************//
//****** CHANGEABLE STUFF *******//
//*******************************//

var shuffle = false; // false = shuffle off, true = shuffle on

var autoStart = true; // false = autoStart off, true = autoStart on

var numberTracks = true; // true = place track number in front of list items, false = no track numbers

// Add song URLs here (make sure it matches up with the order you have for song info, and urls need quotes):
songs[0]="http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/1/9628/28369_1_4_05.asf";
songs[1]="http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/3/192/393_1_2_05.asf ";
songs[2]="http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/3/192/393_1_9_05.asf ";
songs[3]="http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/3/192/393_1_6_05.asf ";
songs[4]="http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/5/192/389_1_1_05.asf ";
songs[5]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/4/192/388_1_6_05.asf”;
Song[6]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/5/212/5147_1_8_05.asf”;
Song[7]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/5/212/5147_1_13_05.asf”;
Song[8]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/5/212/5147_1_16_05.asf”;
Song[9]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/2/213/27194_1_2_05.asf”;
Song[10]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/2/213/27194_1_2_05.asf”;
Song[11]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/2/213/506_1_4_05.asf”;
Song[12]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/5/18786/20411_1_12_05.asf”;
Song[13]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/0/11972/28668_1_2_05.asf”;
Song[14]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/1/24322/27265_1_3_05.asf”;
Song[15]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/0/169/3378_1_6_05.asf”;
Song[16]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/0/604/18390_1_19_05.asf”;
Song[17]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/4/604/6364_1_9_05.asf”;
Song[18]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/4/604/6364_1_6_05.asf”;
Song[19]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/4/6/9346_1_1_05.asf”;
Song[20]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/2/3555/22508_1_20_05.asf”;
Song[21]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/4/914/16606_1_12_05.asf”;
Song[22]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/4/914/16606_1_12_05.asf”;
Song[23]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/3/18329/19647_1_1_05.asf”;
Song[24]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/0/1822/5142_1_2_05.asf”;
Song[25]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/1/589/5755_1_1_05.asf”;
Song[26]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/4/589/17152_1_1_05.asf”;
Song[27]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/4/589/17152_1_2_05.asf”;
Song[28]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/3/589/657_1_4_05.asf”;
Song[29]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/4/11456/29788_1_3_05.asf”;
Song[30]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/5/171/27893_1_8_05.asf”;
Song[31]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/4/24610/30718_1_4_05.asf”;
Song[32]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/4/5141/13318_1_4_05.asf”;
Song[33]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/0/477/5190_1_1_05.asf”;
Song[34]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/0/477/5190_1_9_05.asf”;
Song[35]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/0/477/5190_1_15_05.asf”;
Song[36]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/0/4092/4512_1_5_05.asf”;
Song[37]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/5/19/28571_1_10_05.asf”;
Song[38]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/0/489/24792_1_1_05.asf”;
Song[39]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/0/489/24792_1_6_05.asf”;
Song[40]=‘http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/3/28/25419_1_7_05.asf”;
Song[41]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/1/34/2419_1_3_05.asf”;
Song[42]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/3/26513/30555_1_1_05.asf”;
Song[42]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/2/25451/29138_1_7_05.asf”;
Song[43]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/2/25451/29138_1_2_05.asf”;
Song[44]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/1/17064/28837_1_4_05.asf”;
Song[45]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/1/17064/28837_1_4_05.asf”;
Song[46]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/5/37/113_1_11_05.asf”;
Song[47]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/4/3089/18076_1_1_05.asf”;
Song[48]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/4/3089/18076_1_2_05.asf”;
Song[49]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/4/3089/7168_1_1_05.asf”;
Song[50]=“http://a425.v8384d.c8384.g.vm.akamaistream.net/7/426/8384/3b858b51/mtvrdstr.download.akamai.com/8512/wmp/4/3089/3868_1_1_05.asf”;

//*******************************//
//*******************************//

// Initializations //
with (document){
var length = forms['form'].playlist.length;

if(numberTracks){
for (var i = 0; i < length; i++){
forms['form'].playlist.options[i].innerHTML = (i+1) + " - " + forms['form'].playlist.options[i].innerHTML;
}
}

if (shuffle) {
var randsg = Math.floor(Math.random()*songs.length);
Player.url = songs[randsg];
forms['form'].playlist.options[randsg].selected = true;
forms['form'].ShuffleSwitch.outerHTML = ShuffleOnHTML.innerHTML;
}

else {
forms['form'].ShuffleSwitch.outerHTML = ShuffleOffHTML.innerHTML;
Player.url = songs[0];
}

if(autoStart){
var snum = forms['form'].playlist.selectedIndex;
if(Player.url != songs[snum]){
Player.url = songs[snum];
}
Player.controls.Play();
}
}

// Functions //
// Discription: "PlayPause" will toggle playing and pausing if the same song is still selected,
// otherwise it will load the newly selected song
function PlayPause(list) {
var snum = list.selectedIndex;

if((Player.url == songs[snum] && Player.url != "") && Player.playState != 1){
if(Player.playState == 3){
Player.controls.Pause();
}

else {
Player.controls.Play();
}
}

else {
Player.url = songs[snum];
Player.controls.Play();
}
}

// Discription: "Next" will move to the next music file if shuffle is off
// otherwise it will load a random song. Calls PlayPause to start music.
function Next(list) {
var snum = list.selectedIndex;
if (!shuffle) {
if (snum == list.length-1) {
snum = -1;
}
snum++;
}

else {
var temp;
do{
temp = Math.floor(Math.random()*songs.length);
} while(temp == snum);
snum = temp;
}

list.options[snum].selected = true;
PlayPause(list);
}

// Discription: "Back" does the same thing as "Next" but moves backwads
// through the list. If shuffle is on then picks a random song.
function Back(list) {
var snum = list.selectedIndex;
if (!shuffle) {
if (snum == 0){
snum = list.length;
}
snum--;
}

else {
var temp;
do{
temp = Math.floor(Math.random()*songs.length);
} while(temp == snum);
snum = temp;
}

list.options[snum].selected = true;
PlayPause(list);
}

// Discription: Self explanitory.
function Stop(){
Player.controls.Stop();
}

// Discription: Makes the shuffle flag the same as the status of the CheckBox
// The status of the checkbox (true/false) indicates if the box is checked
function ToggleShuffle(CheckBox) {
shuffle = CheckBox.status;
}

</SCRIPT>

<script ID="StateChangeHandler" Language = "JavaScript" For = "Player" Event = playStateChange(NewState)>

// Description: This is an interupt handler used to handle instances when the
// state of the player changes to play or stop for example.

//STATE.innerText = NewState;

switch(NewState){
case 8: // Handles player after it just finishes playing through a song
var num = document.forms['form'].playlist.selectedIndex;

if (!shuffle){
if(num == document.forms['form'].playlist.length-1){
num = -1;
}

num++;
}
else {
var temp;
do{
temp = Math.floor(Math.random()*songs.length);
} while(temp == num);
num = temp;
}

document.forms['form'].playlist.options[num].selected = true;

PreviousState = NewState;
break;

case 1: // Handles player after it stops
if(PreviousState == 8){
var num = document.forms['form'].playlist.selectedIndex;
Player.settings.autoStart = true;
Player.url = songs[num];
PreviousState = NewState;
}

else if (PreviousState != 3 && PreviousState != 2){
Player.controls.Play();
Player.settings.autoStart = false;
}

else{
forms['form'].PlayPauseButton.innerHTML = PlayHTML.innerHTML;
}
break;

case 3: // Handles player after it starts to play
PreviousState = NewState;
forms['form'].PlayPauseButton.innerHTML = "Pause";
shuffle = document.forms['form'].ShuffleSwitch.status;
break;

case 2: // Handles player after being paused
PreviousState = NewState;
forms['form'].PlayPauseButton.innerHTML = PlayHTML.innerHTML;
break;

default:
}

</SCRIPT>
<!-- end code provided by createblog.com -->


Well comment if you can help,

Thanks!
 

Posts in this topic


Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: