Section 1
//MainTimeline (headcase_fla.MainTimeline)
package headcase_fla {
import flash.events.*;
import flash.media.*;
import flash.display.*;
import flash.ui.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.printing.*;
import flash.system.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var distance;
public var alphablocker:Sprite;
public var leftChannel:Array;
public var headcase;
public var my_menu:ContextMenu;
public var lguide:Sprite;
public var channelHeight;
public var soundChannel:SoundChannel;
public var levelArray:Array;
public var rightChannel:Array;
public var bytes:ByteArray;
public var lmask:Shape;
public var rmask:Shape;
public var mrot;
public var intro:Intro;
public var songsource:TextField;
public var channelWidth;
public var peakavg;
public var mguide:Sprite;
public var loop:Loop;
public var i;
public var looping;
public var rguide:Sprite;
public var channels;
public var smask:Sprite;
public var credit;
public var levelguide:Sprite;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function onIntroComplete(_arg1:Event):void{
soundChannel.removeEventListener(Event.SOUND_COMPLETE, onIntroComplete);
looping = true;
soundChannel = loop.play(0, int.MAX_VALUE);
}
public function initdraw(_arg1:Number){
leftChannel[_arg1].graphics.beginFill(0xFF);
leftChannel[_arg1].graphics.drawRect((_arg1 * 2), 0, 2, 100);
leftChannel[_arg1].graphics.endFill();
lguide.addChild(leftChannel[_arg1]);
rightChannel[_arg1].graphics.beginFill(0xFF0000);
rightChannel[_arg1].graphics.drawRect((_arg1 * 2), 0, 2, 100);
rightChannel[_arg1].graphics.endFill();
rguide.addChild(rightChannel[_arg1]);
}
public function openHCLink(_arg1:ContextMenuEvent):void{
navigateToURL(new URLRequest("http://www.amazon.com/crosseyedrabbit-headcase/dp/B00009WVN9/"));
}
function frame3(){
update();
gotoAndPlay(2);
}
function frame2(){
update();
}
function frame1(){
my_menu = new ContextMenu();
my_menu.hideBuiltInItems();
credit = new ContextMenuItem("Rubber NAND 2015");
credit.enabled = false;
headcase = new ContextMenuItem("Headcase - Crosseyedrabbit - 21.Untitled");
headcase.separatorBefore = true;
headcase.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, openHCLink);
my_menu.customItems.push(credit, headcase);
contextMenu = my_menu;
intro = new Intro();
loop = new Loop();
looping = false;
soundChannel = new SoundChannel();
soundChannel = intro.play();
soundChannel.addEventListener(Event.SOUND_COMPLETE, onIntroComplete);
alphablocker = new Sprite();
alphablocker.graphics.beginFill(0xFF00FF, 1);
alphablocker.graphics.drawRect(0, 0, 0x0200, 400);
alphablocker.graphics.endFill();
stage.addChild(alphablocker);
alphablocker.alpha = 0;
levelguide = new Sprite();
stage.addChild(levelguide);
levelguide.x = 0;
levelguide.y = 200;
mguide = new Sprite();
stage.addChild(mguide);
mguide.x = 0x0100;
mguide.y = 200;
smask = new Sprite();
smask.graphics.beginFill(0);
smask.graphics.drawRect(0, 0, 0x0200, 400);
smask.graphics.drawEllipse(0, 0, 0x0200, 400);
smask.graphics.endFill();
stage.addChild(smask);
rmask = new Shape();
rmask.graphics.beginFill(0);
rmask.graphics.drawRect(0, 0, 200, 400);
rmask.graphics.endFill();
stage.addChild(rmask);
rmask.x = -200;
lmask = new Shape();
lmask.graphics.beginFill(0);
lmask.graphics.drawRect(0, 0, 200, 400);
lmask.graphics.endFill();
stage.addChild(lmask);
lmask.x = 0x0200;
mrot = 0;
distance = 150;
lguide = new Sprite();
mguide.addChild(lguide);
lguide.x = -256;
lguide.y = (-1 * distance);
rguide = new Sprite();
mguide.addChild(rguide);
rguide.x = -256;
rguide.y = distance;
songsource = new TextField();
songsource.text = "Headcase - Crosseyedrabbit - 21.Untitled";
songsource.textColor = 0xFFFFFF;
songsource.autoSize = TextFieldAutoSize.LEFT;
stage.addChild(songsource);
songsource.x = 0;
songsource.y = 420;
bytes = new ByteArray();
channels = 0x0100;
channelWidth = 2;
channelHeight = 200;
leftChannel = new Array();
rightChannel = new Array();
i = 0;
while (i < channels) {
leftChannel.push(new Shape());
rightChannel.push(new Shape());
initdraw(i);
i++;
};
levelArray = new Array();
i = 0;
while (i < stage.stageWidth) {
levelArray.push(new Sprite());
levelArray[i].graphics.beginFill(0xFF00);
levelArray[i].graphics.drawRect(i, 0, 1, 1);
levelArray[i].graphics.endFill();
levelguide.addChild(levelArray[i]);
levelArray[i].y = 500;
i++;
};
peakavg = 0;
}
public function update(){
var _local1:*;
var _local2:*;
var _local3:*;
SoundMixer.computeSpectrum(bytes, false, 0);
if (1){
_local1 = 0;
while (_local1 < 0x0100) {
leftChannel[_local1].height = (Math.abs(bytes.readFloat()) * 200);
leftChannel[_local1].y = (leftChannel[_local1].height * -0.5);
_local1++;
};
_local1 = 0;
while (_local1 < 0x0100) {
rightChannel[_local1].height = (Math.abs(bytes.readFloat()) * 200);
rightChannel[_local1].y = (rightChannel[_local1].height * -0.5);
_local1++;
};
_local2 = ((soundChannel.leftPeak + soundChannel.rightPeak) / 2);
peakavg = ((_local2)>peakavg) ? _local2 : (peakavg * 0.95);
alphablocker.alpha = peakavg;
_local3 = 0;
while (_local3 < 511) {
levelArray[_local3].scaleY = levelArray[(_local3 + 1)].scaleY;
levelArray[_local3].y = levelArray[(_local3 + 1)].y;
_local3++;
};
levelArray[511].scaleY = (_local2 * 200);
levelArray[511].y = (_local2 * -100);
};
if (looping){
mrot = (mrot + 0.5);
mguide.rotation = (mrot % 360);
};
}
}
}//package headcase_fla
Section 2
//Intro (Intro)
package {
import flash.media.*;
public dynamic class Intro extends Sound {
}
}//package
Section 3
//Loop (Loop)
package {
import flash.media.*;
public dynamic class Loop extends Sound {
}
}//package