- UID
- 29427
- 积分
- 34611
- 经验
-
- 点数
-
- 油豆
-
- 荣誉
-
- 在线时间
- 小时
- 注册时间
- 2008-11-4
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2014-1-14 17:27
|
显示全部楼层
来自:天津市
在我的家家琐事的置顶帖子里就有歌曲连放的FLASH帖子。我是根据那个做的。用闪客打开后,有个指令动作,在属性里打开这个动作。就会有如下代码:function loadsound(x)
{
played = 0;
aa = 0;
paused = false;
abc = true;
s = new Sound();
s.loadSound(x, true);
trackname = id + 1 + "." + mp3name[id];
s.start();
s.onSoundComplete = function ()
{
id = id == mp3name.length - 1 ? (0) : (id + 1);
loadsound(mp3[id]);
};
mix.gotoAndStop(1);
cp.gotoAndPlay(1);
addList();
} // End of the function
function getid(i)
{
id = int(i);
addList();
clearInterval(poll);
loadsound(mp3[id]);
} // End of the function
function addList()
{
Name = "";
for (var _loc1 = 0; _loc1 < mp3name.length; ++_loc1)
{
num = int(_loc1) + 1;
num = num < 10 ? ("0" + num) : (num);
if (id != _loc1)
{
Name = Name + "<a href=\"asfunction:getid," + _loc1 + "\">" + num + "." + mp3name[_loc1] + "</a><BR>";
continue;
} // end if
Name = Name + "<a href=\"asfunction:getid," + _loc1 + "\"><font color=\"#FF00FF\">" + num + "." + mp3name[_loc1] + "</font></a><BR>";
} // end of for
musicList.styleSheet = myStyleSheet;
musicList.htmlText = Name;
} // End of the function
function getPlaying()
{
} // End of the function
function setPlaying(state)
{
btn9._visible = state;
btn3._visible = !state;
} // End of the function
var j = 0;
var mp3name = ["甜蜜蜜", "我只在乎你", "月亮代表我的心", "漫步人生路", "在水一方", "小城故事", "又见炊烟", "我和你", "高山青", "路边的野花不要采", "酒醉的探戈"];
var mp3 = ["http://www.zlvod.cn/zl_topic/tmm/music/tmm.mp3", "http://ems.waheaven.com/uploadfiles/image/information/musicinfo/musicfilepath/2010/7/3e5c0307c67c40f897ae16d7b67c9809.mp3", "http://szjfflower.com/img/music1.mp3?sid=6685387d615e8f6706831e3cbaa722a8", "http://file2.qlteacher.com/cz2012/medias/upload/2012/07/31/%E9%82%93%E4%B8%BD%E5%90%9B_-_%E6%BC%AB%E6%AD%A5%E4%BA%BA%E7%94%9F%E8%B7%AF.mp3", "http://www.thjy.org/uploadfile/200614125710803.mp3", "http://fridaying.com/huang/music/xiaochenggushi.mp3", "http://cardimg.163.com/cards/mp3/7/567.mp3", "http://mw.0437.gov.cn/cj/uploadfile/2006727104934/1.mp3", "http://www.sz1z.com/asp/dzyw/uploadfile/2006112018016329.mp3", "http://218.85.72.119/yyxs/%B5%CB%C0%F6%BE%FD/%C2%B7%B1%DF%B5%C4%D2%B0%BB%A8%B2%BB%D2%AA%B2%C9.mp3"];
var s = new Sound();
var id = 0;
var played = 0;
var abc = true;
cssText = "a:link{text-decoration: none;font-size:12px;} a:hover{color:#ff0000; text-decoration: underline;font-size:12px;} a:active{color:#0000ff;text-decoration: none;font-size:12px;}";
myStyleSheet = new TextField.StyleSheet();
myStyleSheet.parseCSS(cssText);
var Name;
addList();
this.addProperty("playing", getPlaying, setPlaying);
btn3._visible = false;
btn1.onPress = function ()
{
id = id == 0 ? (mp3name.length - 1) : (id - 1);
loadsound(mp3[id]);
};
btn2.onPress = function ()
{
if (abc)
{
s.stop();
trackname = "STOP";
mix.gotoAndPlay(1);
cp.gotoAndStop(4);
played = 0;
abc = false;
s = new Sound();
} // end if
playing = false;
};
btn9.onPress = function ()
{
if (abc)
{
played = s.position;
s.stop();
mix.gotoAndPlay(1);
cp.gotoAndStop(4);
trackname = "PAUSED";
}
else
{
loadsound(mp3[id]);
} // end else if
playing = false;
};
btn3.onPress = function ()
{
if (abc)
{
s.start(played / 1000, 1);
trackname = id + 1 + "." + mp3name[id];
mix.gotoAndStop(1);
cp.gotoAndPlay(1);
}
else
{
loadsound(mp3[id]);
} // end else if
playing = true;
};
btn4.onPress = function ()
{
id = id == mp3name.length - 1 ? (0) : (id + 1);
loadsound(mp3[id]);
};
btn5.onRelease = function ()
{
s.start(s.position / 1000 - 10, 1);
playing = true;
};
btn6.onRelease = function ()
{
s.start(s.position / 1000 + 10, 1);
playing = true;
};
loadsound(mp3[id]);
var time1 = time2 = time3 = time4 = 0;
this.onEnterFrame = function ()
{
l = s.getBytesLoaded();
m = s.getBytesTotal();
b = int(l / m * 100);
txt1 = b + "%";
txt2 = int(l / 1000) / 1000 + "M" + "/" + int(m / 1000) / 1000 + "M";
time1 = int(s.position / 60000) < 10 ? ("0" + int(s.position / 60000)) : (int(s.position / 60000));
time2 = int(s.position / 1000 % 60) < 10 ? ("0" + int(s.position / 1000 % 60)) : (int(s.position / 1000 % 60));
time3 = int(s.duration / 60000) < 10 ? ("0" + int(s.duration / 60000)) : (int(s.duration / 60000));
time4 = int(s.duration / 1000 % 60) < 10 ? ("0" + int(s.duration / 1000 % 60)) : (int(s.duration / 1000 % 60));
timeline = time1 + ":" + time2 + "/" + time3 + ":" + time4;
if (int(s.position) <= 1000)
{
ldmc.play();
aa = aa + 1;
if (aa >= 300)
{
ldmc.gotoAndStop(11);
} // end if
}
else
{
ldmc.gotoAndStop(10);
ldmc.preload._width = l / m * 118;
} // end else if
};
stop ();
把上面的音乐地址和音乐名字换成你所需要的就可以了。
如果想让画面生动起来就可以像我这个帖子做个动感的画面。 |
|