Hallo,
habe ein Problem mit der xml datei vom Audio Player,kann mir jemand die xml datei evtl. einrichten?
AS
PHP-Code:
function startMp3Loader()
{
if (song >= songFiles.length || song == undefined)
{
song = 0;
} // end if
if (song < 0)
{
song = songFiles.length - 1;
} // end if
_parent.musictitle.text = songArtist[song];
mp3.loadSound(songFiles[song], true);
mp3Loader.gotoAndStop(1);
mp3Position.gotoAndStop(1);
this.onEnterFrame = function ()
{
percent = mp3.getBytesLoaded() / mp3.getBytesTotal() * 100;
if (!isNan(percent))
{
frame = Math.floor(percent);
mp3Loader.gotoAndStop(frame);
mp3Percent = mp3.position / mp3.duration * percent;
mp3Frame = Math.floor(mp3Percent);
mp3Position.gotoAndStop(mp3Frame);
if (mp3Percent == 100)
{
} // end if
} // end if
mp3.onSoundComplete = function ()
{
mp3Loader.gotoAndStop(1);
mp3Position.gotoAndStop(1);
++song;
startMp3Loader();
};
if (mp3.position == 0 && percent == 100)
{
mp3.start();
} // end if
};
} // End of the function
function pause()
{
var _loc1 = _root;
if (_loc1.mp3Status == "start")
{
mp3.start(pausePosistion, 0);
_loc1.mp3Status = "stop";
play_mp.enabled = false;
return;
} // end if
pausePosistion = mp3.position / 1000;
mp3.stop();
_loc1.mp3Status = "start";
play_mp.enabled = true;
} // End of the function
_global.songArtist = new Array();
_global.songFiles = new Array();
playlist = new XML();
player.onLoad = function (suc)
{
i = 0;
if (suc)
{
for (var _loc1 = player; _loc1 != null; _loc1 = _loc1.nextSibling)
{
var _loc2 = _loc1.nodeName;
if (_loc2 != null)
{
songArtist[i] = "0" + i + "." + _loc1.attributes.name;
songFiles[i] = _loc1.attributes.link;
++i;
} // end if
if (_loc1.firstChild != null)
{
_loc1 = _loc1.firstChild;
continue;
} // end if
if (_loc1.nextSibling != null)
{
_loc1 = _loc1.nextSibling;
continue;
} // end if
_loc1 = _loc1.parentNode;
} // end of for
} // end if
startMp3Loader();
play_mp.enabled = false;
};
playlist.load("playlist.xml");
mp3 = new Sound();
XML Datei (Playlist.xml)
PHP-Code:
<?xml version="1.0" encoding="UTF-8"?>
<player>
<songFiles ="song"="test1.mp3" />
<songFiles ="song"="test2.mp3" />
</player>
fängt einfach net an zu laden
was stimmt an dem xml Dokument nicht???