我有一个基于学校的mp3播放器的Flash代码。当我单击“下一首歌”时,我需要它转到下一首歌,除非它是播放列表中的最后一首歌,在这种情况下,它需要回到播放列表中的第1首歌。
下面的代码似乎没有做的把戏,有什么想法,我去哪里错了?
var songlist:XMLList;
var currentIndex:Number = 0;
还有。。
function nextSong(e:Event):void
{
if (currentIndex < (songlist.length() - 1))
{
currentIndex++;
}
else
{
currentIndex = 0;
}
var nextReq:URLRequest = new URLRequest(songlist[1].url);
var nextTitle:Sound = new Sound(nextReq);
sc.stop();
title_txt.text = songlist[1].title;
artist_txt.text = songlist[1].artist;
sc = nextTitle.play();
songPlaying = true;
currentSound = nextTitle;
}