getting continuous play in the mp3 player

  • glennnphp
  • Born
  • Born
  • glennnphp
  • Posts: 1

Post 3+ Months Ago

I'VE BEEN playing around with several mp3 players and i've not yet understood how to get the songs to play consecutively - there's an onSoundEnd handler (or something), but i've no clue how to incorporate it into something like below...

could someone lend a hand...?

tia,
g

Code: [ Select ]
//-------for myComboBox-----------
var mycomboXml = new XML();
mycomboXml.onLoad = function(){
    var baseName = this.firstChild.childNodes;
    var albumName;
    var xmlFile;
    for(var j=0; j<baseName.length; j++){
        if(baseName[j].nodeName != null){
            albumName = baseName[j].attributes.albumName;
            xmlFile = baseName[j].attributes.xmlFile;
            myComboBox.addItem({label:baseName[j].attributes.albumName,
                                data:baseName[j].attributes.xmlFile});
            trace("myalbum for label: " + baseName[j].attributes.albumName + " /for data: " + baseName[j].attributes.xmlFile);
            
            }//------close if
        }//-----close for
        
}
mycomboXml.load("mycombodata.xml");

//--------for listBox------------
myArry = new Array();
xmlName = new XML (); //a flash xml object
xmlName.ignoreWhite = true;
xmlName.onLoad = function ()
{  myListBox.vScrollPolicy = "on";
    trace("xmldata loaded success!");
    var baseNode = this.firstChild.childNodes;
    var mylabel, mydata,link;
    for (var i = 0; i < baseNode.length; i++)
    {
        if (baseNode[i].nodeName != null)
        {
            mylabel = baseNode[i].attributes.mylabel;
        mydata = baseNode[i].attributes.mydata;
            myListBox.addItem({label:mylabel,
                              data:mydata});
            
            
//--------------------------output-------------------------
trace("My XmldataList labelList: " + baseNode[i].attributes.mylabel + " databList: " +baseNode[i].attributes.mydata);
            for (var j = 0; j < baseNode[i].childNodes.length; j++)
            {
                if (baseNode[i].childNodes[j].nodeName == "link")
                {
                    link = baseNode[i].childNodes[j].firstChild.nodeValue;
                        //myTextList.addItem({label:baseNodes[i].childNodes[j].firstChild.nodeValue});
                trace("saying:---"+baseNode[i].childNodes[j].firstChild.nodeValue);
                }
            }
            myArray.push(new construct(mylabel, mydata, link));
        }
    }
        
    for(i=0; i<myArray.length; i++){
        //mytitle += "<a href=\"" + myArray[i].link + "\">" + myArray[i].mylabel + "</a>";
        //trace(myArray[i].link);
        }
    
};//-------close xmlName.onLoad function
//function construct(mylabel, mydata, link)
//{
    //this.mylabel = mylabel;
    //this.mydata = mydata;
    //this.link = link;
//}
//-----------myListBox Event-------------
myselection = new Object();
myselection.change = function(ListEvent){
    _root.status._visible=1;
    myPlayBack.setMedia(myListBox.selectedItem.data,"MP3");
    myPlayBack.play(1);
    _root.title=myListBox.selectedItem.label;
    trace("the selected trackPath: " + myListBox.selectedItem.data);
}
myListBox.addEventListener("change",myselection);
//----------comboBox Event---------
mycomboSelect = new Object();
mycomboSelect.close = function(){
    xmlPath="mylistdata.php";
    xmlPath = myComboBox.selectedItem.data;
    xmlName.load(xmlPath);
    myListBox.removeAll();
  myPlayBack.stop();
    _root.title="no tracks selected";
    _root.status._visible=0;
    //mytitle = myComboBox.selectedItem.label;
    //mytitlehidden = myComboBox.selectedItem.label+": ";
    trace("myAlbumSelection: " + xmlName + "/data: " + xmlPath);    
}
myComboBox.addEventListener("close",mycomboSelect);
  1. //-------for myComboBox-----------
  2. var mycomboXml = new XML();
  3. mycomboXml.onLoad = function(){
  4.     var baseName = this.firstChild.childNodes;
  5.     var albumName;
  6.     var xmlFile;
  7.     for(var j=0; j<baseName.length; j++){
  8.         if(baseName[j].nodeName != null){
  9.             albumName = baseName[j].attributes.albumName;
  10.             xmlFile = baseName[j].attributes.xmlFile;
  11.             myComboBox.addItem({label:baseName[j].attributes.albumName,
  12.                                 data:baseName[j].attributes.xmlFile});
  13.             trace("myalbum for label: " + baseName[j].attributes.albumName + " /for data: " + baseName[j].attributes.xmlFile);
  14.             
  15.             }//------close if
  16.         }//-----close for
  17.         
  18. }
  19. mycomboXml.load("mycombodata.xml");
  20. //--------for listBox------------
  21. myArry = new Array();
  22. xmlName = new XML (); //a flash xml object
  23. xmlName.ignoreWhite = true;
  24. xmlName.onLoad = function ()
  25. {  myListBox.vScrollPolicy = "on";
  26.     trace("xmldata loaded success!");
  27.     var baseNode = this.firstChild.childNodes;
  28.     var mylabel, mydata,link;
  29.     for (var i = 0; i < baseNode.length; i++)
  30.     {
  31.         if (baseNode[i].nodeName != null)
  32.         {
  33.             mylabel = baseNode[i].attributes.mylabel;
  34.         mydata = baseNode[i].attributes.mydata;
  35.             myListBox.addItem({label:mylabel,
  36.                               data:mydata});
  37.             
  38.             
  39. //--------------------------output-------------------------
  40. trace("My XmldataList labelList: " + baseNode[i].attributes.mylabel + " databList: " +baseNode[i].attributes.mydata);
  41.             for (var j = 0; j < baseNode[i].childNodes.length; j++)
  42.             {
  43.                 if (baseNode[i].childNodes[j].nodeName == "link")
  44.                 {
  45.                     link = baseNode[i].childNodes[j].firstChild.nodeValue;
  46.                         //myTextList.addItem({label:baseNodes[i].childNodes[j].firstChild.nodeValue});
  47.                 trace("saying:---"+baseNode[i].childNodes[j].firstChild.nodeValue);
  48.                 }
  49.             }
  50.             myArray.push(new construct(mylabel, mydata, link));
  51.         }
  52.     }
  53.         
  54.     for(i=0; i<myArray.length; i++){
  55.         //mytitle += "<a href=\"" + myArray[i].link + "\">" + myArray[i].mylabel + "</a>";
  56.         //trace(myArray[i].link);
  57.         }
  58.     
  59. };//-------close xmlName.onLoad function
  60. //function construct(mylabel, mydata, link)
  61. //{
  62.     //this.mylabel = mylabel;
  63.     //this.mydata = mydata;
  64.     //this.link = link;
  65. //}
  66. //-----------myListBox Event-------------
  67. myselection = new Object();
  68. myselection.change = function(ListEvent){
  69.     _root.status._visible=1;
  70.     myPlayBack.setMedia(myListBox.selectedItem.data,"MP3");
  71.     myPlayBack.play(1);
  72.     _root.title=myListBox.selectedItem.label;
  73.     trace("the selected trackPath: " + myListBox.selectedItem.data);
  74. }
  75. myListBox.addEventListener("change",myselection);
  76. //----------comboBox Event---------
  77. mycomboSelect = new Object();
  78. mycomboSelect.close = function(){
  79.     xmlPath="mylistdata.php";
  80.     xmlPath = myComboBox.selectedItem.data;
  81.     xmlName.load(xmlPath);
  82.     myListBox.removeAll();
  83.   myPlayBack.stop();
  84.     _root.title="no tracks selected";
  85.     _root.status._visible=0;
  86.     //mytitle = myComboBox.selectedItem.label;
  87.     //mytitlehidden = myComboBox.selectedItem.label+": ";
  88.     trace("myAlbumSelection: " + xmlName + "/data: " + xmlPath);    
  89. }
  90. myComboBox.addEventListener("close",mycomboSelect);
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 13 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.