设为首页收藏本站订阅更新

无忧脚本

 找回密码
 加入无忧

QQ登录

只需一步,快速开始

搜索
查看: 5686|回复: 1

[求助] 麻烦帮我看as那个是取消随机播放,如何按顺序播放

[复制链接]
发表于 2010-11-8 21:54:22 | 显示全部楼层 |阅读模式
  1. {
  2.     if (success)
  3.     {
  4.         aPath = new Array();
  5.         songTitel = new Array();
  6.         audioTracks = new Array();
  7.         audioTracks.shuffle();
  8.         audioTracks = this.firstChild.childNodes;
  9.         song_total = audioTracks.length;
  10.         for (var _loc3 = 0; _loc3 < song_total; ++_loc3)
  11.         {
  12.             aPath.push(audioTracks[_loc3].attributes.path);
  13.             songTitel.push(audioTracks[_loc3].attributes.title);
  14.         } // end of for
  15.         autoStart = this.firstChild.attributes.autoStart;
  16.         if (autoStart == "yes")
  17.         {
  18.             playSong();
  19.             _root.mp3player.play_btn._visible = 0;
  20.         }
  21.         else if (autoStart == "no")
  22.         {
  23.             _root.mp3player.play_btn._visible = 1;
  24.             _root.mp3player.pause_btn._visible = 0;
  25.         }
  26.         else if (autoStart == "random")
  27.         {
  28.             current_song = -1;
  29.             _root.mp3player.play_btn._visible = 1;
  30.             _root.mp3player.pause_btn._visible = 0;
  31.         }
  32.         else
  33.         {
  34.             current_song = int(this.firstChild.attributes.autoStart);
  35.             playSong();
  36.             _root.mp3player.play_btn._visible = 0;
  37.         } // end else if
  38.     } // end else if
  39.     delete audioTracks;
  40.     delete data_xml;
  41. } // End of the function
  42. function playSong()
  43. {
  44.     if (current_song = -1)
  45.     {
  46.         current_song = random(song_total) + 1;
  47.     } // end if
  48.     AudioPath = aPath[current_song - 1];
  49.     if (pausePos > 0)
  50.     {
  51.         MySound.start(pausePos, 0);
  52.         pausePos = 0;
  53.     }
  54.     else
  55.     {
  56.         MySound = new Sound();
  57.         MySound.setVolume(volume);
  58.         MySound.loadSound(AudioPath, true);
  59.         MySound.onSoundComplete = function ()
  60.         {
  61.             if (autoStart == "random")
  62.             {
  63.                 current_song = random(song_total) + 1;
  64.             }
  65.             else
  66.             {
  67.                 current_song == song_total ? (current_song = 1) : (current_song++);
  68.             } // end else if
  69.             playSong();
  70.         };
  71.         _root.mp3player.loading.onEnterFrame = function ()
  72.         {
  73.             total = _root.MySound.getBytesTotal();
  74.             geladen = _root.MySound.getBytesLoaded();
  75.             tg = Math.round(geladen * 100 / total);
  76.             if (isNaN(tg))
  77.             {
  78.                 tg = 0;
  79.             } // end if
  80.             if (geladen != total)
  81.             {
  82.                 _root.load_display = "已缓冲" + tg + "%";
  83.             }
  84.             else
  85.             {
  86.                 delete this.onEnterFrame;
  87.                 delete _root.load_display;
  88.             } // end else if
  89.         };
  90.     } // end else if
  91.     _root.mp3player.play_btn._visible = 0;
  92.     _root.mp3player.pause_btn._visible = 1;
  93. } // End of the function
  94. function checkDigits(toCheck)
  95. {
  96.     return (toCheck < 10 ? (toCheck = "0" + toCheck, toCheck) : (toCheck));
  97. } // End of the function
  98. function scrollTitle()
  99. {
  100.     _root.mp3player.title.txt.autoSize = true;
  101.     if (songTitel[current_song - 1].length > 0)
  102.     {
  103.         _root.mp3player.title.txt.text = songTitel[current_song - 1] + "     " + songTitel[current_song - 1];
  104.         _root.mp3player.title._x + _root.mp3player.title._width / 2 + 2 < _root.mp3player.title_mask._x ? (_root.mp3player.title._x = _root.mp3player.title_mask._x) : (_root.mp3player.title._x--);
  105.     }
  106.     else
  107.     {
  108.         _root.mp3player.title.txt.text = "    请点击播放按钮播放MP3...";
  109.         _root.mp3player.title._x = _root.mp3player.title_mask._x - 3;
  110.     } // end else if
  111. } // End of the function
  112. _root.playlist == undefined ? (playlist = "") : (playlist = _root.playlist);
  113. Stage.showMenu = false;
  114. Stage.scaleMode = "noScale";
  115. stop ();
  116. volume = 60;
  117. current_song = -1;
  118. _root.data_xml = new XML();
  119. _root.data_xml.ignoreWhite = true;
  120. _root.data_xml.load(playlist);
  121. _root.data_xml.onLoad = loadData;
  122. this.onEnterFrame = function ()
  123. {
  124.     dur = int(MySound.duration / 1000);
  125.     pos = int(MySound.position / 1000);
  126.     playTime = {};
  127.     playTime.minutes = int(pos / 60);
  128.     playTime.seconds = int(pos % 60);
  129.     playTime.total = checkDigits(playTime.minutes) + ":" + checkDigits(playTime.seconds);
  130.     trackTime = {};
  131.     trackTime.minutes = int(dur / 60);
  132.     trackTime.seconds = int(dur % 60);
  133.     trackTime.total = checkDigits(trackTime.minutes) + ":" + checkDigits(trackTime.seconds);
  134.     if (this.load_display == undefined)
  135.     {
  136.         this.mp3player.display = playTime.total + " / " + trackTime.total;
  137.     }
  138.     else
  139.     {
  140.         this.mp3player.display = this.load_display;
  141.     } // end else if
  142. };
  143. _root.mp3player.play_btn.onRelease = function ()
  144. {
  145.     playSong();
  146. };
  147. _root.mp3player.pause_btn.onRelease = function ()
  148. {
  149.     this._visible = 0;
  150.     _root.mp3player.play_btn._visible = 1;
  151.     pausePos = MySound.position / 1000;
  152.     MySound.stop();
  153. };
  154. _root.mp3player.next_btn.onRelease = function ()
  155. {
  156.     delete pausepos;
  157.     current_song = random(song_total) + 1;
  158.     MySound.stop();
  159.     playSong();
  160. };
  161. _root.mp3player.prev_btn.onRelease = function ()
  162. {
  163.     delete pausepos;
  164.     current_song = random(song_total) - 1;
  165.     MySound.stop();
  166.     playSong();
  167. };
  168. _root.mp3player.title.setMask(_root.mp3player.title_mask);
  169. setInterval(scrollTitle, 40);
  170. showed = true;
  171. _root.mp3player.btn_hide._visible = 0;
  172. _root.mp3player.btn_show._visible = 1;
  173. _root.mp3player.btn_show.onPress = function ()
  174. {
  175.     if (showed == true)
  176.     {
  177.         _root.mp3player.easeX(304);
  178.         _root.mp3player.btn_hide._visible = 1;
  179.         _root.mp3player.btn_show._visible = 0;
  180.         showed = false;
  181. [b] 麻烦帮我看as那个是取消随机播放,如何按顺序播放[/b]
  182.    } // end if
  183. };
  184. _root.mp3player.btn_hide.onPress = function ()
  185. {
  186.     if (showed == false)
  187.     {
  188.         _root.mp3player.easeX(3);
  189.         _root.mp3player.btn_hide._visible = 0;
  190.         _root.mp3player.btn_show._visible = 1;
  191.         showed = true;
  192.     } // end if
  193. };
  194. MovieClip.prototype.easeX = function (t)
  195. {
  196.     this.onEnterFrame = function ()
  197.     {
  198.         this._x = int(t - (t - this._x) / 1.500000E+000);
  199.         if (this._x > t - 1 && this._x < t + 1)
  200.         {
  201.             delete this.onEnterFrame;
  202.         } // end if
  203.     };
  204. };
复制代码
您需要登录后才可以回帖 登录 | 加入无忧

本版积分规则

小黑屋|手机版|Archiver|无忧脚本 ( 苏ICP备05080427号 )|值班电话:027-62300445   鄂公网安备 42011102000433号

GMT+8, 2017-11-20 01:46 , Processed in 0.092920 second(s), 7 queries , Gzip On, Memcache On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表