asi como lo tienen las web de atevip, y tantas otras utilizando un player.swf y leyendo un audiolist.xml
pero ahora estoy tratando de hacer que un reproductor parecido lee un xml dinamico, osea con un php "lista.php"
espero que me ayuden, ya logre generar mi lista.php
pero el problema es que no actualiza mi reproductor la lista dinamica nueva generada
aqui esta el codigo
gracias de antemano
:: llama la lista dinamica
Código :
onClipEvent (construct)
{
playlist = "lista.php";
status = "Status: Loading";
playatstart = true;
playerlook = true;
StreamSignal = true;
}
y aqui la lista que genera el audio player
function ladeDaten(success)
{
if (success)
{
aPath = new Array();
songTitel = new Array();
songArtist = new Array();
songCover = new Array();
audioTracks = new Array();
audioTracks = this.firstChild.childNodes;
totalAudio = audioTracks.length;
for (var _loc2 = 0; _loc2 < totalAudio; ++_loc2)
{
if (audioTracks[_loc2].nodeName == "song")
{
aPath.push(audioTracks[_loc2].attributes.path);
songTitel.push(audioTracks[_loc2].attributes.title);
songArtist.push(audioTracks[_loc2].attributes.artist);
songCover.push(audioTracks[_loc2].attributes.bild);
} // end if
} // end of for
AudioPath = aPath[0];
titel = songTitel[0];
artist = songArtist[0];
aktAudio = 1;
trackAnzeige = aktAudio + " / " + totalAudio;
status = "Status: Cargando la Lista de Musicas";
if (playerlook)
{
setCover(0);
} // end if
erstesBild = true;
setzeDirektwahl();
setzePlaylistwahl();
if (playatstart)
{
playSong();
} // end if
}
else
{
status = "Status: PlayList - Not loaded";
} // end else if
delete audioTracks;
delete data_xml;
} // End of the function
function setCover(pNr)
{
if (_currentframe == 2 || !erstesBild)
{
cover_mc.loadMovie(songCover[pNr], 1);
} // end if
} // End of the function
function ruck(diff)
{
pausgabe = MySound.position - diff;
MySound.stop();
MySound.start(pausgabe / 1000, 0);
} // End of the function
function vor(diff)
{
pausgabe = MySound.position + diff;
MySound.stop();
MySound.start(pausgabe / 1000, 0);
} // End of the function
function playSong()
{
if (pauseSignal == true)
{
MySound.start(pausePos, 0);
pauseSignal = false;
playSignal = true;
delete pausePos;
kugel_mc._visible = 1;
}
else
{
MySound = new Sound();
if (volstatus < volume)
{
volume = volstatus;
}
else if (volstatus > volume)
{
volume = volstatus;
}
else if (volstatus == 100)
{
volume = 100;
} // end else if
if (balstatus < balance)
{
balance = balstatus;
}
else if (balstatus > balance)
{
balance = balstatus;
}
else if (balstatus == 0)
{
balance = 0;
} // end else if
MySound.loadSound(AudioPath, StreamSignal);
MySound.setVolume(volume);
MySound.setPan(balance);
MySound.onSoundComplete = function ()
{
if (playrepeat)
{
playSong();
}
else
{
nextTrack();
playSong();
} // end else if
};
volstatus = volume;
balstatus = balance;
pauseSignal = false;
playSignal = true;
wahlSignal = false;
_parent.onEnterFrame = function ()
{
total = MySound.getBytesTotal();
geladen = MySound.getBytesLoaded();
if (geladen != total)
{
if (geladen != undefined && total != undefined)
{
status = "Status: " + Math.round(geladen * 100 / total) + "% Cargando";
} // end if
mc._xscale = Math.round(geladen * 100 / total);
}
else
{
status = "Status: playing -100% Cargado";
delete _parent.onEnterFrame;
kugel_mc._visible = 1;
if (!StreamSignal)
{
MySound.start(0, 0);
} // end if
} // end else if
};
} // end else if
} // End of the function
function nextTrack()
{
if (aktAudio < totalAudio)
{
aktAudio = aktAudio + 1;
AudioPath = aPath[aktAudio - 1];
titel = songTitel[aktAudio - 1];
artist = songArtist[aktAudio - 1];
MySound.stop();
playSignal = 0;
pauseSignal = 0;
wahlSignal = 1;
delete pausePos;
kugel_mc._visible = 0;
trackAnzeige = aktAudio + " / " + totalAudio;
status = "Status: stopped - press play";
setCover(aktAudio - 1);
} // end if
} // End of the function
function prevTrack()
{
if (aktAudio > 1)
{
aktAudio = aktAudio - 1;
AudioPath = aPath[aktAudio - 1];
titel = songTitel[aktAudio - 1];
artist = songArtist[aktAudio - 1];
MySound.stop();
playSignal = 0;
pauseSignal = 0;
wahlSignal = 1;
delete pausePos;
kugel_mc._visible = 0;
trackAnzeige = aktAudio + " / " + totalAudio;
status = "Status: stopped - press play";
setCover(aktAudio - 1);
} // end if
} // End of the function
function checkDigits(pWert)
{
var _loc1 = pWert;
return (_loc1 < 10 ? (_loc1 = "0" + _loc1, "0" + _loc1) : (_loc1));
} // End of the function
function sBalken(obj)
{
prozent = _global.position * 100 / _global.dauer;
this[obj]._xscale = prozent;
prozent = parseInt(prozent) + "%";
} // End of the function
function setzeDirektwahl()
{
var _loc3 = this;
for (var _loc2 = 1; _loc2 <= 12; ++_loc2)
{
_loc3["dw" + _loc2 + "_btn"].nrtxt = _loc2;
if (_loc2 > totalAudio)
{
_loc3["dw" + _loc2 + "_btn"].nr_txt.text = "--";
} // end if
} // end of for
} // End of the function
function setzeAudiowahl(pAkt)
{
aktAudio = pAkt;
AudioPath = aPath[aktAudio - 1];
titel = songTitel[aktAudio - 1];
artist = songArtist[aktAudio - 1];
MySound.stop();
playSignal = 0;
pauseSignal = 0;
wahlSignal = 1;
delete pausePos;
kugel_mc._visible = 0;
trackAnzeige = aktAudio + " / " + totalAudio;
status = "Status: stopped - press play";
setCover(aktAudio - 1);
playSong();
} // End of the function
function setzePlaylistwahl()
{
playauswahl.playliste = "";
for (var _loc1 = 1; _loc1 <= aPath.length; ++_loc1)
{
playauswahl.playliste = playauswahl.playliste + ("<a href=\'asfunction:playauswahl," + _loc1 + "\'><font color=\'#FF0000\'>" + _loc1 + ":</font><font color=\'#FFFFFF\'> " + songTitel[_loc1 - 1].substr(0, 500) + "</a></font><br>");
} // end of for
} // End of the function
function playlistauswahl(pAkt)
{
aktAudio = int(pAkt);
AudioPath = aPath[aktAudio - 1];
titel = songTitel[aktAudio - 1];
artist = songArtist[aktAudio - 1];
MySound.stop();
playSignal = 0;
pauseSignal = 0;
wahlSignal = 1;
delete pausePos;
kugel_mc._visible = 0;
trackAnzeige = aktAudio + " / " + totalAudio;
status = "Status: stopped - press play";
setCover(aktAudio - 1);
playSong();
} // End of the function
data_xml = new XML();
data_xml.ignoreWhite = true;
data_xml.onLoad = ladeDaten;
data_xml.load(playlist);
volume = 100;
balance = 0;
play_btn.onRelease = function ()
{
playSong();
};
play_btn.onRollOver = function ()
{
status = "Status: load / play song";
};
play_btn.onRollOut = function ()
{
status = playSignal ? (status = "Status: playing") : (status = "Status: stopped");
};
stop_btn.onRelease = function ()
{
MySound.stop();
playSignal = 0;
delete pausePos;
kugel_mc._visible = 0;
};
stop_btn.onRollOver = function ()
{
status = "Status: stop playing";
};
stop_btn.onRollOut = function ()
{
status = !playSignal ? (status = "Status: stopped") : (status = "Status: playing");
};
pause_btn.onRelease = function ()
{
if (!wahlSignal)
{
pausePos = MySound.position / 1000;
MySound.stop();
pauseSignal = true;
playSignal = false;
kugel_mc._visible = 0;
status = "Status: press play";
} // end if
};
pause_btn.onRollOver = function ()
{
status = !pauseSignal ? (status = "Status: pause playing") : (status = "Status: press play");
};
pause_btn.onRollOut = function ()
{
status = !playSignal ? (status = "Status: stopped") : (status = "Status: playing");
};
next_btn.onRelease = function ()
{
if (aktAudio < totalAudio)
{
nextTrack();
playSong();
} // end if
};
next_btn.onRollOver = function ()
{
dstatus = status;
status = "Status: load next song";
};
next_btn.onRollOut = function ()
{
if (status != "Status: stopped - press play")
{
status = dstatus;
} // end if
};
prev_btn.onRelease = function ()
{
if (aktAudio > 1)
{
prevTrack();
playSong();
} // end if
};
prev_btn.onRollOver = function ()
{
dstatus = status;
status = "Status: load prev song";
};
prev_btn.onRollOut = function ()
{
if (status != "Status: stopped - press play")
{
status = dstatus;
} // end if
};
zeit_btn.onRelease = function ()
{
zeitSignal = !zeitSignal;
};
zeit_btn.onRollOver = function ()
{
dstatus = status;
status = "Status: Total / " + t_TrackZeit.total + " - switch timedisplay ";
};
zeit_btn.onRollOut = function ()
{
status = dstatus;
};
drag_btn.onPress = function ()
{
startDrag (this._parent, false);
};
drag_btn.onRelease = drag_btn.onReleaseOutside = function ()
{
stopDrag ();
};
drag_btn.onRollOver = function ()
{
dstatus = status;
status = "Status: drag \'n\' drop";
};
drag_btn.onRollOut = function ()
{
status = dstatus;
};
look_btn.onPress = function ()
{
if (_currentframe == 2)
{
cover_mc._visible = 0;
gotoAndStop(3);
}
else
{
cover_mc._visible = 1;
gotoAndStop(2);
setzeDirektwahl();
setzePlaylistwahl();
setCover(aktAudio - 1);
} // end else if
};
look_btn.onRollOver = function ()
{
dstatus = status;
status = "Status: change look - simple/extended";
};
look_btn.onRollOut = function ()
{
status = dstatus;
};
fslogo_btn.onPress = function ()
{
fslogo_mc._visible = !fslogo_mc._visible;
};
fslogo_btn.onRollOver = function ()
{
dstatus = status;
status = "Status: player - credits";
};
fslogo_btn.onRollOut = function ()
{
status = dstatus;
};
fslogo_mc._visible = 0;
fslogo_mc.onRelease = function ()
{
getURL("http://ATeMusic.Ya.ST", "_blank");
};
kugel_mc._visible = 0;
onEnterFrame = function ()
{
var _loc2 = _global;
_loc2.dauer = int(MySound.duration / 1000);
_loc2.position = int(MySound.position / 1000);
t_TrackZeit = {};
t_TrackZeit.minutes = int(_loc2.dauer / 60);
t_TrackZeit.seconds = int(_loc2.dauer % 60);
t_TrackZeit.total = checkDigits(t_TrackZeit.minutes) + ":" + checkDigits(t_TrackZeit.seconds);
b_TrackZeit = {};
b_TrackZeit.minutes = int(_loc2.position / 60);
b_TrackZeit.seconds = int(_loc2.position % 60);
b_TrackZeit.total = checkDigits(b_TrackZeit.minutes) + ":" + checkDigits(b_TrackZeit.seconds);
n_TrackZeit = {};
n_TrackZeit.minutes = int((_loc2.dauer - _loc2.position) / 60);
n_TrackZeit.seconds = int((_loc2.dauer - _loc2.position) % 60);
n_TrackZeit.total = checkDigits(n_TrackZeit.minutes) + ":" + checkDigits(n_TrackZeit.seconds);
sBalken("smc");
if (zeitSignal)
{
display = n_TrackZeit.total;
}
else
{
display = b_TrackZeit.total;
} // end else if
if (trackDrag != true)
{
regler_mc._x = MySound.position / MySound.duration * sliderMax;
} // end if
};
MovieClip.prototype.dClick = function (tempo)
{
var _loc2 = this;
ASSetPropFlags(_loc2, ["clickZeit"], 1);
if (_loc2.clickZeit - (_loc2.clickZeit = getTimer()) + tempo > 0)
{
return (true);
} // end if
};
if (!playerlook)
{
gotoAndStop(3);
} // end if
trackDrag = false;
sliderMax = bigdisplay_mc._width;
regler_mc.onPress = function ()
{
var _loc2 = this;
if (_loc2._parent.MySound)
{
trackDrag = true;
startDrag (_loc2, false, 0, _loc2._y, sliderMax, _loc2._y);
_loc2._parent.onMouseMove = function ()
{
updateAfterEvent();
};
} // end if
};
regler_mc.onRelease = regler_mc.onReleaseOutside = function ()
{
var _loc2 = this;
if (_loc2._parent.MySound)
{
trackDrag = false;
delete _loc2._parent.onMouseMove;
stopDrag ();
neuePosition = _loc2._x * (MySound.duration / 1000) / sliderMax;
pausePos = neuePosition;
MySound.stop();
MySound.start(neuePosition, 0);
kugel_mc._visible = 1;
status = "Status: playing";
dstatus = status;
playSignal = true;
pauseSignal = false;
} // end if
};
regler_mc.onRollOver = function ()
{
dstatus = status;
status = "Status: Drag Slider";
};
regler_mc.onRollOut = function ()
{
status = dstatus;
};
repeat_mc._visible = 0;
repeat_btn.onRelease = function ()
{
playrepeat = !playrepeat;
repeat_mc._visible = playrepeat;
};
repeat_btn.onRollOver = function ()
{
dstatus = status;
status = "Status: repeat track";
};
repeat_btn.onRollOut = function ()
{
status = dstatus;
};
suerte// byadicto 