问道强击叠加吗:跪求!!??flash问题,谁能帮我翻译一下,并帮我写一下它的xml文件

来源:百度文库 编辑:高考问答 时间:2024/04/30 16:00:16
//变量
var mp3_loader = new Sound();
var mp3listXML = new XML();
var mp3autoindex = new Array();
var a_path = new Array();
var a_title = new Array();
var mp3autoindex = new Array();
var mp3autoactual = new Number();
//设定初始值
var time1 = time2=time3=time4=0;
var circle = 0;
var mp3autoactual = 0;
qumu_mc.you_work = "没播放";
qumu_mc.play_state = "单曲播放";
//判断xml载入状态
mp3listXML.load("newmp3play.xml");
mp3listXML.ignoreWhite = true;
mp3listXML.onLoad = function(success) {
if (success) {
loader = "ok";
parseXML();
} else {
loader = "警告:声音变量传输错误!";
}
};
//分析xml
function parseXML() {
auto_index = mp3listXML.firstChild.childNodes;
mp3autoindex = auto_index.length;
for (var i = 0; i<mp3autoindex; i++) {
a_path[i] = mp3listXML.childNodes[0].childNodes[i].attributes.path;
a_title[i] = mp3listXML.childNodes[0].childNodes[i].attributes.title;
}
mp3autopath = a_path[0];
mp3_a_title = a_title[0];
}
//选择状态显示? 有问题
function color_state() {
var but_color = new Color(but);
but_color.setRGB(0x993366);
if (circle == 0) {
but = "Btn_single";
} else if (circle == 1) {
but = "Btn_circle";
} else if (circle == 2) {
but = "Btn_once_more";
}
}
//显示载入进度
function paly_show() {
BT = mp3_loader.getBytesTotal();
BL = mp3_loader.getBytesLoaded();
if (BL != BT) {
loader_result = Math.round((BL/BT)*100)+"%";
mp3load_mc._xscale = Math.round((BL/BT)*100);
} else if (BL == undefined) {
loader_result = "0%";
mp3load_mc._xscale = 0;
} else if (BT == BL) {
loader_result = "100%";
mp3load_mc._xscale = 100;
}
}
//显示时间
function time_show() {
PT = mp3_loader.position;
DT = mp3_loader.duration;
time1 = int(PT/60000)<10 ? "0"+int(PT/60000) : int(PT/60000);
time2 = int(PT/1000%60)<10 ? "0"+int(PT/1000%60) : int(PT/1000%60);
time3 = int(DT/60000)<10 ? "0"+int(DT/60000) : int(DT/60000);
time4 = int(DT/1000%60)<10 ? "0"+int(DT/1000%60) : int(DT/1000%60);
timeline = time1+":"+time2+" - "+time3+":"+time4;
mp3play_mc._xscale = int((PT/DT)*100);
}
//检查mp3autoactual的合法性
function autoactual_check_show() {
if (mp3autoactual>=mp3autoindex) {
mp3autoactual = 0;
mp3autopath = a_path[0];
mp3_a_title = a_title[0];
}
else if (mp3autoactual<0) {
mp3autoactual = 0;
mp3autopath = a_path[0];
mp3_a_title = a_title[0];
}
}
//载入mp3
function mp3_show() {
autoactual_check_show();
mp3_loader = new Sound();
mp3_loader.loadSound(mp3autopath, true);
}

平身~~