【问题标题】:Flash MP3 player loop from XML playlist来自 XML 播放列表的 Flash MP3 播放器循环
【发布时间】:2010-09-18 13:47:55
【问题描述】:

我有一个基于 School of Flash 代码的 mp3 播放器。当我点击“下一首歌曲”时,我需要它转到下一首歌曲,除非它是播放列表中的最后一首歌曲,在这种情况下,它需要返回播放列表中的第 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;
}

【问题讨论】:

    标签: xml flash actionscript-3


    【解决方案1】:

    不应该是songlist[currentIndex]而不是songlist[1]吗?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-05-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-20
      • 1970-01-01
      • 2011-05-29
      • 1970-01-01
      相关资源
      最近更新 更多