?? glllsoundwave.as
字號:
package com.ll19.sound {
import flash.display.MovieClip;
import flash.events.Event;
import com.ll19.util.GlllStringUtil;
/**
* - GL'LL. -
*
* 聲音波譜類
*
* @author <a href="http://www.LL19.com/">LL19.com</a>
*
*/
public class GlllSoundWave {
public var removeListener:Boolean = false;
/**
* @param targetmc 波譜所在的影片
*/
function GlllSoundWave(targetmc:MovieClip) {
targetmc.addEventListener(Event.ENTER_FRAME, showWave);
}
public function showWave(event:Event):void {
if (removeListener == true) {
event.currentTarget.removeEventListener(Event.ENTER_FRAME, showWave);
}
//TODO: 有什么更好的方法么...有點占CPU 不想用SoundMixer.computeSpectrum()
MovieClip(event.currentTarget).z1.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 8;
MovieClip(event.currentTarget).z2.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 8 * 0.8;
MovieClip(event.currentTarget).z3.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 5;
MovieClip(event.currentTarget).z4.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 5 * 0.8;
MovieClip(event.currentTarget).z5.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 3 * GlllStringUtil.randRange(80, 100) / 100;
MovieClip(event.currentTarget).z6.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 3 * 0.8 * GlllStringUtil.randRange(80, 100) / 100;
MovieClip(event.currentTarget).z7.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 2 * GlllStringUtil.randRange(80, 100) / 100;
MovieClip(event.currentTarget).z8.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 1.5 * GlllStringUtil.randRange(80, 100) / 100;
MovieClip(event.currentTarget).z9.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 1.2 * GlllStringUtil.randRange(80, 100) / 100;
MovieClip(event.currentTarget).z10.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * GlllStringUtil.randRange(80, 100) / 100;
MovieClip(event.currentTarget).z11.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.95 * GlllStringUtil.randRange(80, 100) / 100;
MovieClip(event.currentTarget).z12.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.90 * GlllStringUtil.randRange(80, 100) / 100;
MovieClip(event.currentTarget).z13.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.85 * GlllStringUtil.randRange(80, 100) / 100;
MovieClip(event.currentTarget).z14.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.80 * GlllStringUtil.randRange(80, 100) / 100;
MovieClip(event.currentTarget).z15.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.75 * GlllStringUtil.randRange(80, 100) / 100;
MovieClip(event.currentTarget).z16.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.74 * GlllStringUtil.randRange(80, 120) / 100;
MovieClip(event.currentTarget).z17.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.73 * GlllStringUtil.randRange(80, 120) / 100;
MovieClip(event.currentTarget).z18.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.72 * GlllStringUtil.randRange(80, 120) / 100;
MovieClip(event.currentTarget).z19.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.71 * GlllStringUtil.randRange(80, 120) / 100;
MovieClip(event.currentTarget).z20.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.70 * GlllStringUtil.randRange(80, 120) / 100;
MovieClip(event.currentTarget).z21.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.69 * GlllStringUtil.randRange(80, 120) / 100;
MovieClip(event.currentTarget).z22.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.68 * GlllStringUtil.randRange(80, 120) / 100;
MovieClip(event.currentTarget).z23.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.67 * GlllStringUtil.randRange(80, 120) / 100;
MovieClip(event.currentTarget).z24.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.66 * GlllStringUtil.randRange(80, 120) / 100;
MovieClip(event.currentTarget).z25.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.65 * GlllStringUtil.randRange(80, 120) / 100;
MovieClip(event.currentTarget).z26.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.64 * GlllStringUtil.randRange(80, 100) / 100;
MovieClip(event.currentTarget).z27.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.63 * GlllStringUtil.randRange(80, 100) / 100;
MovieClip(event.currentTarget).z28.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.62 * GlllStringUtil.randRange(80, 100) / 100;
MovieClip(event.currentTarget).z29.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.61 * GlllStringUtil.randRange(80, 100) / 100;
MovieClip(event.currentTarget).z30.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.60 * GlllStringUtil.randRange(80, 100) / 100;
MovieClip(event.currentTarget).z31.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.59 * GlllStringUtil.randRange(80, 100) / 100;
MovieClip(event.currentTarget).z32.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.58 * GlllStringUtil.randRange(80, 100) / 100;
MovieClip(event.currentTarget).z33.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.57 * GlllStringUtil.randRange(80, 100) / 100;
MovieClip(event.currentTarget).z34.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.56 * GlllStringUtil.randRange(80, 100) / 100;
MovieClip(event.currentTarget).z35.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.55 * GlllStringUtil.randRange(80, 100) / 100;
MovieClip(event.currentTarget).z36.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.50 * GlllStringUtil.randRange(60, 100) / 100;
MovieClip(event.currentTarget).z37.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.50 * GlllStringUtil.randRange(60, 100) / 100;
MovieClip(event.currentTarget).z38.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.50 * GlllStringUtil.randRange(60, 100) / 100;
MovieClip(event.currentTarget).z39.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.50 * GlllStringUtil.randRange(60, 100) / 100;
MovieClip(event.currentTarget).z40.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.50 * GlllStringUtil.randRange(60, 100) / 100;
MovieClip(event.currentTarget).z41.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.50 * GlllStringUtil.randRange(60, 100) / 100;
MovieClip(event.currentTarget).z42.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.50 * GlllStringUtil.randRange(60, 100) / 100;
MovieClip(event.currentTarget).z43.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.50 * GlllStringUtil.randRange(60, 100) / 100;
MovieClip(event.currentTarget).z44.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.50 * GlllStringUtil.randRange(60, 100) / 100;
MovieClip(event.currentTarget).z45.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.50 * GlllStringUtil.randRange(60, 100) / 100;
MovieClip(event.currentTarget).z46.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.50 * GlllStringUtil.randRange(60, 100) / 100;
MovieClip(event.currentTarget).z47.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.50 * GlllStringUtil.randRange(60, 100) / 100;
MovieClip(event.currentTarget).z48.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.50 * GlllStringUtil.randRange(60, 100) / 100;
MovieClip(event.currentTarget).z49.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.50 * GlllStringUtil.randRange(60, 100) / 100;
MovieClip(event.currentTarget).z50.height = 8 * (GlllSound.myChannel.leftPeak + GlllSound.myChannel.rightPeak) * 0.50 * GlllStringUtil.randRange(60, 100) / 100;
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -