台灣最大程式設計社群網站
線上人數
1073
 
會員總數:246219
討論主題:189783
歡迎您免費加入會員
討論區列表 >> CSS/HTML5/Bootstarp >> 關於mp3player撥放器 不自動播放>"<高手們幫幫我
[]  
[我要回覆]
回應主題 加入我的關注話題 檢舉此篇討論 將提問者加入個人黑名單
關於mp3player撥放器 不自動播放>"<高手們幫幫我
價值 : 60 QP  點閱數:1774 回應數:0
樓主

恋瑀
門外漢
0 24
247 10
發送站內信

請問

mp3player撥放器FLASH 該怎麼設定不自動播放
>"<高手們幫幫我

我又該在哪個地方改

System.useCodepage = true;
data_xml = new XML();
data_xml.ignoreWhite = true;
data_xml.load("mp3player.xml");
var mymusic_array:Array = new Array();
var songTitel:Array = new Array();
var artists:Array = new Array();
var songlrc:Array = new Array();
var AudioPath:String;
var temp:Number = 1; //音乐序号

// 把xml信息读入flash
data_xml.onLoad = function(success) {
if (success == true) {

// 获取信息
audioTracks = new Array();
audioTracks.shuffle();
audioTracks = this.firstChild.childNodes;
song_total = audioTracks.length;
for (var i = 0; i<song_total; i++) {
mymusic_array.push(audioTracks[i].attributes.path);
songTitel.push(audioTracks[i].attributes.title);
artists.push(audioTracks[i].attributes.artist);
songlrc.push(audioTracks[i].attributes.lrcpath);
songlistwindow.songlist.addItemAt(i,songTitel[i],i +1);

// buiding playlist buttons

}
aa();
loadlrc(temp);
}// end of if success

} // end of loadfunction

//以上定义XML类




equalizer._visible = true;
colorctrlwindow._visible = false;
starpicwindow._visible = false;
soundtip._visible = false;
filetip._visible = false;
colortip._visible = false;
lrctip._visible = false;
soundtip._visible = false;
pictip._visible = false;





var listlistener:Object = new Object();
listlistener.change = function(){
mysound.stop();
temp = songlistwindow.songlist.selectedItem.data;
aa();
equalizer._visible = true;
loadlrc(temp); //显示歌词
var startimage:String = String("images/明星/" + artists[temp-1] + ".jpg");
starpicwindow.windowui.loadMovie(startimage); //显示图片
songlrcwindow.songlrcTextArea.vPosition = 0; //滚动条焦点在最上

}
songlistwindow.songlist.addEventListener("change",listlistener);
//以上是list组件侦听


rbtnlistener = new Object();
rbtnlistener.click = function(){
var colorHexString:String = colorctrlwindow.radioGroup.selectedData;
var colorHex:Number = parseInt(colorHexString, 16);
var hairColor_color = new Color(mainshadow,songlrcwindow.songlrcwindowshadow);
hairColor_color.setRGB(colorHex);
var songlrcwindowshadow = new Color(songlrcwindow.songlrcwindowshadow);
songlrcwindowshadow.setRGB(colorHex);
var colorctrlwindowshadow = new Color(colorctrlwindow.colorctrlwindowshadow);
colorctrlwindowshadow.setRGB(colorHex);
var songinfowindowshadow = new Color(songinfowindow.songinfowindowshadow);
songinfowindowshadow.setRGB(colorHex);
var songlistwindowshadow = new Color(songlistwindow.songlistwindowshadow);
songlistwindowshadow.setRGB(colorHex);
var starpicwindowshadow = new Color(starpicwindow.starpicwindowshadow);
starpicwindowshadow.setRGB(colorHex);
var ctrlshadow = new Color(ctrl.ctrlwindowshadow);
ctrlshadow.setRGB(colorHex);
var ctrlshadow2 = new Color(ctrl.ctrlwindowshadow2);
ctrlshadow2.setRGB(colorHex);
}
colorctrlwindow.radioGroup.addEventListener("click",rbtnlistener);
//以上是 radiobutton 组件侦听

function loadlrc(tem) {
lyricspath = songlrc[tem-1];
var lyrics=new XML();
lyrics.ignoreWhite = true;
lyrics.load(lyricspath);
lyrics.onLoad=function(){

songlrcwindow.songlrcTextArea.text = lyrics.toString();
}
} //导入歌词文件并解析

function autoscroll() {

songlrcwindow.songlrcTextArea.vPosition = songlrcwindow.songlrcTextArea.vPosition + 0.3;
}

var intervalID:Number = setInterval(autoscroll, 1200); //设置歌词自动滚动






function aa() {
AudioPath = mymusic_array[temp-1];
mysound = new Sound();
//创建声音类的对象
mysound.loadSound(AudioPath, true);
//以时间声音的方式加载数组声音


mysound.onSoundComplete = function() {
if (temp>song_total -1) {
temp = 1;
} else {
temp++;
}
//以下是list组件的焦点
songlistwindow.songlist.selectedIndices = [temp-1,temp-1];
songlistwindow.songlist.vPosition = temp-1;
loadlrc(temp); //显示歌词
var startimage:String = String("images/明星/" + artists[temp-1] + ".jpg");
starpicwindow.windowui.loadMovie(startimage); //显示图片
songlrcwindow.songlrcTextArea.vPosition = 0; //滚动条焦点在最上
aa();
//重新执行aa()函数
} // end of onSoundComplete
};



onEnterFrame = function () {
mysound.setVolume(_root.ctrl.yinliang.panbtn._x/2);
//设置音量
if(mysound.getBytesLoaded() == mysound.getBytesTotal() ){huanchong.text = " ";}
else{huanchong.text = "缓冲:"+int(mysound.getBytesLoaded()/mysound.getBytesTotal()*100)+"%";}

//缓冲百分比


top.music_name.autoSize = true;
if (songTitel[temp-1].length > 12) {
top.music_name.text = temp + "/" + song_total + " " + songTitel[temp-1]+" "+songTitel[temp-1];
top._x+top._width/2 +4< top_mask._x ? top._x = top_mask._x : top._x--; }
else {
top.music_name.text = temp + "/" + song_total + " " + songTitel[temp-1];
top._x = top_mask._x -16 + (top_mask._width - songTitel[temp-1].length *12 ) / 2 ; }
top.setMask(top_mask);


//输出歌曲名字
zongchangdu = int(mysound.duration/1000);
durtime = int(zongchangdu/60) + ":" + int(zongchangdu%60);
//歌曲总长度,以毫秒为单位
yibofang = int(mysound.position/1000);
if(int(yibofang%60) < 10){postime = "0" + int(yibofang/60) + ":" + "0" + int(yibofang%60);}
else{postime = "0" + int(yibofang/60) + ":" + int(yibofang%60);}
//已经播放的声音 以毫秒为单位
time = postime;
_root.bofangtiao.huakuai._x = 165*(yibofang/zongchangdu);
//播放条
var startimage:String = String("images/明星/" + artists[temp-1] + ".jpg");

//以上是显示明星图片


//以下是文件信息
songinfowindow.currentsongzise.text = Math.round( mysound.getBytesTotal()/(1024*10.24) ) /100 + "MB";
songinfowindow.currentsongduration.text = durtime;
songinfowindow.currentsongtitle.text = songTitel[temp-1];
songinfowindow.currentsinger.text = artists[temp-1];
abcd.text = startimage;

}


--------------------------以上那些我需要改嗎?-----------------

在XML方面~我是設定
<?xml version="1.0" encoding="UTF-8"?>
<player autoStart="no">


但是上傳後還是會自動播放



本篇文章發表於2011-01-19 08:35
目前尚無任何回覆
   

回覆
如要回應,請先登入.