<br><br><br>
<p><embed src="https://t1.daumcdn.net/cfile/cafe/99E93F3D5C414C3735?original" width="1024" height="576" scale="exactfit" allowFullScreen="true"></p>
<br><br><br>
// mu
function newC(tg, tc) { new Color(tg).setRGB(tc) }
function colSet() {
btCol = [btnClip["playBtn"].icon, btnClip["stopBtn"].icon, won["teb"], won.track.rot["rigBar"], won.track.rot["rotBar"]];
bgCol = [btnClip["playBtn"].back, btnClip["stopBtn"].back];
for each (n in btCol) newC(n, _p["colA"]);
for each (n in bgCol) newC(n, _p["colB"]);
}
function lrcGo() {
pT = Math.round(snd2.playheadTime);
for(i=0; i<this["t"+cur]; i++) if (pT>=this["sList"+cur][i]) {
eqPlayer.txtClip.txt5.text = this["tList"+cur][i];
eqPlayer.txtClip.txt4.text = "[ "+cur+" : "+tot+" ] .."+_parent.mu["tList"+cur][0];
}
}
function playEq() {
_root.bw._visible=_root.s1._visible=1;
onEnterFrame = lrcGo; // ☜- ★
snd2._ns.onSpectrumData = function (eqData) {
for(e=0; e<18; e++) for (n=1; n<=_parent._p["way"]; n++){
EqR=_parent["eq"+n].eqR["bar_" + e];
EqR._height = eqData["s" + e] * 20 - e * 2;
EqR._alpha = random(100 - random(e * 5)) + 30;
}
}
}
function stopEq() {
_root.bw._visible=_root.s1._visible=0;
onEnterFrame = function() {
for(e=0; e<18; e++) for (n=1; n<=_parent._p["way"]; n++){
EqR=_parent["eq"+n].eqR["bar_" + e];
EqR._yscale *= 0.9;
if (_yscale<=1) _yscale = 0, delete onEnterFrame;
}
}
}
function volFade() {
m=!m; // ☜- ★
if (!m) _parent.onEnterFrame=function () {
gv=snd1.getVolume();
snd1.setVolume(gv<=0 ? 0 : gv-3);
if (gv==0) delete this.onEnterFrame, _parent.btnMode(0); // ☜- ★
}
else btnMode(1), _parent.onEnterFrame=function () {
gv=snd1.getVolume();
snd1.setVolume(gv>=100 ? 100 : gv+3 )
if (gv==100) delete this.onEnterFrame;
}
}
function btnMode(m) {
btnClip.playBtn._visible = m == 0;
btnClip.stopBtn._visible = m != 0;
m ? startSong() : stopSong();
eqPlayer.eqMove(); // ☜- ★
}
function playSong(n) { snd2.play(aList[cur=n]), playEq() } // ☜- ★
function startSong() { snd2.play(), playEq() } // ☜- ★
function stopSong() { snd2.pause(), stopEq() } // ☜- ★
onSelfEvent (load) {
_p = parameters, colSet(), btnMode(m=1); // ☜- ★
_global.snd1=new Sound();
aList = _p.songUrl.trim().split("\n"), aList.unshift("음원주소");
tot=aList.length-1, cur=random(tot)+1;
for(j=1; j<=tot; j++) { this["lrcList"+j] = _p["lrc"+j].split("\n");
this["sList"+j]=[], this["tList"+j]=[], this["t"+j]=this["lrcList"+j].length;
for(i=0; i<this["t"+j]; i++) { mySec =(this["lrcList"+j][i].slice(1,9)).split(":");
mSec = Number(mySec[0]*60), sSec = Math.round(Number(mySec[1]));
this["sList"+j].push(mSec + sSec), this["tList"+j].push(this["lrcList"+j][i].slice(10));
}
}
for (n=1; n<=_p["way"]; n++) {
eqB=eqClip.duplicateMovieClip("eq"+n, n);
eqB._rotation=(360/_p["way"])*n+_p["ang"];
eqClip._visible=0;
}
snd2.onPlayStop = nextBtn.onRelease = function() { playSong(cur==tot ? 1 : ++cur) }
snd2.onPlayStop();
btnClip.onRelease = volFade; // ☜- ★
prevBtn.onRelease = function() { playSong(cur==1 ? tot : --cur) }
prevBtn._visible=nextBtn._visible= tot<2 ? 0 : 1;
}
// mu > won
function times() {
pT = mySong.playheadTime;
tT = mySong.totalTime;
}
onSelfEvent(load) {
_global.mySong = _parent.snd2;
pos = 0;
track.rot.setMask(track.rot.mc);
track.rot.rigBar._visible = 0;
myClip = track.rot.rotBar;
myClip.onEnterFrame = function() {
times();
trR = track.rot.rigBar;
trL = track.rot.lefBar;
trR._visible = myClip._rotation < 0;
trL._visible = !trR._visible;
myClip.setMask(myClip._rotation < 0 ? (trL) : (trR));
myClip._rotation = (pT / tT) * 360;
}
teb.onRelease= function() {
myClip._rotation = (Math.atan2(track._ymouse - myClip._y, track._xmouse - myClip._x) * (180 / Math.PI)) + 90;
myRotation = myClip._rotation < 0 ? (360 - Math.abs(myClip._rotation)) : (myClip._rotation);
cuR = myRotation / 360;
pos = int((cuR) * (tT));
mySong._ns.seek(pos);
mySong.play();
_parent.m=0; // ☜- ★
_parent.volFade(); // ☜- ★
myClip.onEnterFrame();
}
}
// mu > eqPlayer
function timeD() {
pT=snd2.playheadTime, tT=snd2.totalTime;
aT=tT-pT, aftT=timeDisp(aT), ingT=timeDisp(pT), totT=timeDisp(tT);
}
function timeDisp(t) {
return ("0"+Math.floor(t/60)).slice(-2)+":"+("0"+Math.floor(t%60)).slice(-2);
}
function newC(tg, tc) {
new Color(tg).setRGB(tc);
}
function eqMove() {
for (n=0; n<20; n++) {
eqB=eqClip["bar"+n];
eqB._height=(_parent.m ? (Math.floor(Math.random()*15)+1) : (eqB._height+(1-eqB._height)*0.2));
}
}
onSelfEvent (load) {
_global._p=parameters;
snd2=_parent.snd2;
Btn=[txtClip.txt1, txtClip.txt2, txtClip.txt3, txtClip.txt4, txtClip.txt5];
for each(t in Btn) newC(t, _p["c1"]);
newC(eqClip, _p["c2"]);
_x=Math.round(_x);
_y=Math.round(_y);
eqClip.setMask(eqMask);
eqClip.bar._visible=eqMask._visible=0;
for (n=0; n<20; n++) {
eqB=eqClip.bar.duplicateMovieClip("bar"+n, n);
eqB._x=5*n;
}
eqMask._width=eqClip._width;
if (_p["k1"]) eqClip.onPress=_parent.volFade; // ☜- ★
setInterval(eqMove, (100-_p["s1"])*10);
txtClip.onEnterFrame=function() {
timeD();
if (_p["k3"]) this.txt1.text=ingT, this.txt2.text=totT, this.txt3.text=aftT;
this.txt4._visible=(_p["k4"] ? 1: 0);
this.txt5._visible=(_p["k5"] ? 1: 0);
}
_parent.won._visible=_parent.btnClip._visible=_p["k2"] ? 1 : 0;
txtClip.txt3._visible=_p["k2"] ? 0 : 1;
txtClip.txt1._visible=txtClip.txt2._visible=eqClip._visible= (_p["k6"] ? 1 : 0);
}
// mu > eqClip > eqR
onSelfEvent (load) {
wA = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16, 20, 27, 36, 50];
gA = [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 3, 3, 4];
xA = [0];
for(eqX=0; eqX<17; eqX++) xA.push(xA[eqX] + wA[eqX] + gA[eqX]);
for(e=0; e<18; e++) {
Bar = bar.duplicateMovieClip("bar_" + e, e);
Bar._width = wA[e];
Bar._x = xA[e];
Bar._height = 0;
bar._visible = 0;
}
}
'♡······★스위시 강좌' 카테고리의 다른 글
[스크랩] 한줄가사 player (mp3로드) ...test (0) | 2019.01.21 |
---|---|
[스크랩] 증폭이퀄 (배경동영상) + 2줄 가사 (0) | 2019.01.20 |
[스크랩] swish 에서 음악넣기와 용량줄이기 (0) | 2019.01.09 |
[스크랩] rotation gallery (0) | 2019.01.01 |
[스크랩] [답변] ... (0) | 2018.12.20 |