0
我已經修改了以下腳本,我想刪除隨機腳本,並改爲使其顯示爲xml訂閱源的順序,但我試過了,但沒有任何效果爲了我。動作腳本按出現的順序對xml Feed進行排序
我需要修改這一行:_global.song_nr = random(songfile.length);
完整劇本
playlist.onLoad = function(success) {
if (success) {
_global.songname = [];
_global.songband = [];
_global.songimg = [];
_global.songdate = [];
_global.songfile = [];
for (var i = 0; i<playlist.firstChild.childNodes.length; i++) {
_global.songname[i] = playlist.firstChild.childNodes[i].attributes.name;
_global.songband[i] = playlist.firstChild.childNodes[i].attributes.artist;
_global.songimg[i] = playlist.firstChild.childNodes[i].attributes.img;
_global.songdate[i] = playlist.firstChild.childNodes[i].attributes.date;
_global.songfile[i] = playlist.firstChild.childNodes[i].attributes.file;
trace(songname[i]+" "+songband[i]+" "+songimg[i]+" "+songdate[i]+" "+songfile[i]);
}
}
_root.createEmptyMovieClip("sound_mc", 1);
_root.sound_mc.sound_obj = new Sound();
_global.song_nr = random(songfile.length);
_root.sound_mc.songStarter(songfile[song_nr], songname[song_nr], songband[song_nr], songimg[song_nr], songdate[song_nr]);
};
ActionScript 2中,_root,_global ...的聲音喜歡的樂趣:P嘗試_global.song_nr = 0;或_global.song_nr = songfile.length-1;獲取第一個或最後一個值,具體取決於您的Feed設置方式 – 2011-04-19 13:19:58