快速业务通道

网络版歌词秀——AS制作

作者 佚名技术 来源 服务器技术 浏览 发布时间 2012-07-12
rn geci;
}
//记录时间(编辑歌词用),geci为Object数组,每个元素包括(stime,etime,txt)
function get_time() {
if (loading.text == "编辑状态") {
var time = myMU.position;
//将1000分之一秒换算为60分之一秒,并转换为60进制数
time = jh_10toD(time/100*6, 60);
var i = Math.floor(counter/2);
if (i if (counter%2 == 0) {
geci0[i].stime = "["+time+",";
} else {
geci0[i].etime = time+"]";
}
var newhtml = "";
var sline = Math.max(i-2, 0);
var eline = Math.max(Math.min(i+4, geci0.length), 6);
var tempstr;
for (var j = sline; j tempstr = geci0[j].stime+geci0[j].etime+geci0[j].txt;
if (j == i) {
newhtml += ""+tempstr+"
";
} else {
newhtml += tempstr+"
";
}
}
in_out.htmlText = newhtml.slice(0, newhtml.length-4)+"";
counter++;
}
}
}
//字幕演示
function mvtext(music:Sound, geci:Array) {
var tt2 = setInterval(test, 100);
var counter2 = 0;
function test() {
if (loading.text == "演示状态") {
if (music.position-geci[counter2].stime>0) {
while (music.position-geci[counter2].stime>0) {
counter2++;
}
counter2--;
var newhtml = "";
var sline = Math.max(counter2-2, 0);
var eline = Math.max(Math.min(counter2+4, geci.length), 6);
for (var i = sline; i if (i == counter2) {
newhtml += ""+geci[i].txt+"
";
} else {
newhtml += geci[i].txt+"
";
}
}
in_out.htmlText = newhtml.slice(0, newhtml.length-4)+"";
counter2++;
if (counter2>=geci.length) {
trace("kkkk");
clearInterval(tt2);
}
}
}
}
}
//
//建立状态显示框
this.createTextField("loading", this.getNextHighestDepth(), 13, 10, 100, 20);
loading.textColor = 0x339900;
loading.selectable = false;
loading.text="";
//建立歌词显示框
this.createTextField("in_out", this.getNextHighestDepth(), 10, 10, 280, 100);
in_out.border = true;
in_out.multiline = true;
in_out.html = true;
in_out.htmlText = "";
//全局变量:
var geci0 = {};
var geci;
var counter = 0;
var stime = 0;
var myMU = new Sound(this);
//获取自身文件所在地址,加载同目录下同名txt文件,以获取mp3和txt的信息
var filepath = this._url.substr(0, this._url.length-3)+"txt";
var myurl = {};
loadTXT(filepath, myurl, loadMp3AndTxt);
delete filepath;
//获得mp3和txt的url信息后执行:
function loadMp3AndTxt() {
myurl = myurl.data.split("\r\n");
loadTXT(myurl[0], geci0, begin);
myMU.loadSound(myurl[1], false);
var myintervalID = setInterval(loadingtxt, 100);
function loadingtxt() {
var kk = Math.round(100*myMU.getBytesLoaded()/myMU.getBytesTotal());
if (kk == 100) {
go();
clearInterval(myintervalID);
}else{
loading.text = "加载中"+kk+"%";
}

}
delete myurl;
}
//获得歌词文本后执行:
function begin() {
geci = toarray(geci0.data);
geci0 = new Array();
for(var i=0;i geci0[i]={};
geci0[i].txt=geci[i].txt;
geci0[i].stime="";
geci0[i].etime="";
}
var newhtml = "";
for (var i = 0; i<6; i++) {
newhtml += geci[i].txt+"
";
}
in_out.htmlText =newhtml.slice(0,newhtml.length-4)+ "";
}
myMU.onLoad = go;
//音乐加载完毕后执

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号