Section 1
//Core (com.neriksworkshop.lib.ASaudio.core.Core)
package com.neriksworkshop.lib.ASaudio.core {
import com.neriksworkshop.lib.ASaudio.*;
import flash.net.*;
public class Core {
private static const EXT_RE:RegExp = /\.(\w+)$/;
public static const RIGHT:Number = 1;
public static const LEFT:Number = -1;
public static const CENTER:Number = 0;
private static var _manager:Manager;
private static var currentUid:int = 1;
public function Core(){
throw (new Error("ASaudio.core.Core : this class shouldnt't be instanciated"));
}
public static function get manager():Manager{
if (!_manager){
Core.createManager();
};
return (_manager);
}
public static function getFileExt(_arg1:String):String{
return (Core.EXT_RE.exec(_arg1)[1].toLowerCase());
}
private static function createManager():void{
Core._manager = Manager.getInstance(Core);
_manager.initialize();
}
public static function getTime(_arg1:Number, _arg2:Number):Number{
if (_arg1 < 0){
throw (new Error("Invalid time format (time < 0)"));
};
return (((_arg1)<1) ? (_arg1 * _arg2) : _arg1);
}
public static function cookieRetrieve(_arg1:String):Object{
var _local2:SharedObject;
_local2 = SharedObject.getLocal(_arg1);
return (_local2.data);
}
public static function getUid():int{
return (currentUid++);
}
public static function cookieWrite(_arg1:String, _arg2:Object):Boolean{
var _local3:SharedObject;
var _local4:String;
_local3 = SharedObject.getLocal(_arg1);
for (_local4 in _arg2) {
_local3.data[_local4] = _arg2[_local4];
};
return ((_local3.flush(500) == SharedObjectFlushStatus.FLUSHED));
}
}
}//package com.neriksworkshop.lib.ASaudio.core
Section 2
//IAudioItem (com.neriksworkshop.lib.ASaudio.core.IAudioItem)
package com.neriksworkshop.lib.ASaudio.core {
import flash.events.*;
public interface IAudioItem extends IEventDispatcher {
function stop(_arg1:Boolean=false):void;
function crossfade(_arg1:IAudioItem, _arg2:Number=NaN):void;
function volumeTo(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Boolean=true, _arg5:Function=null):void;
function set volumeMultiplier(_arg1:Number):void;
function set loop(_arg1:Boolean):void;
function togglePause(_arg1:Boolean=false):void;
function get name():String;
function get fadeAtEnd():Boolean;
function clear():void;
function left(_arg1:Boolean=false):void;
function get uid():uint;
function get volumeMultiplier():Number;
function get peakLeft():Number;
function set name(_arg1:String):void;
function cookieRetrieve(_arg1:String):void;
function mute(_arg1:Boolean=false):void;
function get volume():Number;
function cookieWrite(_arg1:String):Boolean;
function setVolume(_arg1:Number):void;
function get pan():Number;
function set fadeAtEnd(_arg1:Boolean):void;
function start(_arg1:Boolean=false, _arg2:Number=0, _arg3:Boolean=false):void;
function right(_arg1:Boolean=false):void;
function center(_arg1:Boolean=false):void;
function toggleMute(_arg1:Boolean=false):void;
function get peak():Number;
function setPan(_arg1:Number):void;
function resume(_arg1:Boolean=false):void;
function solo():void;
function unmute(_arg1:Boolean=false):void;
function get volumeUnits():Number;
function pause(_arg1:Boolean=false):void;
function unsolo():void;
function set pan(_arg1:Number):void;
function set volume(_arg1:Number):void;
function set panMultiplier(_arg1:Number):void;
function get peakRight():Number;
function get panMultiplier():Number;
function panTo(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Boolean=true):void;
}
}//package com.neriksworkshop.lib.ASaudio.core
Section 3
//Manager (com.neriksworkshop.lib.ASaudio.core.Manager)
package com.neriksworkshop.lib.ASaudio.core {
import flash.events.*;
import com.neriksworkshop.lib.ASaudio.*;
import flash.utils.*;
public class Manager {
private var items:Array;
private var itemsVolFades:Array;
private var timer:Timer;
private var itemsPanFades:Array;
private var before:Number;
private static var instance:Manager = new (Manager);
;
public function Manager(){
items = new Array();
itemsVolFades = new Array();
itemsPanFades = new Array();
super();
if (instance){
throw (new Error("Singleton can only be accessed through Singleton.getInstance()"));
};
}
public function killVolumeTo(_arg1:int):void{
itemsVolFades[_arg1] = undefined;
}
public function panToDone(_arg1:int):void{
itemsPanFades[_arg1] = undefined;
}
private function run(_arg1:TimerEvent):void{
var _local2:Number;
var _local3:Number;
var _local4:IAudioItem;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local2 = new Date().getTime();
_local3 = (_local2 - before);
before = _local2;
for each (_local4 in items) {
if ((((_local4 is Track)) && (!((_local4 as Track).active)))){
} else {
if ((((((((_local4 is Track)) && ((_local4 as Track).fadeAtEnd))) && (!(((_local4 as Track).duration == 0))))) && (!(isNaN((_local4 as Track).duration))))){
if (((!(itemsVolFades[_local4.uid])) || (!(itemsVolFades[_local4.uid].oE)))){
_local5 = ((_local4 as Track).duration - Mixer.DURATION_TRANSITIONS);
if ((_local4 as Track).positionMs >= _local5){
itemsVolFades[_local4.uid] = new Fade(Mixer.DURATION_TRANSITIONS, _local4.volume, 0, false, _local4.clear, true);
(_local4 as Track).notifyEndFadeStart();
};
};
};
if (itemsVolFades[_local4.uid]){
_local6 = itemsVolFades[_local4.uid].getCurrentValue(_local2);
if (itemsVolFades[_local4.uid].k){
_local4.volume = _local6;
} else {
_local4.setVolume(_local6);
};
if (itemsVolFades[_local4.uid].over){
volumeToDone(_local4.uid);
};
};
if (itemsPanFades[_local4.uid]){
_local7 = itemsPanFades[_local4.uid].getCurrentValue(_local2);
if (itemsPanFades[_local4.uid].k){
_local4.pan = _local7;
} else {
_local4.setPan(_local7);
};
if (itemsPanFades[_local4.uid].over){
panToDone(_local4.uid);
};
};
};
};
}
public function initialize():void{
timer = new Timer(50);
timer.addEventListener(TimerEvent.TIMER, run);
timer.start();
before = new Date().getTime();
}
public function volumeTo(_arg1:int, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean, _arg6:Function):void{
if (_arg5){
items[_arg1].volume = _arg3;
} else {
items[_arg1].setVolume(_arg3);
};
itemsVolFades[_arg1] = new Fade(_arg2, _arg3, _arg4, _arg5, _arg6);
}
public function volumeToDone(_arg1:int):void{
if (itemsVolFades[_arg1].callback){
itemsVolFades[_arg1].callback();
};
killVolumeTo(_arg1);
}
public function panTo(_arg1:int, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean):void{
if (_arg5){
items[_arg1].pan = _arg3;
} else {
items[_arg1].setPan(_arg3);
};
itemsPanFades[_arg1] = new Fade(_arg2, _arg3, _arg4, _arg5);
}
public function add(_arg1:IAudioItem):void{
items[_arg1.uid] = _arg1;
}
public function getItemById(_arg1:int):IAudioItem{
return (items[_arg1]);
}
public static function getInstance(_arg1:Class):Manager{
if (_arg1 != Core){
throw (new Error("core.Manager shouldn't be instanciated externally"));
};
return (instance);
}
}
}//package com.neriksworkshop.lib.ASaudio.core
class Fade {
public var over:Boolean;
public var d:Number;
public var e:Number;
public var k:Boolean;
public var oE:Boolean;
public var callback:Function;
public var s:Number;
public var t:Number;
public var timestamp:Number;
private function Fade(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean, _arg5:Function=null, _arg6:Boolean=false){
timestamp = new Date().getTime();
this.t = _arg1;
this.s = _arg2;
this.e = _arg3;
this.k = _arg4;
this.callback = _arg5;
this.oE = _arg6;
d = (_arg3 - _arg2);
}
public function getCurrentValue(_arg1:Number):Number{
var _local2:Number;
_local2 = (_arg1 - timestamp);
if (_local2 < 10){
return (s);
};
if (_local2 >= t){
over = true;
return (e);
};
return ((s + (d * (_local2 / t))));
}
}
Section 4
//AudioEvents (com.neriksworkshop.lib.ASaudio.AudioEvents)
package com.neriksworkshop.lib.ASaudio {
public class AudioEvents {
public static const STOP:String = "AudioEvents.STOP";
public static const TOGGLE_MUTE:String = "AudioEvents.TOGGLE_PAUSE";
public static const START:String = "AudioEvents.START";
public static const PAN_CHANGE:String = "AudioEvents.PAN_CHANGE";
public static const FADE_AT_END_STARTED:String = "AudioEvents.FADE_AT_END_STARTED";
public static const VOLUME_CHANGE:String = "AudioEvents.VOLUME_CHANGE";
public static const PLAYLIST_LOADED:String = "AudioEvents.PLAYLIST_LOADED";
public static const TOGGLE_PAUSE:String = "AudioEvents.TOGGLE_PAUSE";
public static const NEXT_TRACK:String = "AudioEvents.NEXT_TRACK";
}
}//package com.neriksworkshop.lib.ASaudio
Section 5
//Group (com.neriksworkshop.lib.ASaudio.Group)
package com.neriksworkshop.lib.ASaudio {
import com.neriksworkshop.lib.ASaudio.core.*;
import flash.events.*;
import flash.net.*;
public class Group extends EventDispatcher implements IAudioItem {
protected var _fadeAtEnd:Boolean;
protected var _facadePan:Number;// = 0
protected var _refFacadePan:Number;// = 0
protected var _facadeVolume:Number;// = 1
protected var _panMultiplier:Number;// = 0
protected var _refFacadeVolume:Number;// = 1
protected var _paused:Boolean;// = true
protected var _name:String;
protected var _muted:Boolean;// = false
protected var _children:Array;
protected var _loop:Boolean;
protected var _uid:int;
protected var _volumeMultiplier:Number;// = 1
protected var _numChildren:int;
protected namespace xspfNs = "http://xspf.org/ns/0/";
public function Group(_arg1=null, _arg2:String=null){
_children = new Array();
_paused = true;
_facadeVolume = 1;
_refFacadeVolume = 1;
_volumeMultiplier = 1;
_muted = false;
_facadePan = 0;
_refFacadePan = 0;
_panMultiplier = 0;
super();
this._uid = Core.getUid();
this._name = (_arg2) ? _arg2 : String(_uid);
Core.manager.add(this);
if (!_arg1){
return;
};
addFrom(_arg1);
}
public function stop(_arg1:Boolean=false):void{
if (_arg1){
volumeTo(Mixer.DURATION_PLAYBACK_FADE, 0, _facadeVolume, false, stop);
} else {
clear();
};
}
public function set volumeMultiplier(_arg1:Number):void{
_volumeMultiplier = _arg1;
applyVolume();
}
public function addChild(_arg1:IAudioItem):IAudioItem{
add(_arg1);
return (_arg1);
}
public function pause(_arg1:Boolean=false):void{
var _local2:IAudioItem;
if (_paused){
return;
};
_paused = true;
if (_arg1){
volumeTo(Mixer.DURATION_PLAYBACK_FADE, 0, _facadeVolume, false, pause);
} else {
for each (_local2 in _children) {
_local2.pause(false);
};
};
}
public function unsolo():void{
}
public function togglePause(_arg1:Boolean=false):void{
if (_paused){
resume(_arg1);
} else {
pause(_arg1);
};
}
public function set name(_arg1:String):void{
_name = _arg1;
}
public function loadXSPF(_arg1:String):void{
loadPlsFromFile(_arg1, XSPFCompleteHandler);
}
public function set fadeAtEnd(_arg1:Boolean):void{
var _local2:IAudioItem;
_fadeAtEnd = _arg1;
for each (_local2 in _children) {
trace(_local2);
_local2.fadeAtEnd = _arg1;
};
}
public function mute(_arg1:Boolean=false):void{
if (_muted){
return;
};
_muted = true;
if (_arg1){
volumeTo(Mixer.DURATION_MUTE_FADE, 0, _facadeVolume, false);
} else {
setVolume(0);
};
}
public function setVolume(_arg1:Number):void{
_facadeVolume = _arg1;
applyVolume();
}
public function contains(_arg1:IAudioItem):Boolean{
var _local2:IAudioItem;
for each (_local2 in _children) {
if (_local2 == _arg1){
return (true);
};
};
return (false);
}
public function get volume():Number{
return (_facadeVolume);
}
private function applyVolume():void{
var _local1:Number;
var _local2:IAudioItem;
if (_facadeVolume < 0){
_facadeVolume = 0;
};
if (_facadeVolume > 1){
_facadeVolume = 1;
};
_local1 = (_facadeVolume * _volumeMultiplier);
for each (_local2 in _children) {
_local2.volumeMultiplier = _local1;
};
dispatchEvent(new Event(AudioEvents.VOLUME_CHANGE));
}
public function right(_arg1:Boolean=false):void{
if (_arg1){
panTo(Mixer.DURATION_PAN_FADE, Core.RIGHT);
} else {
pan = Core.RIGHT;
};
}
public function resume(_arg1:Boolean=false):void{
var _local2:IAudioItem;
if (!_paused){
return;
};
_paused = false;
for each (_local2 in _children) {
_local2.resume();
};
if (_arg1){
volumeTo(Mixer.DURATION_PLAYBACK_FADE, _refFacadeVolume, 0, false);
} else {
setVolume(_refFacadeVolume);
};
}
public function panTo(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Boolean=true):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local5 = (isNaN(_arg3)) ? _facadePan : _arg3;
_local6 = (isNaN(_arg2)) ? _facadePan : _arg2;
_local7 = (isNaN(_arg1)) ? Mixer.DURATION_DEFAULT : _arg1;
Core.manager.panTo(_uid, _arg1, _local5, _local6, _arg4);
}
public function unmute(_arg1:Boolean=false):void{
if (!_muted){
return;
};
_muted = false;
if (_arg1){
volumeTo(Mixer.DURATION_MUTE_FADE, _refFacadeVolume, 0, false);
} else {
setVolume(_refFacadeVolume);
};
}
public function set volume(_arg1:Number):void{
setVolume(_arg1);
_refFacadeVolume = _arg1;
}
public function volumeTo(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Boolean=true, _arg5:Function=null):void{
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local6 = (isNaN(_arg3)) ? _facadeVolume : _arg3;
_local7 = (isNaN(_arg2)) ? _facadeVolume : _arg2;
_local8 = (isNaN(_arg1)) ? Mixer.DURATION_DEFAULT : _arg1;
Core.manager.volumeTo(_uid, _arg1, _local6, _local7, _arg4, _arg5);
}
public function get panMultiplier():Number{
return (_panMultiplier);
}
public function set pan(_arg1:Number):void{
setPan(_arg1);
_refFacadePan = _arg1;
}
private function M3UCompleteHandler(_arg1:Event):void{
addTracksFromM3U(_arg1.target.data);
dispatchEvent(new Event(AudioEvents.PLAYLIST_LOADED));
}
public function get uid():uint{
return (_uid);
}
public function center(_arg1:Boolean=false):void{
if (_arg1){
panTo(Mixer.DURATION_PAN_FADE, Core.CENTER);
} else {
pan = Core.CENTER;
};
}
private function applyPan():void{
var _local1:IAudioItem;
if (_facadePan < Core.LEFT){
_facadePan = Core.LEFT;
};
if (_facadePan > Core.RIGHT){
_facadePan = Core.RIGHT;
};
for each (_local1 in _children) {
_local1.panMultiplier = _facadePan;
};
dispatchEvent(new Event(AudioEvents.PAN_CHANGE));
}
public function getChildById(_arg1:int):IAudioItem{
return (Core.manager.getItemById(_arg1));
}
public function left(_arg1:Boolean=false):void{
if (_arg1){
panTo(Mixer.DURATION_PAN_FADE, Core.LEFT);
} else {
pan = Core.LEFT;
};
}
public function addTracksFromUrls(_arg1:Array):void{
var _local2:String;
for each (_local2 in _arg1) {
add(new Track(_local2));
};
}
public function set loop(_arg1:Boolean):void{
var _local2:IAudioItem;
for each (_local2 in _children) {
_local2.loop = _arg1;
};
}
public function start(_arg1:Boolean=false, _arg2:Number=0, _arg3:Boolean=false):void{
var _local4:IAudioItem;
_paused = false;
setVolume(_refFacadeVolume);
setPan(_refFacadePan);
for each (_local4 in _children) {
_local4.start(false, _arg2);
};
if (_arg1){
volumeTo(Mixer.DURATION_PLAYBACK_FADE, _facadeVolume, 0, false);
};
}
private function XSPFCompleteHandler(_arg1:Event):void{
addTracksFromXSPF(new XML(_arg1.target.data));
dispatchEvent(new Event(AudioEvents.PLAYLIST_LOADED));
}
private function IOErrorHandler(_arg1:IOErrorEvent):void{
trace(("IOError: " + _arg1.text));
}
public function clear():void{
var _local1:IAudioItem;
for each (_local1 in _children) {
_local1.clear();
};
}
private function HTTPStatusHandler(_arg1:HTTPStatusEvent):void{
}
public function get volumeUnits():Number{
return (0);
}
public function getM3U():String{
var _local1:String;
var _local2:Track;
for each (_local2 in _children) {
_local1 = (_local1 + (_local2.url + "\n"));
};
return (_local1);
}
public function get volumeMultiplier():Number{
return (_volumeMultiplier);
}
public function addTracksFromXSPF(_arg1:XML):void{
var _local2:XMLList;
var _local3:XML;
_local2 = _arg1.trackList.track;
for each (_local3 in _local2) {
add(new Track(_local3.location));
};
}
public function getXSPF():XML{
var _local1:XML;
var _local2:IAudioItem;
_local1 = new XML("<playlist version=\"1\" xmlns=\"http://xspf.org/ns/0/\"></playlist>");
for each (_local2 in _children) {
if (!(_local2 is Track)){
} else {
_local1.appendChild("<plop></plop>");
};
};
return (_local1);
}
public function getChildByName(_arg1:String):IAudioItem{
var _local2:IAudioItem;
for each (_local2 in _children) {
if (_local2.name == _arg1){
return (_local2);
};
};
return (null);
}
private function securityErrorHandler(_arg1:SecurityErrorEvent):void{
trace(("SecurityError: " + _arg1.text));
}
public function get name():String{
return (_name);
}
public function get fadeAtEnd():Boolean{
return (_fadeAtEnd);
}
public function toggleMute(_arg1:Boolean=false):void{
if (_muted){
unmute(_arg1);
} else {
mute(_arg1);
};
}
public function get peakLeft():Number{
var _local1:Number;
var _local2:IAudioItem;
_local1 = 0;
for each (_local2 in _children) {
if (_local2.peakLeft > 0){
_local1 = (_local1 + _local2.peakLeft);
};
};
return ((_local1 / numChildren));
}
private function loadPlsFromFile(_arg1:String, _arg2:Function):void{
var _local3:URLLoader;
_local3 = new URLLoader();
_local3.dataFormat = URLLoaderDataFormat.TEXT;
_local3.addEventListener(Event.COMPLETE, _arg2);
_local3.addEventListener(IOErrorEvent.IO_ERROR, IOErrorHandler);
_local3.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
_local3.addEventListener(HTTPStatusEvent.HTTP_STATUS, HTTPStatusHandler);
_local3.load(new URLRequest(_arg1));
}
protected function setAudio(_arg1:IAudioItem, _arg2:int=-1):void{
_arg1.volumeMultiplier = (_facadeVolume * _volumeMultiplier);
_arg1.panMultiplier = _facadePan;
_arg1.fadeAtEnd = _fadeAtEnd;
}
public function get pan():Number{
return (_facadePan);
}
public function get peakRight():Number{
var _local1:Number;
var _local2:IAudioItem;
_local1 = 0;
for each (_local2 in _children) {
if (_local2.peakRight > 0){
_local1 = (_local1 + _local2.peakRight);
};
};
return ((_local1 / numChildren));
}
public function get numChildren():int{
return (_numChildren);
}
protected function remove(_arg1:int):void{
_children.splice(_arg1, 1);
_numChildren--;
}
protected function add(_arg1:IAudioItem, _arg2:int=-1):void{
if (_arg2 == -1){
_children.push(_arg1);
} else {
_children.splice(_arg2, 0, _arg1);
};
setAudio(_arg1);
_numChildren++;
}
public function set panMultiplier(_arg1:Number):void{
_panMultiplier = _arg1;
applyPan();
}
public function cookieRetrieve(_arg1:String):void{
var _local2:Object;
_local2 = Core.cookieRetrieve(_arg1);
volume = (_local2.volume) ? _local2.volume : _facadeVolume;
pan = (_local2.pan) ? _local2.pan : _facadePan;
}
public function crossfade(_arg1:IAudioItem, _arg2:Number=NaN):void{
var _local3:Number;
_local3 = (isNaN(_arg2)) ? Mixer.DURATION_TRANSITIONS : _arg2;
volumeTo(_arg2, 0, _facadeVolume, false, clear);
_arg1.start(false);
_arg1.volumeTo(_arg2, NaN, 0, false);
}
public function cookieWrite(_arg1:String):Boolean{
var _local2:Object;
_local2 = {volume:volume, pan:pan};
return (Core.cookieWrite(_arg1, _local2));
}
public function addTracksFromM3U(_arg1:String):void{
var _local2:Array;
var _local3:String;
_local2 = _arg1.split(/\s+/);
for each (_local3 in _local2) {
add(new Track(_local3));
};
}
public function get peak():Number{
var _local1:Number;
var _local2:IAudioItem;
_local1 = 0;
for each (_local2 in _children) {
if (_local2.peak > 0){
_local1 = (_local1 + _local2.peak);
};
};
return ((_local1 / numChildren));
}
public function loadM3U(_arg1:String):void{
loadPlsFromFile(_arg1, M3UCompleteHandler);
}
public function setPan(_arg1:Number):void{
_facadePan = _arg1;
applyPan();
}
public function addFrom(_arg1):void{
var _local2:String;
var _local3:Boolean;
var _local4:Boolean;
var _local5:*;
var _local6:*;
if ((_arg1 is IAudioItem)){
addChild((_arg1 as IAudioItem));
} else {
if ((_arg1 is String)){
_local2 = Core.getFileExt((_arg1 as String));
if ((((_local2 == "xspf")) || ((_local2 == "xml")))){
loadXSPF((_arg1 as String));
} else {
if (_local2 == "m3u"){
loadM3U((_arg1 as String));
};
};
} else {
if ((_arg1 is XML)){
addTracksFromXSPF((_arg1 as XML));
} else {
if ((_arg1 is Array)){
_local3 = true;
_local4 = true;
for each (_local5 in _arg1) {
if (!(_local5 is IAudioItem)){
_local3 = false;
};
if (!(_local5 is String)){
_local4 = false;
};
};
if (_local3){
for each (_local6 in _arg1) {
addChild((_local6 as IAudioItem));
};
} else {
if (_local4){
addTracksFromUrls(_arg1);
};
};
};
};
};
};
}
public function solo():void{
}
public function removeChild(_arg1:IAudioItem):IAudioItem{
var _local2:int;
var _local3:IAudioItem;
_local2 = 0;
while (_local2 < numChildren) {
if (_arg1 == _children[_local2]){
_local3 = _children[_local2];
remove(_local2);
return (_local3);
};
_local2++;
};
return (null);
}
public function get children():Array{
return (_children);
}
}
}//package com.neriksworkshop.lib.ASaudio
Section 6
//Mixer (com.neriksworkshop.lib.ASaudio.Mixer)
package com.neriksworkshop.lib.ASaudio {
public class Mixer {
public static var DURATION_TRANSITIONS:Number = 2000;
public static var DURATION_PLAYBACK_FADE:Number = 1000;
public static var DURATION_MUTE_FADE:Number = 500;
public static var DURATION_PAN_FADE:Number = 2000;
public static var DURATION_DEFAULT:Number = 333;
public function Mixer(){
throw (new Error("ASaudio.Mixer : this class is static"));
}
}
}//package com.neriksworkshop.lib.ASaudio
Section 7
//Track (com.neriksworkshop.lib.ASaudio.Track)
package com.neriksworkshop.lib.ASaudio {
import com.neriksworkshop.lib.ASaudio.core.*;
import flash.events.*;
import flash.media.*;
import flash.utils.*;
import flash.net.*;
public class Track extends EventDispatcher implements IAudioItem {
private var _length:Number;
private var _fadeAtEnd:Boolean;
private var _refTransform:SoundTransform;
private var _fileUrl:String;
private var _refPosition:Number;// = 0
private var _facadePan:Number;// = 0
private var _active:Boolean;
private var _facadeVolume:Number;// = 1
private var _bytesTotal:Number;// = 0
private var _panMultiplier:Number;// = 0
private var timer:Timer;
private var _paused:Boolean;// = true
private var _name:String;
private var _muted:Boolean;// = false
private var _context:SoundLoaderContext;
private var _loop:Boolean;
private var _uid:int;
private var _bytesLoaded:Number;// = 0
private var _startTimeFromCookie:Number;
private var _id3:ID3Info;
private var _volumeMultiplier:Number;// = 1
private var _realPan:Number;// = 0
private var _loadStarted:Boolean;
private var _ss:Array;
public function Track(_arg1:String, _arg2:String=null, _arg3:SoundLoaderContext=null){
_ss = [null, null];
_bytesLoaded = 0;
_bytesTotal = 0;
_paused = true;
_refPosition = 0;
_refTransform = new SoundTransform();
_facadeVolume = 1;
_volumeMultiplier = 1;
_muted = false;
_realPan = 0;
_facadePan = 0;
_panMultiplier = 0;
super();
this._fileUrl = _arg1;
this._uid = Core.getUid();
this._name = (_arg2) ? _arg2 : String(_uid);
this._context = _arg3;
Core.manager.add(this);
}
public function stop(_arg1:Boolean=false):void{
if (!_active){
return;
};
if (_arg1){
volumeTo(Mixer.DURATION_PLAYBACK_FADE, 0, NaN, false, clear);
} else {
clear();
};
}
public function set volumeMultiplier(_arg1:Number):void{
_volumeMultiplier = _arg1;
applyVolume();
}
public function togglePause(_arg1:Boolean=false):void{
if (_paused){
resume(_arg1);
} else {
pause(_arg1);
};
}
public function get active():Boolean{
return (_active);
}
public function set name(_arg1:String):void{
_name = _arg1;
}
public function set fadeAtEnd(_arg1:Boolean):void{
_fadeAtEnd = _arg1;
}
public function mute(_arg1:Boolean=false):void{
if (_muted){
return;
};
_muted = true;
if (_arg1){
volumeTo(Mixer.DURATION_MUTE_FADE, 0, NaN, false);
} else {
setVolume(0);
};
}
public function setVolume(_arg1:Number):void{
_facadeVolume = _arg1;
applyVolume();
}
public function get volume():Number{
return (_facadeVolume);
}
public function right(_arg1:Boolean=false):void{
if (_arg1){
panTo(Mixer.DURATION_PAN_FADE, Core.RIGHT);
} else {
pan = Core.RIGHT;
};
}
public function get position():Number{
return ((sc) ? (sc.position / duration) : 0);
}
public function unsolo():void{
}
public function resume(_arg1:Boolean=false):void{
if (!_paused){
return;
};
start(false, _refPosition);
if (_arg1){
volumeTo(Mixer.DURATION_PLAYBACK_FADE, _refTransform.volume, 0, false);
} else {
volume = _refTransform.volume;
};
}
public function get paused():Boolean{
return (_paused);
}
private function applyVolume():void{
var _local1:Number;
var _local2:SoundTransform;
if (_facadeVolume < 0){
_facadeVolume = 0;
};
if (_facadeVolume > 1){
_facadeVolume = 1;
};
_local1 = (_facadeVolume * _volumeMultiplier);
if (sc){
_local2 = sc.soundTransform;
_local2.volume = _local1;
sc.soundTransform = _local2;
};
dispatchEvent(new Event(AudioEvents.VOLUME_CHANGE));
}
public function unmute(_arg1:Boolean=false):void{
if (!_muted){
return;
};
_muted = false;
if (_arg1){
volumeTo(Mixer.DURATION_MUTE_FADE, _refTransform.volume, 0, false);
} else {
setVolume(_refTransform.volume);
};
}
public function set volume(_arg1:Number):void{
setVolume(_arg1);
_refTransform.volume = _facadeVolume;
}
public function volumeTo(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Boolean=true, _arg5:Function=null):void{
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local6 = (isNaN(_arg3)) ? _facadeVolume : _arg3;
_local7 = (isNaN(_arg2)) ? _facadeVolume : _arg2;
_local8 = (isNaN(_arg1)) ? Mixer.DURATION_DEFAULT : _arg1;
Core.manager.volumeTo(_uid, _local8, _local6, _local7, _arg4, _arg5);
}
private function sndHandlerID3(_arg1:Event):void{
_id3 = Sound(_ss[0]).id3;
dispatchEvent(new Event(Event.ID3));
}
public function set pan(_arg1:Number):void{
setPan(_arg1);
}
private function scHandlerComplete(_arg1:Event):void{
if (_fadeAtEnd){
Core.manager.killVolumeTo(_uid);
};
dispatchEvent(new Event(Event.SOUND_COMPLETE));
_paused = true;
if (_loop){
start();
} else {
_refPosition = 0;
clear();
};
}
public function panTo(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Boolean=true):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local5 = (isNaN(_arg3)) ? _facadePan : _arg3;
_local6 = (isNaN(_arg2)) ? _facadePan : _arg2;
_local7 = (isNaN(_arg1)) ? Mixer.DURATION_DEFAULT : _arg1;
Core.manager.panTo(_uid, _local7, _local5, _local6, _arg4);
}
public function set loop(_arg1:Boolean):void{
_loop = _arg1;
}
public function get uid():uint{
return (_uid);
}
public function center(_arg1:Boolean=false):void{
if (_arg1){
panTo(Mixer.DURATION_PAN_FADE, Core.CENTER);
} else {
pan = Core.CENTER;
};
}
public function get panMultiplier():Number{
return (_panMultiplier);
}
public function left(_arg1:Boolean=false):void{
if (_arg1){
panTo(Mixer.DURATION_PAN_FADE, Core.LEFT);
} else {
pan = Core.LEFT;
};
}
private function applyPan():void{
var _local1:Number;
var _local2:Number;
var _local3:SoundTransform;
if (_facadePan < Core.LEFT){
_facadePan = Core.LEFT;
};
if (_facadePan > Core.RIGHT){
_facadePan = Core.RIGHT;
};
_local1 = ((_panMultiplier)<0) ? 1 : (1 - _panMultiplier);
_local2 = ((_panMultiplier)>0) ? 1 : (1 - Math.abs(_panMultiplier));
if (sc){
_local3 = sc.soundTransform;
_local3.pan = _facadePan;
_local3.leftToLeft = (_local3.leftToLeft * _local1);
_local3.rightToLeft = (_local3.rightToLeft * _local1);
_local3.rightToRight = (_local3.rightToRight * _local2);
_local3.leftToRight = (_local3.leftToRight * _local2);
sc.soundTransform = _local3;
} else {
_refTransform.pan = _facadePan;
_refTransform.leftToLeft = (_refTransform.leftToLeft * _local1);
_refTransform.rightToLeft = (_refTransform.rightToLeft * _local1);
_refTransform.rightToRight = (_refTransform.rightToRight * _local2);
_refTransform.leftToRight = (_refTransform.leftToRight * _local2);
};
dispatchEvent(new Event(AudioEvents.PAN_CHANGE));
}
private function get sc():SoundChannel{
return (SoundChannel(_ss[1]));
}
public function start(_arg1:Boolean=false, _arg2:Number=0, _arg3:Boolean=false):void{
var _local4:Number;
_paused = false;
_local4 = Core.getTime(_arg2, length);
if (_arg3){
_local4 = Core.getTime(_startTimeFromCookie, length);
};
createSS(_local4);
setVolume(_refTransform.volume);
setPan(_refTransform.pan);
if (_arg1){
volumeTo(Mixer.DURATION_PLAYBACK_FADE, _facadeVolume, 0, false);
};
dispatchEvent(new Event(AudioEvents.START));
}
private function createSS(_arg1:Number):void{
if (((_ss[0]) || (_ss[1]))){
removeSS();
};
_ss[0] = new Sound();
Sound(_ss[0]).addEventListener(Event.COMPLETE, sndHandlerComplete);
Sound(_ss[0]).addEventListener(Event.ID3, sndHandlerID3);
Sound(_ss[0]).addEventListener(IOErrorEvent.IO_ERROR, sndHandlerIOError);
Sound(_ss[0]).addEventListener(Event.OPEN, sndHandlerOpen);
Sound(_ss[0]).addEventListener(ProgressEvent.PROGRESS, sndHandlerProgress);
Sound(_ss[0]).load(new URLRequest(_fileUrl), _context);
_ss[1] = Sound(_ss[0]).play(_arg1);
SoundChannel(_ss[1]).addEventListener(Event.SOUND_COMPLETE, scHandlerComplete);
_active = true;
}
public function clear():void{
removeSS();
Core.manager.killVolumeTo(_uid);
Core.manager.panToDone(_uid);
}
public function get sizeLoaded():Number{
return ((_bytesLoaded / _bytesTotal));
}
public function get url():String{
return (snd.url);
}
public function get id3():ID3Info{
return (_id3);
}
public function get volumeMultiplier():Number{
return (_volumeMultiplier);
}
public function get volumeUnits():Number{
return (0);
}
public function get peakRight():Number{
return ((sc) ? sc.rightPeak : 0);
}
public function get name():String{
return (_name);
}
public function get fadeAtEnd():Boolean{
return (_fadeAtEnd);
}
public function get duration():Number{
return ((_length / sizeLoaded));
}
public function get peakLeft():Number{
return ((sc) ? sc.leftPeak : 0);
}
private function get snd():Sound{
return (Sound(_ss[0]));
}
public function notifyEndFadeStart():void{
dispatchEvent(new Event(AudioEvents.FADE_AT_END_STARTED));
}
public function toggleMute(_arg1:Boolean=false):void{
if (_muted){
unmute(_arg1);
} else {
mute(_arg1);
};
}
public function get pan():Number{
return (_facadePan);
}
public function get isBuffering():Boolean{
return ((snd) ? snd.isBuffering : false);
}
private function sndHandlerOpen(_arg1:Event):void{
_loadStarted = true;
dispatchEvent(new Event(Event.OPEN));
}
public function get loop():Boolean{
return (_loop);
}
public function get sizeLoadedBytes():Number{
return (_bytesLoaded);
}
public function set panMultiplier(_arg1:Number):void{
_panMultiplier = _arg1;
applyPan();
}
public function get positionMs():Number{
return ((sc) ? sc.position : 0);
}
public function crossfade(_arg1:IAudioItem, _arg2:Number=NaN):void{
var _local3:Number;
_local3 = (isNaN(_arg2)) ? Mixer.DURATION_TRANSITIONS : _arg2;
volumeTo(_local3, 0, _facadeVolume, false, clear);
_arg1.start(false);
_arg1.volumeTo(_local3, NaN, 0, false);
}
private function sndHandlerIOError(_arg1:IOErrorEvent):void{
dispatchEvent(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false));
}
public function get sizeTotal():Number{
return (_bytesTotal);
}
public function cookieRetrieve(_arg1:String):void{
var _local2:Object;
_local2 = Core.cookieRetrieve(_arg1);
volume = (_local2.volume) ? _local2.volume : _facadeVolume;
pan = (_local2.pan) ? _local2.pan : _facadePan;
_startTimeFromCookie = (_local2.positionMs) ? _local2.positionMs : 0;
}
public function cookieWrite(_arg1:String):Boolean{
var _local2:Object;
_local2 = {volume:volume, pan:pan, positionMs:positionMs};
return (Core.cookieWrite(_arg1, _local2));
}
public function get peak():Number{
return ((sc) ? ((peakLeft + peakRight) / 2) : 0);
}
private function removeSS():void{
if (_ss[1]){
SoundChannel(_ss[1]).stop();
SoundChannel(_ss[1]).removeEventListener(Event.SOUND_COMPLETE, scHandlerComplete);
delete _ss[1];
_ss[1] = null;
};
if (_ss[0]){
Sound(_ss[0]).removeEventListener(Event.COMPLETE, sndHandlerComplete);
Sound(_ss[0]).removeEventListener(Event.ID3, sndHandlerID3);
Sound(_ss[0]).removeEventListener(IOErrorEvent.IO_ERROR, sndHandlerIOError);
Sound(_ss[0]).removeEventListener(Event.OPEN, sndHandlerOpen);
Sound(_ss[0]).removeEventListener(ProgressEvent.PROGRESS, sndHandlerProgress);
try {
Sound(_ss[0]).close();
} catch(e:Error) {
};
delete _ss[0];
_ss[0] = null;
};
_active = false;
}
public function setPan(_arg1:Number):void{
_facadePan = _arg1;
applyPan();
}
public function solo():void{
}
private function sndHandlerProgress(_arg1:ProgressEvent):void{
if (snd.length > 0){
_length = snd.length;
};
_bytesLoaded = _arg1.bytesLoaded;
_bytesTotal = _arg1.bytesTotal;
dispatchEvent(new ProgressEvent(ProgressEvent.PROGRESS, false, false, _arg1.bytesLoaded, _arg1.bytesTotal));
}
private function sndHandlerComplete(_arg1:Event):void{
dispatchEvent(new Event(Event.COMPLETE));
}
public function pause(_arg1:Boolean=false):void{
if (((_paused) || (!(_active)))){
return;
};
_paused = true;
_refPosition = position;
if (_arg1){
volumeTo(Mixer.DURATION_PLAYBACK_FADE, 0, NaN, false, clear);
} else {
clear();
};
}
}
}//package com.neriksworkshop.lib.ASaudio
Section 8
//MainTimeline (HOTD_soundmixer_fla.MainTimeline)
package HOTD_soundmixer_fla {
import flash.events.*;
import flash.media.*;
import com.neriksworkshop.lib.ASaudio.*;
import flash.utils.*;
import flash.display.*;
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.text.*;
import flash.ui.*;
import flash.xml.*;
import gs.*;
import gs.easing.*;
import actionscript.*;
public dynamic class MainTimeline extends MovieClip {
public var lastY2:Number;
public var lastY3:Number;
public var lastY4:Number;
public var lastY5:Number;
public var bounds6:Object;
public var muted2:Boolean;
public var muted3:Boolean;
public var muted4:Boolean;
public var muted5:Boolean;
public var track1:Track;
public var track2:Track;
public var track3:Track;
public var track4:Track;
public var track5:Track;
public var track7:Track;
public var track8:Track;
public var track6:Track;
public var track9:Track;
public var lastY:Number;
public var isDragging:Boolean;
public var track11:Track;
public var track12:Track;
public var track13:Track;
public var track14:Track;
public var track15:Track;
public var track16:Track;
public var track10:Track;
public var track19:Track;
public var offset:Number;
public var track17:Track;
public var track18:Track;
public var track20:Track;
public var track21:Track;
public var track22:Track;
public var track23:Track;
public var track24:Track;
public var track25:Track;
public var visualizer:MovieClip;
public var isPlaying2:Boolean;
public var isPlaying3:Boolean;
public var isPlaying4:Boolean;
public var green_btn1:MovieClip;
public var green_btn2:MovieClip;
public var green_btn3:MovieClip;
public var green_btn4:MovieClip;
public var green_btn5:MovieClip;
public var green_btn7:MovieClip;
public var isPlaying5:Boolean;
public var green_btn9:MovieClip;
public var thumb2:MovieClip;
public var thumb4:MovieClip;
public var thumb5:MovieClip;
public var thumb6:MovieClip;
public var thumb3:MovieClip;
public var green_btn6:MovieClip;
public var isPlaying6:Boolean;
public var green_btn8:MovieClip;
public var green_btn10:MovieClip;
public var green_btn12:MovieClip;
public var green_btn13:MovieClip;
public var green_btn14:MovieClip;
public var green_btn15:MovieClip;
public var green_btn16:MovieClip;
public var green_btn17:MovieClip;
public var green_btn18:MovieClip;
public var green_btn19:MovieClip;
public var green_btn11:MovieClip;
public var green_btn21:MovieClip;
public var green_btn23:MovieClip;
public var green_btn24:MovieClip;
public var green_btn25:MovieClip;
public var green_btn20:MovieClip;
public var muted:Boolean;
public var green_btn22:MovieClip;
public var mute_mc:MovieClip;
public var group2:Group;
public var group4:Group;
public var group1:Group;
public var group5:Group;
public var group3:Group;
public var vx6:Number;
public var counter1:int;
public var counter2:int;
public var counter3:int;
public var counter5:int;
public var counter4:int;
public var timerObject1:Timer;
public var timerObject2:Timer;
public var timerObject3:Timer;
public var timerObject4:Timer;
public var timerObject5:Timer;
public var vy5:Number;
public var thumb:MovieClip;
public var vy3:Number;
public var vy2:Number;
public var vy4:Number;
public var offset2:Number;
public var currentY:Number;
public var offset4:Number;
public var offset5:Number;
public var offset6:Number;
public var offset3:Number;
public var currentX6:Number;
public var currentY3:Number;
public var currentY4:Number;
public var currentY5:Number;
public var mute_mc2:MovieClip;
public var mute_mc3:MovieClip;
public var mute_mc4:MovieClip;
public var mute_mc5:MovieClip;
public var currentY2:Number;
public var DURATION_PLAYBACK_FADE:Number;
public var isDragging2:Boolean;
public var isDragging3:Boolean;
public var isDragging4:Boolean;
public var isDragging6:Boolean;
public var groupall:Group;
public var vy:Number;
public var isDragging5:Boolean;
public var bounds:Object;
public var isPlaying:Boolean;
public var lastX6:Number;
public function MainTimeline(){
addFrameScript(0, frame1);
}
function frame1(){
counter1 = 0;
timerObject1 = new Timer(2000, 1);
counter2 = 0;
timerObject2 = new Timer(2000, 1);
counter3 = 0;
timerObject3 = new Timer(2000, 1);
counter4 = 0;
timerObject4 = new Timer(2000, 1);
counter5 = 0;
timerObject5 = new Timer(2000, 1);
globalvars.data.numx = "0";
DURATION_PLAYBACK_FADE = 50;
track1 = new Track("soundfx/debris.mp3");
track2 = new Track("soundfx/Explosion.mp3");
track3 = new Track("soundfx/singleshot.mp3");
track4 = new Track("soundfx/MachineGunShells.mp3");
track5 = new Track("soundfx/Shotgun2.mp3");
track6 = new Track("soundfx/Ricochets3.mp3");
track7 = new Track("soundfx/Hit_Flesh_2.mp3");
track8 = new Track("soundfx/hahaha.mp3");
track9 = new Track("soundfx/zombie1.mp3");
track10 = new Track("soundfx/zombie2.mp3");
track11 = new Track("soundfx/monstermadeallies.mp3");
track12 = new Track("soundfx/whatthefunk.mp3");
track13 = new Track("soundfx/moremutants.mp3");
track14 = new Track("soundfx/passingyouby.mp3");
track15 = new Track("soundfx/shootthemofo.mp3");
track16 = new Track("soundfx/mutantbastard.mp3");
track17 = new Track("soundfx/motherfuck_scream.mp3");
track18 = new Track("soundfx/tellmysisteriluvher.mp3");
track19 = new Track("soundfx/freeze_bitches.mp3");
track20 = new Track("soundfx/handsintheair.mp3");
track21 = new Track("music/GoGetEmRuff.mp3");
track22 = new Track("music/PapaCeasarRuff.mp3");
track23 = new Track("music/ZombieShuffleRuff.mp3");
track24 = new Track("music/VarlaRuff.mp3");
track25 = new Track("music/GThemeRuff.mp3");
groupall = new Group([track1, track2, track3, track4, track5, track6, track7, track8, track9, track10, track11, track12, track13, track14, track15, track16, track17, track18, track19, track20, track21, track22, track23, track24, track25]);
group1 = new Group([track1, track2, track3, track4, track5]);
group2 = new Group([track6, track7, track8, track9, track10]);
group3 = new Group([track11, track12, track13, track14, track15]);
group4 = new Group([track16, track17, track18, track19, track20]);
group5 = new Group([track21, track22, track23, track24, track25]);
bounds = {top:131, bottom:401};
currentY = thumb.y;
lastY = thumb.y;
vy = 0;
isDragging = false;
isPlaying = false;
thumb.buttonMode = true;
currentY2 = thumb2.y;
lastY2 = thumb2.y;
vy2 = 0;
isDragging2 = false;
isPlaying2 = false;
thumb2.buttonMode = true;
currentY3 = thumb3.y;
lastY3 = thumb3.y;
vy3 = 0;
isDragging3 = false;
isPlaying3 = false;
thumb3.buttonMode = true;
currentY4 = thumb4.y;
lastY4 = thumb4.y;
vy4 = 0;
isDragging4 = false;
isPlaying4 = false;
thumb4.buttonMode = true;
currentY5 = thumb5.y;
lastY5 = thumb5.y;
vy5 = 0;
isDragging5 = false;
isPlaying5 = false;
thumb5.buttonMode = true;
bounds6 = {left:315, right:566};
currentX6 = thumb6.x;
lastX6 = thumb6.x;
vx6 = 0;
isDragging6 = false;
isPlaying6 = false;
thumb6.buttonMode = true;
addEventListener(Event.ENTER_FRAME, loop);
addEventListener(Event.ENTER_FRAME, loop2);
addEventListener(Event.ENTER_FRAME, loop3);
addEventListener(Event.ENTER_FRAME, loop4);
addEventListener(Event.ENTER_FRAME, loop5);
addEventListener(Event.ENTER_FRAME, loop6);
thumb.addEventListener(MouseEvent.MOUSE_DOWN, onDown);
thumb2.addEventListener(MouseEvent.MOUSE_DOWN, onDown2);
thumb3.addEventListener(MouseEvent.MOUSE_DOWN, onDown3);
thumb4.addEventListener(MouseEvent.MOUSE_DOWN, onDown4);
thumb5.addEventListener(MouseEvent.MOUSE_DOWN, onDown5);
thumb6.addEventListener(MouseEvent.MOUSE_DOWN, onDown6);
addEventListener(MouseEvent.MOUSE_UP, onUp);
addEventListener(MouseEvent.MOUSE_UP, onUp2);
addEventListener(MouseEvent.MOUSE_UP, onUp3);
addEventListener(MouseEvent.MOUSE_UP, onUp4);
addEventListener(MouseEvent.MOUSE_UP, onUp5);
addEventListener(MouseEvent.MOUSE_UP, onUp6);
addEventListener(Event.ENTER_FRAME, soundOver);
addEventListener(Event.ENTER_FRAME, soundOver2);
addEventListener(Event.ENTER_FRAME, soundOver3);
addEventListener(Event.ENTER_FRAME, soundOver4);
addEventListener(Event.ENTER_FRAME, soundOver5);
muted = false;
mute_mc.buttonMode = true;
mute_mc.addEventListener(MouseEvent.CLICK, mute);
muted2 = false;
mute_mc2.buttonMode = true;
mute_mc2.addEventListener(MouseEvent.CLICK, mute2);
muted3 = false;
mute_mc3.addEventListener(MouseEvent.CLICK, mute3);
mute_mc3.buttonMode = true;
muted4 = false;
mute_mc4.addEventListener(MouseEvent.CLICK, mute4);
mute_mc4.buttonMode = true;
muted5 = false;
mute_mc5.buttonMode = true;
mute_mc5.addEventListener(MouseEvent.CLICK, mute5);
stop();
}
public function timerHandler1(_arg1:TimerEvent):void{
counter1++;
isPlaying = false;
}
public function timerHandler3(_arg1:TimerEvent):void{
counter3++;
isPlaying3 = false;
}
public function timerHandler4(_arg1:TimerEvent):void{
counter4++;
isPlaying4 = false;
}
public function timerHandler5(_arg1:TimerEvent):void{
counter5++;
isPlaying5 = false;
}
public function timerHandler2(_arg1:TimerEvent):void{
counter2++;
isPlaying2 = false;
}
public function doSoundComplete(_arg1:Event):void{
timerObject1.addEventListener(TimerEvent.TIMER, timerHandler1);
timerObject1.start();
}
public function onUp(_arg1:MouseEvent):void{
isDragging = false;
removeEventListener(MouseEvent.MOUSE_MOVE, onMove);
}
public function onDown2(_arg1:MouseEvent):void{
isDragging2 = true;
offset = thumb2.mouseY;
addEventListener(MouseEvent.MOUSE_MOVE, onMove2);
}
public function onDown4(_arg1:MouseEvent):void{
isDragging4 = true;
offset = thumb4.mouseY;
addEventListener(MouseEvent.MOUSE_MOVE, onMove4);
}
public function onDown5(_arg1:MouseEvent):void{
isDragging5 = true;
offset = thumb5.mouseY;
addEventListener(MouseEvent.MOUSE_MOVE, onMove5);
}
public function onDown6(_arg1:MouseEvent):void{
isDragging6 = true;
offset = thumb6.mouseX;
addEventListener(MouseEvent.MOUSE_MOVE, onMove6);
}
public function mute2(_arg1:MouseEvent):void{
if (muted2){
mute_mc2.gotoAndStop("On");
muted2 = false;
isPlaying2 = false;
} else {
group2.stop();
mute_mc2.gotoAndStop("Mute");
muted2 = true;
};
}
public function mute3(_arg1:MouseEvent):void{
if (muted3){
mute_mc3.gotoAndStop("On");
muted3 = false;
isPlaying3 = false;
} else {
group3.stop();
mute_mc3.gotoAndStop("Mute");
muted3 = true;
};
}
public function mute4(_arg1:MouseEvent):void{
if (muted4){
mute_mc4.gotoAndStop("On");
muted4 = false;
isPlaying4 = false;
} else {
group4.stop();
mute_mc4.gotoAndStop("Mute");
muted4 = true;
};
}
public function mute5(_arg1:MouseEvent):void{
if (muted5){
mute_mc5.gotoAndStop("On");
muted5 = false;
isPlaying5 = false;
} else {
group5.stop();
mute_mc5.gotoAndStop("Mute");
muted5 = true;
};
}
public function onDown3(_arg1:MouseEvent):void{
isDragging3 = true;
offset = thumb3.mouseY;
addEventListener(MouseEvent.MOUSE_MOVE, onMove3);
}
public function loop2(_arg1:Event):void{
if (isDragging2){
lastY2 = currentY2;
currentY2 = mouseY;
vy2 = (currentY2 - lastY2);
};
if (thumb2.y <= bounds.top){
thumb2.y = bounds.top;
vy2 = (vy2 * -1);
} else {
if (thumb2.y >= bounds.bottom){
thumb2.y = bounds.bottom;
vy2 = (vy2 * -1);
};
};
}
public function soundOver2(_arg1:Event):void{
if (((!(isPlaying2)) && (!(muted2)))){
green_btn6.visible = false;
green_btn7.visible = false;
green_btn8.visible = false;
green_btn9.visible = false;
green_btn10.visible = false;
if ((((thumb2.y > 128)) && ((thumb2.y < 138)))){
track6.start();
green_btn6.visible = true;
track6.addEventListener(Event.SOUND_COMPLETE, doSoundComplete2);
isPlaying2 = true;
};
if ((((thumb2.y > 181)) && ((thumb2.y < 191)))){
track7.start();
green_btn7.visible = true;
track7.addEventListener(Event.SOUND_COMPLETE, doSoundComplete2);
isPlaying2 = true;
};
if ((((thumb2.y > 235)) && ((thumb2.y < 245)))){
track8.start();
track8.volume = 0.6;
green_btn8.visible = true;
track8.addEventListener(Event.SOUND_COMPLETE, doSoundComplete2);
isPlaying2 = true;
};
if ((((thumb2.y > 288)) && ((thumb2.y < 298)))){
track9.start();
green_btn9.visible = true;
track9.addEventListener(Event.SOUND_COMPLETE, doSoundComplete2);
isPlaying2 = true;
};
if ((((thumb2.y > 343)) && ((thumb2.y < 353)))){
track10.start();
green_btn10.visible = true;
track10.addEventListener(Event.SOUND_COMPLETE, doSoundComplete2);
isPlaying2 = true;
};
};
if (isPlaying2){
if ((((((((((((thumb2.y > 299)) && ((thumb2.y < 342)))) || ((((thumb2.y > 246)) && ((thumb2.y < 287)))))) || ((((thumb2.y > 192)) && ((thumb2.y < 234)))))) || ((((thumb2.y > 139)) && ((thumb2.y < 180)))))) || ((thumb2.y > 354)))){
group2.stop();
isPlaying2 = false;
};
};
}
public function soundOver3(_arg1:Event):void{
if (((!(isPlaying3)) && (!(muted3)))){
green_btn11.visible = false;
green_btn12.visible = false;
green_btn13.visible = false;
green_btn14.visible = false;
green_btn15.visible = false;
if ((((thumb3.y > 128)) && ((thumb3.y < 138)))){
track11.start();
track11.volume = 0.5;
green_btn11.visible = true;
track11.addEventListener(Event.SOUND_COMPLETE, doSoundComplete3);
isPlaying3 = true;
};
if ((((thumb3.y > 181)) && ((thumb3.y < 191)))){
track12.start();
green_btn12.visible = true;
track12.addEventListener(Event.SOUND_COMPLETE, doSoundComplete3);
isPlaying3 = true;
};
if ((((thumb3.y > 235)) && ((thumb3.y < 245)))){
track13.start();
track13.volume = 0.7;
green_btn13.visible = true;
track13.addEventListener(Event.SOUND_COMPLETE, doSoundComplete3);
isPlaying3 = true;
};
if ((((thumb3.y > 288)) && ((thumb3.y < 298)))){
track14.start();
green_btn14.visible = true;
track14.addEventListener(Event.SOUND_COMPLETE, doSoundComplete3);
isPlaying3 = true;
};
if ((((thumb3.y > 343)) && ((thumb3.y < 353)))){
track15.start();
track15.volume = 0.7;
green_btn15.visible = true;
track15.addEventListener(Event.SOUND_COMPLETE, doSoundComplete3);
isPlaying3 = true;
};
};
if (isPlaying3){
if ((((((((((((thumb3.y > 299)) && ((thumb3.y < 342)))) || ((((thumb3.y > 246)) && ((thumb3.y < 287)))))) || ((((thumb3.y > 192)) && ((thumb3.y < 234)))))) || ((((thumb3.y > 139)) && ((thumb3.y < 180)))))) || ((thumb3.y > 354)))){
group3.stop();
isPlaying3 = false;
};
};
}
public function soundOver5(_arg1:Event):void{
if (((!(isPlaying5)) && (!(muted5)))){
green_btn21.visible = false;
green_btn22.visible = false;
green_btn23.visible = false;
green_btn24.visible = false;
green_btn25.visible = false;
if ((((thumb5.y > 128)) && ((thumb5.y < 138)))){
track21.start();
green_btn21.visible = true;
track21.addEventListener(Event.SOUND_COMPLETE, doSoundComplete5);
isPlaying5 = true;
};
if ((((thumb5.y > 181)) && ((thumb5.y < 191)))){
track22.start();
green_btn22.visible = true;
track22.addEventListener(Event.SOUND_COMPLETE, doSoundComplete5);
isPlaying5 = true;
};
if ((((thumb5.y > 235)) && ((thumb5.y < 245)))){
track23.start();
green_btn23.visible = true;
track23.addEventListener(Event.SOUND_COMPLETE, doSoundComplete5);
isPlaying5 = true;
};
if ((((thumb5.y > 288)) && ((thumb5.y < 298)))){
track24.start();
green_btn24.visible = true;
track24.addEventListener(Event.SOUND_COMPLETE, doSoundComplete5);
isPlaying5 = true;
};
if ((((thumb5.y > 343)) && ((thumb5.y < 353)))){
track25.start();
green_btn25.visible = true;
track25.addEventListener(Event.SOUND_COMPLETE, doSoundComplete5);
isPlaying5 = true;
};
};
if (isPlaying5){
if ((((((((((((thumb5.y > 299)) && ((thumb5.y < 342)))) || ((((thumb5.y > 246)) && ((thumb5.y < 287)))))) || ((((thumb5.y > 192)) && ((thumb5.y < 234)))))) || ((((thumb5.y > 139)) && ((thumb5.y < 180)))))) || ((thumb5.y > 354)))){
group5.stop();
isPlaying5 = false;
};
};
}
public function loop3(_arg1:Event):void{
if (isDragging3){
lastY3 = currentY3;
currentY3 = mouseY;
vy3 = (currentY3 - lastY3);
};
if (thumb3.y <= bounds.top){
thumb3.y = bounds.top;
vy3 = (vy3 * -1);
} else {
if (thumb3.y >= bounds.bottom){
thumb3.y = bounds.bottom;
vy3 = (vy3 * -1);
};
};
}
public function soundOver4(_arg1:Event):void{
if (((!(isPlaying4)) && (!(muted4)))){
green_btn16.visible = false;
green_btn17.visible = false;
green_btn18.visible = false;
green_btn19.visible = false;
green_btn20.visible = false;
if ((((thumb4.y > 128)) && ((thumb4.y < 138)))){
track16.start();
green_btn16.visible = true;
track16.addEventListener(Event.SOUND_COMPLETE, doSoundComplete4);
isPlaying4 = true;
};
if ((((thumb4.y > 181)) && ((thumb4.y < 191)))){
track17.start();
track17.volume = 0.6;
green_btn17.visible = true;
track17.addEventListener(Event.SOUND_COMPLETE, doSoundComplete4);
isPlaying4 = true;
};
if ((((thumb4.y > 235)) && ((thumb4.y < 245)))){
track18.start();
green_btn18.visible = true;
track18.addEventListener(Event.SOUND_COMPLETE, doSoundComplete4);
isPlaying4 = true;
};
if ((((thumb4.y > 288)) && ((thumb4.y < 298)))){
track19.start();
track19.volume = 0.5;
green_btn19.visible = true;
track19.addEventListener(Event.SOUND_COMPLETE, doSoundComplete4);
isPlaying4 = true;
};
if ((((thumb4.y > 343)) && ((thumb4.y < 353)))){
track20.start();
green_btn20.visible = true;
track20.addEventListener(Event.SOUND_COMPLETE, doSoundComplete4);
isPlaying4 = true;
};
};
if (isPlaying4){
if ((((((((((((thumb4.y > 299)) && ((thumb4.y < 342)))) || ((((thumb4.y > 246)) && ((thumb4.y < 287)))))) || ((((thumb4.y > 192)) && ((thumb4.y < 234)))))) || ((((thumb4.y > 139)) && ((thumb4.y < 180)))))) || ((thumb4.y > 354)))){
group4.stop();
isPlaying4 = false;
};
};
}
public function loop6(_arg1:Event):void{
var _local2:Number;
if (isDragging6){
lastX6 = currentX6;
currentX6 = mouseX;
vx6 = (currentX6 - lastX6);
};
if (thumb6.x <= bounds6.left){
thumb6.x = bounds6.left;
vx6 = (vx6 * -1);
} else {
if (thumb6.x >= bounds6.right){
thumb6.x = bounds6.right;
vx6 = (vx6 * -1);
};
};
_local2 = 0;
_local2 = ((thumb6.x - bounds6.left) / (bounds.right - bounds6.left));
groupall.volume = ((thumb6.x - bounds6.left) / (bounds6.right - bounds6.left));
}
public function mute(_arg1:MouseEvent):void{
if (muted){
mute_mc.gotoAndStop("On");
muted = false;
isPlaying = false;
} else {
group1.stop();
mute_mc.gotoAndStop("Mute");
muted = true;
};
}
public function onMove(_arg1:MouseEvent):void{
thumb.y = (mouseY - offset);
if (thumb.y <= bounds.top){
thumb.y = bounds.top;
} else {
if (thumb.y >= bounds.bottom){
thumb.y = bounds.bottom;
};
};
_arg1.updateAfterEvent();
}
public function loop4(_arg1:Event):void{
if (isDragging4){
lastY4 = currentY4;
currentY4 = mouseY;
vy4 = (currentY4 - lastY4);
};
if (thumb4.y <= bounds.top){
thumb4.y = bounds.top;
vy4 = (vy4 * -1);
} else {
if (thumb4.y >= bounds.bottom){
thumb4.y = bounds.bottom;
vy4 = (vy4 * -1);
};
};
}
public function loop5(_arg1:Event):void{
if (isDragging5){
lastY5 = currentY5;
currentY5 = mouseY;
vy5 = (currentY5 - lastY5);
};
if (thumb5.y <= bounds.top){
thumb5.y = bounds.top;
vy5 = (vy5 * -1);
} else {
if (thumb5.y >= bounds.bottom){
thumb5.y = bounds.bottom;
vy5 = (vy5 * -1);
};
};
}
public function soundOver(_arg1:Event):void{
if (((!(isPlaying)) && (!(muted)))){
green_btn1.visible = false;
green_btn2.visible = false;
green_btn3.visible = false;
green_btn4.visible = false;
green_btn5.visible = false;
if ((((thumb.y > 128)) && ((thumb.y < 138)))){
track1.start();
green_btn1.visible = true;
track1.addEventListener(Event.SOUND_COMPLETE, doSoundComplete);
isPlaying = true;
};
if ((((thumb.y > 181)) && ((thumb.y < 191)))){
track2.start();
green_btn2.visible = true;
track2.addEventListener(Event.SOUND_COMPLETE, doSoundComplete);
isPlaying = true;
};
if ((((thumb.y > 235)) && ((thumb.y < 245)))){
track3.start();
green_btn3.visible = true;
track3.addEventListener(Event.SOUND_COMPLETE, doSoundComplete);
isPlaying = true;
};
if ((((thumb.y > 288)) && ((thumb.y < 298)))){
track4.start();
track4.volume = 0.5;
green_btn4.visible = true;
track4.addEventListener(Event.SOUND_COMPLETE, doSoundComplete);
isPlaying = true;
};
if ((((thumb.y > 343)) && ((thumb.y < 353)))){
track5.start();
track5.volume = 0.7;
green_btn5.visible = true;
track5.addEventListener(Event.SOUND_COMPLETE, doSoundComplete);
isPlaying = true;
};
};
if (isPlaying){
if ((((((((((((thumb.y > 299)) && ((thumb.y < 342)))) || ((((thumb.y > 246)) && ((thumb.y < 287)))))) || ((((thumb.y > 192)) && ((thumb.y < 234)))))) || ((((thumb.y > 139)) && ((thumb.y < 180)))))) || ((thumb.y > 354)))){
group1.stop();
isPlaying = false;
};
};
}
public function onUp2(_arg1:MouseEvent):void{
isDragging2 = false;
removeEventListener(MouseEvent.MOUSE_MOVE, onMove2);
}
public function onUp3(_arg1:MouseEvent):void{
isDragging3 = false;
removeEventListener(MouseEvent.MOUSE_MOVE, onMove3);
}
public function onUp4(_arg1:MouseEvent):void{
isDragging4 = false;
removeEventListener(MouseEvent.MOUSE_MOVE, onMove4);
}
public function onUp5(_arg1:MouseEvent):void{
isDragging5 = false;
removeEventListener(MouseEvent.MOUSE_MOVE, onMove5);
}
public function onUp6(_arg1:MouseEvent):void{
isDragging6 = false;
removeEventListener(MouseEvent.MOUSE_MOVE, onMove6);
}
public function loop(_arg1:Event):void{
if (isDragging){
lastY = currentY;
currentY = mouseX;
vy = (currentY - lastY);
};
if (thumb.y <= bounds.top){
thumb.y = bounds.top;
vy = (vy * -1);
} else {
if (thumb.y >= bounds.bottom){
thumb.y = bounds.bottom;
vy = (vy * -1);
};
};
vy = (vy * 0.95);
if (Math.abs(vy) < 0.5){
vy = 0;
};
}
public function onDown(_arg1:MouseEvent):void{
isDragging = true;
offset = thumb.mouseY;
addEventListener(MouseEvent.MOUSE_MOVE, onMove);
}
public function doSoundComplete2(_arg1:Event):void{
timerObject2.addEventListener(TimerEvent.TIMER, timerHandler2);
timerObject2.start();
}
public function doSoundComplete3(_arg1:Event):void{
timerObject3.addEventListener(TimerEvent.TIMER, timerHandler3);
timerObject3.start();
}
public function doSoundComplete4(_arg1:Event):void{
timerObject4.addEventListener(TimerEvent.TIMER, timerHandler4);
timerObject4.start();
}
public function doSoundComplete5(_arg1:Event):void{
timerObject5.addEventListener(TimerEvent.TIMER, timerHandler5);
timerObject5.start();
}
public function onMove2(_arg1:MouseEvent):void{
thumb2.y = (mouseY - offset);
if (thumb2.y <= bounds.top){
thumb2.y = bounds.top;
} else {
if (thumb2.y >= bounds.bottom){
thumb2.y = bounds.bottom;
};
};
_arg1.updateAfterEvent();
}
public function onMove3(_arg1:MouseEvent):void{
thumb3.y = (mouseY - offset);
if (thumb3.y <= bounds.top){
thumb3.y = bounds.top;
} else {
if (thumb3.y >= bounds.bottom){
thumb3.y = bounds.bottom;
};
};
_arg1.updateAfterEvent();
}
public function onMove4(_arg1:MouseEvent):void{
thumb4.y = (mouseY - offset);
if (thumb4.y <= bounds.top){
thumb4.y = bounds.top;
} else {
if (thumb4.y >= bounds.bottom){
thumb4.y = bounds.bottom;
};
};
_arg1.updateAfterEvent();
}
public function onMove5(_arg1:MouseEvent):void{
thumb5.y = (mouseY - offset);
if (thumb5.y <= bounds.top){
thumb5.y = bounds.top;
} else {
if (thumb5.y >= bounds.bottom){
thumb5.y = bounds.bottom;
};
};
_arg1.updateAfterEvent();
}
public function onMove6(_arg1:MouseEvent):void{
thumb6.x = (mouseX - offset);
if (thumb6.x <= bounds6.left){
thumb6.x = bounds6.left;
} else {
if (thumb6.x >= bounds6.right){
thumb6.x = bounds6.right;
};
};
_arg1.updateAfterEvent();
}
}
}//package HOTD_soundmixer_fla
Section 9
//mute_5 (HOTD_soundmixer_fla.mute_5)
package HOTD_soundmixer_fla {
import flash.display.*;
public dynamic class mute_5 extends MovieClip {
public function mute_5(){
addFrameScript(0, frame1, 4, frame5);
}
function frame1(){
stop();
}
function frame5(){
stop();
}
}
}//package HOTD_soundmixer_fla
Section 10
//test_mc_7 (HOTD_soundmixer_fla.test_mc_7)
package HOTD_soundmixer_fla {
import flash.events.*;
import flash.media.*;
import flash.utils.*;
import flash.display.*;
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.text.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class test_mc_7 extends MovieClip {
public var ba:ByteArray;
public var needle2:MovieClip;
public var needle1:MovieClip;
public function test_mc_7(){
addFrameScript(0, frame1);
}
function frame1(){
ba = new ByteArray();
addEventListener(Event.ENTER_FRAME, loop);
}
public function loop(_arg1:Event):void{
var _local2:uint;
var _local3:*;
var _local4:*;
var _local5:*;
graphics.clear();
graphics.lineStyle(2, 43263);
graphics.moveTo(-1, 50);
SoundMixer.computeSpectrum(ba);
_local2 = 0;
while (_local2 < 0x0100) {
globalvars.data.numx = ((-(ba.readFloat()) * 150) + 150);
graphics.lineTo(_local2, globalvars.data.numx);
if (_local3 != false){
_local3 = false;
_local4 = (globalvars.data.numx - 150);
_local5 = ((140 * Math.abs((_local4 / 10))) - 60);
if (_local5 > 60){
_local5 = 60;
};
};
if (Math.round(needle1.rotation) > Math.round(_local5)){
needle1.rotation = (needle1.rotation - 0.01);
needle2.rotation = (needle2.rotation - 0.01);
} else {
if (Math.round(needle1.rotation) < Math.round(_local5)){
needle1.rotation = (needle1.rotation + 0.01);
needle2.rotation = (needle2.rotation + 0.01);
} else {
_local3 = true;
};
};
_local2++;
};
}
}
}//package HOTD_soundmixer_fla
Section 11
//globalvars (globalvars)
package {
public class globalvars {
public static var data:Object = {};
}
}//package