Log In · Register

 
 
Closed TopicStart new topic
drop down player..., half of the script works...
ebonylaurels
post Apr 19 2006, 04:43 PM
Post #1


uhhh?*confused face*
****

Group: Member
Posts: 105
Joined: Sep 2005
Member No: 222,267



Okay, I just tride to put a drop down player on my myspace, cause I want a bunch of songs on there instead of just a few, I used the same one from my xanga(which works perfect), and when I clicked preview the player was there with all the songs on it, but half the script was still visibal, and if you tried to play the songs none of them worked....here's the code without the songs in it, cause they just take up a bunch of spacepart in ~ is what can be seen
CODE
<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="playlist" size="1">

<!-- Add song info that appears in drop down list here -->
<option value="0"></option>




</SELECT>

<BR>
<BUTTON ID="BackButton" onClick="Back(forms['form'].playlist);"> << </BUTTON>
<BUTTON ID="PlayPauseButton" onClick="PlayPause(forms['form'].playlist);"><FONT color="green">  Play  </FONT></BUTTON>
<BUTTON ID="NextButton" onClick="Next(forms['form'].playlist);"> >> </BUTTON>
<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">  Play  </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]="";
    
    
    //*******************************//
    //*******************************//

// 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>
 
GREASEbaby
post Apr 19 2006, 04:45 PM
Post #2


What's my name? Janette. and ily. <3
******

Group: Member
Posts: 2,139
Joined: Apr 2006
Member No: 391,911



It doesn't work because there's javascript in it; MySpace doesn't allow javascript. There are some playlists out there, I've seen a couple friends with them.
 
ebonylaurels
post Apr 19 2006, 04:52 PM
Post #3


uhhh?*confused face*
****

Group: Member
Posts: 105
Joined: Sep 2005
Member No: 222,267



Thanks for telling me why it doesn't work, but that doesn't really help me..cause I didn't make the script so I'm not sure how it works exsactly...and I can't find any script for a playlist other than this one on here...
 
*This Confession*
post Apr 19 2006, 04:53 PM
Post #4





Guest






go to
www.mygen.co.uk

for a play list like

http://myspace.com/digitalfragrance

theres a ex on hers.
 
ebonylaurels
post Apr 19 2006, 05:32 PM
Post #5


uhhh?*confused face*
****

Group: Member
Posts: 105
Joined: Sep 2005
Member No: 222,267



I'm not intellegent enough to use the players that they mention....
 
GREASEbaby
post Apr 19 2006, 05:47 PM
Post #6


What's my name? Janette. and ily. <3
******

Group: Member
Posts: 2,139
Joined: Apr 2006
Member No: 391,911



What songs do you want?
 
*This Confession*
post Apr 19 2006, 06:49 PM
Post #7





Guest






http://www.createblog.com/forums/index.php?showtopic=14636

12. music
for music resources.
 
freeflow
post Apr 19 2006, 11:22 PM
Post #8


t-t-t-toyaaa
********

Group: Official Member
Posts: 19,821
Joined: Apr 2004
Member No: 11,270



Also you can use
http://webjay.com
You sign up, you can get urls from other peoples playlist.
http://www.createblog.com/tutorials/download.php?id=131
Also you can convert mp3s on your computer and upload them.


Here is a way for a dropdown player on myspace:
- edit I have to find a new link the other one got rid of the code-
 
coldtrance
post Apr 20 2006, 01:12 AM
Post #9


There Are Strange Things Afoot At The Cirlce K
******

Group: Member
Posts: 1,130
Joined: Oct 2005
Member No: 253,395



well i have a play list that allows 10 songs for free:

www.mytuneslive.com

its not a drop down, but its easy to use, all you do is upload the songs you want to the profile, and get the code for myspace and paste it
 

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