the only way I have seen to apply a blur is some long drawn out bitmap process where I am creating an object, however I already have mc_ball created. How would I blur it when it scales larger? too bad it isn’t just root.mc_ball.blur = x …why can’t things be easy lol
// SpectrumAnalyzer.as
package {
import flash.display.*;
import flash.media.*;
import flash.net.*;
import flash.utils.ByteArray;
import flash.events.*;
class SpectrumAnalyzer extends Sprite {
// Settings
public var mc_ball:MovieClip;
//
private var music:Sound = new Sound;
private var ba:ByteArray = new ByteArray();
private var __width:uint;
private var __height:uint;
function SpectrumAnalyzer(mp3:String, _width:uint, _height:uint) {
__width = _width;
__height = _height;
x = __width/2;
y = __height/2;
music.load(new URLRequest(mp3));
var sc:SoundChannel;
sc = music.play(0, 999);
addEventListener(Event.ENTER_FRAME, processSound);
}
private function processSound(ev:Event):void {
SoundMixer.computeSpectrum(ba, true, 0);
graphics.clear();
var lev:Number = ba.readFloat();
if (lev > .5) {
root.mc_ball.scaleX = root.mc_ball.scaleY = 1.1;
trace(lev)
}
else {
root.mc_ball.scaleX = root.mc_ball.scaleY = 1;
trace(lev)
}
}
}
}
Secondly, as you can see from the code, I am modifying an existing piece so
__width = _width;
__height = _height;
x = __width/2;
y = __height/2;
is still in there along with the dimensioning.
I tried removing it, but I don’t think it works out well here
function SpectrumAnalyzer(mp3:String, _width:uint, _height:uint) {
Thoughts?