songxp03
05-05-2009, 10:01 AM
This day,I want made a flash using SpectrumAnalyzer in KM7.But the code doesn/t work well.:scared:
The code is as below:
var spt:SpectrumAnalyzer=new SpectrumAnalyzer();
var d:Array=new Array(0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9);
var i:Number=1;
var timer:Timer=new Timer(200,4);
timer.addEventListener(TimerEvent.TIMER,TT);
spt.setmode(0);
spt.data=d;
spt.moveTo(50,50);
spt.data=functionData;
addChild(spt);
function TT():void{
i+=1;
if(i>=9)
i=1;
d.splice(2,0,i/10);
}
function functionData():void {
i+=2;
if(i>=9)
i=1;
d.splice(2,0,i/10);
}
functionData();
-----------------
I'm pool in Action Script . Could somebody give me an example about SpectrumAnalyzer,thanks a lot!:)
The code is as below:
var spt:SpectrumAnalyzer=new SpectrumAnalyzer();
var d:Array=new Array(0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9);
var i:Number=1;
var timer:Timer=new Timer(200,4);
timer.addEventListener(TimerEvent.TIMER,TT);
spt.setmode(0);
spt.data=d;
spt.moveTo(50,50);
spt.data=functionData;
addChild(spt);
function TT():void{
i+=1;
if(i>=9)
i=1;
d.splice(2,0,i/10);
}
function functionData():void {
i+=2;
if(i>=9)
i=1;
d.splice(2,0,i/10);
}
functionData();
-----------------
I'm pool in Action Script . Could somebody give me an example about SpectrumAnalyzer,thanks a lot!:)