Flash Player displays LRC lyrics code

Source: Internet
Author: User
Tags error handling split
Flash Playback | Show demo address: http://www.kaitian.cc/bbs/music/index.html

Function view () {
Timegesu = 1;
Totalgeci = new Array ();
Total = new Array ();
Text_st = String (_parent.story);
array_t = Text_st.split ("\ n");
Split into arrays.
For (i=0 i<array_t.length; i++) {
KK = "[01:50.93][00:18.55] Test testing test test test";
if (!isnan (Array_t[i].charat (1)) and (Array_t[i].charat (0) = = "[)] {
ARRAY_TXX = Array_t[i].split ("]");
For (y=0 y<array_txx.length; y++) {
if (Array_txx[y].charat (0) = = "[") {
Array_txx[y] = array_txx[y].substr (1);
}
}
The/*ARRAY_TXX records a value other than [] and the time form is left. Note that even the [01:50.93] form is divided into two elements after the split. */
For (y=0 y<array_txx.length-1; y++) {
Timeallff = 0;
Zanshi_arry = Array_txx[y].split (":");
For (j=0 j<zanshi_arry.length; j + +) {
Siwuzi = number (zanshi_arry[j]);
if (j = = 0) {
Timeallff + = siwuzi*60;
else if (j = = 1) {
Timeallff + = Siwuzi;
} else {
Error handling
}
}
Array_txx[y] = Timeallff;
}
For (y=0 y<array_txx.length-1; y++) {
Total[timegesu] = Array_txx[y];
Totalgeci[timegesu] = array_txx[array_txx.length-1];
timegesu++;
}
}
}
Put the lyrics and time into the array: Total and totalgeci;
For (Y=1 y<total.length; y++) {
For (j=y+1 j<total.length; j + +) {
if (Total[j]<total[y]) {
cons = Total[j];
TOTAL[J] = Total[y];
Total[y] = cons;
cons = Totalgeci[j];
TOTALGECI[J] = Totalgeci[y];
Totalgeci[y] = cons;
}
}
}
Sort! Lyrics and time are also sorted!
ix=0;
_root.geci_bar.show_text = "<br><br><br><br><br>";
y = 1;
Total[0] = 0;
Totalgeci[0] = "";
For (m=1 m<totalgeci.length; m++) {
if (Totalgeci[m]) {
_root.geci_bar.show_text + = Totalgeci[m];
}
}
_root.geci_bar.show_text = "<br><br><br><br><br><br>";
Onenterframe = function () {
if (_root.lssssss = = _root.gequming) {
if (_root.zs>=total[y] and _root.zs<total[y+1]) {
Gc_view = Totalgeci[y];
Jiangeshi = Total[y+1]-total[y];
Dangeshijian = jiangeshi/(totalgeci[y].length);
if ((_root.zs>total[y]+dangeshijian*ix) && _root.viewmodem) {
GC_VIEWL = mbsubstring (gc.text, 0, ix++);
_root.geci_bar.loadtext = GC_VIEWL;
}
if (!_root.viewmodem) {
_root.geci_bar.loadtext = Gc_view;
}
if (y>1) {
_root.geci_bar.yi_kuan.scroll = y;
}
if (y<=1) {
_root.geci_bar.yi_kuan.scroll = 1;
}
else if (_root.zs<total[y]) {
y--;
if (y<0) {
y = 0;
}
IX = 0;
else if (_root.zs>=total[y+1]) {
y++;
IX = 0;
} else {
Except the wrong!
Gc_view = "";
}
} else {
GC_VIEWL = "";
Gc_view = "No lyrics!" Sorry!!! ";
_root.geci_bar.show_text= "No lyrics!" \ n \ nplease if you have new music or LRC lyrics, please provide the address, thank!\n\n Email: yi0731@163.com ";
}
};
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.