getting continuous play in the mp3 player
- glennnphp
- Born


- Joined: Aug 26, 2006
- Posts: 1
- Status: Offline
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
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);
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);
- //-------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);
- Anonymous
- Bot


- Joined: 25 Feb 2008
- Posts: ?
- Loc: Ozzuland
- Status: Online
August 26th, 2006, 12:18 pm
Page 1 of 1
To Reply to this topic you need to LOGIN or REGISTER. It is free.
Post Information
- Total Posts in this topic: 1 post
- Users browsing this forum: No registered users and 33 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
