Section 1
//MainTimeline (z103_fla.MainTimeline)
package z103_fla {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.net.*;
import flash.system.*;
public dynamic class MainTimeline extends MovieClip {
public var soundVol:SoundTransform;
public var context:SoundLoaderContext;
public var s:Sound;
public var myChannel:SoundChannel;
public var req:URLRequest;
public function MainTimeline(){
addFrameScript(0, frame1);
}
public function ioErrorHandler(_arg1:Event):void{
trace(("ioErrorHandler: " + _arg1));
}
function frame1(){
stop();
Security.allowDomain("*");
s = new Sound();
req = new URLRequest("http://stream2.cacaw.net:8000/cacaw");
s.addEventListener(Event.COMPLETE, completeHandler);
s.addEventListener(Event.ID3, id3Handler);
s.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
context = new SoundLoaderContext(2000, true);
s.load(req, context);
myChannel = new SoundChannel();
soundVol = new SoundTransform();
myChannel = s.play();
}
public function completeHandler(_arg1:Event):void{
trace(("completeHandler: " + _arg1));
}
public function id3Handler(_arg1:Event):void{
trace(("id3Handler: " + _arg1));
}
public function progressHandler(_arg1:ProgressEvent):void{
trace(("progressHandler: " + _arg1));
}
}
}//package z103_fla
Section 2
//spec_1 (z103_fla.spec_1)
package z103_fla {
import flash.events.*;
import flash.display.*;
import flash.media.*;
import flash.utils.*;
public dynamic class spec_1 extends MovieClip {
public function spec_1(){
addFrameScript(0, frame1);
}
function frame1(){
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
public function onEnterFrame(_arg1:Event):void{
var _local2:ByteArray = new ByteArray();
var _local3 = 75;
var _local4 = 0x0100;
SoundMixer.computeSpectrum(_local2, false, 0);
var _local5:Graphics = this.graphics;
_local5.clear();
_local5.lineStyle(0, 0x222222);
_local5.beginFill(0xCC00);
_local5.moveTo(0, _local3);
var _local6:Number = 0;
var _local7:int;
while (_local7 < _local4) {
_local6 = (_local2.readFloat() * _local3);
_local5.lineTo((_local7 * 2), (_local3 - _local6));
_local7++;
};
_local5.lineTo((_local4 * 2), _local3);
_local5.endFill();
_local5.lineStyle(0, 0);
_local5.beginFill(0xFF0000, 0.5);
_local5.moveTo((_local4 * 2), _local3);
_local7 = _local4;
while (_local7 > 0) {
_local6 = (_local2.readFloat() * _local3);
_local5.lineTo((_local7 * 2), (_local3 - _local6));
_local7--;
};
_local5.lineTo(0, _local3);
_local5.endFill();
}
}
}//package z103_fla