Section 1
//PropTween (com.greensock.core.PropTween)
package com.greensock.core {
public class PropTween {
public var start:Number;
public var name:String;
public var prevNode:PropTween;
public var change:Number;
public var target:Object;
public var priority:int;
public var property:String;
public var nextNode:PropTween;
public var isPlugin:Boolean;
public function PropTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Boolean, _arg7:PropTween=null, _arg8:int=0){
this.target = _arg1;
this.property = _arg2;
this.start = _arg3;
this.change = _arg4;
this.name = _arg5;
this.isPlugin = _arg6;
if (_arg7){
_arg7.prevNode = this;
this.nextNode = _arg7;
};
this.priority = _arg8;
}
}
}//package com.greensock.core
Section 2
//SimpleTimeline (com.greensock.core.SimpleTimeline)
package com.greensock.core {
public class SimpleTimeline extends TweenCore {
public var autoRemoveChildren:Boolean;
protected var _lastChild:TweenCore;
protected var _firstChild:TweenCore;
public function SimpleTimeline(_arg1:Object=null){
super(0, _arg1);
}
override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
var _local4:TweenCore;
var _local5:Number;
var _local6:TweenCore;
_local4 = _firstChild;
this.cachedTotalTime = _arg1;
this.cachedTime = _arg1;
while (_local4) {
_local6 = _local4.nextNode;
if (((_local4.active) || ((((((_arg1 >= _local4.cachedStartTime)) && (!(_local4.cachedPaused)))) && (!(_local4.gc)))))){
if (!_local4.cachedReversed){
_local4.renderTime(((_arg1 - _local4.cachedStartTime) * _local4.cachedTimeScale), _arg2, false);
} else {
_local5 = (_local4.cacheIsDirty) ? _local4.totalDuration : _local4.cachedTotalDuration;
_local4.renderTime((_local5 - ((_arg1 - _local4.cachedStartTime) * _local4.cachedTimeScale)), _arg2, false);
};
};
_local4 = _local6;
};
}
public function addChild(_arg1:TweenCore):void{
if (((!(_arg1.gc)) && (_arg1.timeline))){
_arg1.timeline.remove(_arg1, true);
};
_arg1.timeline = this;
if (_arg1.gc){
_arg1.setEnabled(true, true);
};
if (_firstChild){
_firstChild.prevNode = _arg1;
};
_arg1.nextNode = _firstChild;
_firstChild = _arg1;
_arg1.prevNode = null;
}
public function get rawTime():Number{
return (this.cachedTotalTime);
}
public function remove(_arg1:TweenCore, _arg2:Boolean=false):void{
if (_arg1.gc){
return;
};
if (!_arg2){
_arg1.setEnabled(false, true);
};
if (_arg1.nextNode){
_arg1.nextNode.prevNode = _arg1.prevNode;
} else {
if (_lastChild == _arg1){
_lastChild = _arg1.prevNode;
};
};
if (_arg1.prevNode){
_arg1.prevNode.nextNode = _arg1.nextNode;
} else {
if (_firstChild == _arg1){
_firstChild = _arg1.nextNode;
};
};
}
}
}//package com.greensock.core
Section 3
//TweenCore (com.greensock.core.TweenCore)
package com.greensock.core {
import com.greensock.*;
public class TweenCore {
public var initted:Boolean;
protected var _hasUpdate:Boolean;
public var active:Boolean;
protected var _delay:Number;
public var cachedReversed:Boolean;
public var nextNode:TweenCore;
public var cachedTime:Number;
protected var _rawPrevTime:Number;// = -1
public var vars:Object;
public var cachedTotalTime:Number;
public var data;
public var timeline:SimpleTimeline;
public var cachedStartTime:Number;
public var prevNode:TweenCore;
public var cachedDuration:Number;
public var gc:Boolean;
protected var _pauseTime:Number;
public var cacheIsDirty:Boolean;
public var cachedPaused:Boolean;
public var cachedTimeScale:Number;
public var cachedTotalDuration:Number;
public static const version:Number = 1.13;
protected static var _classInitted:Boolean;
public function TweenCore(_arg1:Number=0, _arg2:Object=null){
var _local3:SimpleTimeline;
_rawPrevTime = -1;
super();
this.vars = ((_arg2) || ({}));
this.cachedDuration = (this.cachedTotalDuration = ((_arg1) || (0)));
_delay = ((this.vars.delay) || (0));
this.cachedTimeScale = ((this.vars.timeScale) || (1));
this.active = Boolean((((((_arg1 == 0)) && ((_delay == 0)))) && (!((this.vars.immediateRender == false)))));
this.cachedTotalTime = (this.cachedTime = 0);
this.data = this.vars.data;
if (!_classInitted){
if (isNaN(TweenLite.rootFrame)){
TweenLite.initClass();
_classInitted = true;
} else {
return;
};
};
_local3 = ((this.vars.timeline is SimpleTimeline)) ? this.vars.timeline : (this.vars.useFrames) ? TweenLite.rootFramesTimeline : TweenLite.rootTimeline;
this.cachedStartTime = (_local3.cachedTotalTime + _delay);
_local3.addChild(this);
if (this.vars.reversed){
this.cachedReversed = true;
};
if (this.vars.paused){
this.paused = true;
};
}
public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
}
public function get delay():Number{
return (_delay);
}
public function get duration():Number{
return (this.cachedDuration);
}
public function set reversed(_arg1:Boolean):void{
if (_arg1 != this.cachedReversed){
this.cachedReversed = _arg1;
setTotalTime(this.cachedTotalTime, true);
};
}
public function set startTime(_arg1:Number):void{
var _local2:Boolean;
_local2 = Boolean(((!((this.timeline == null))) && (((!((_arg1 == this.cachedStartTime))) || (this.gc)))));
this.cachedStartTime = _arg1;
if (_local2){
this.timeline.addChild(this);
};
}
public function set delay(_arg1:Number):void{
this.startTime = (this.startTime + (_arg1 - _delay));
_delay = _arg1;
}
public function resume():void{
this.paused = false;
}
public function get paused():Boolean{
return (this.cachedPaused);
}
public function play():void{
this.reversed = false;
this.paused = false;
}
public function set duration(_arg1:Number):void{
this.cachedDuration = (this.cachedTotalDuration = _arg1);
setDirtyCache(false);
}
public function invalidate():void{
}
public function restart(_arg1:Boolean=false, _arg2:Boolean=true):void{
this.reversed = false;
this.paused = false;
this.setTotalTime((_arg1) ? -(_delay) : 0, _arg2);
}
public function complete(_arg1:Boolean=false, _arg2:Boolean=false):void{
if (!_arg1){
renderTime(this.cachedTotalDuration, _arg2, false);
return;
};
if (this.timeline.autoRemoveChildren){
this.setEnabled(false, false);
} else {
this.active = false;
};
if (!_arg2){
if (((((this.vars.onComplete) && ((this.cachedTotalTime == this.cachedTotalDuration)))) && (!(this.cachedReversed)))){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
} else {
if (((((this.cachedReversed) && ((this.cachedTotalTime == 0)))) && (this.vars.onReverseComplete))){
this.vars.onReverseComplete.apply(null, this.vars.onReverseCompleteParams);
};
};
};
}
public function get reversed():Boolean{
return (this.cachedReversed);
}
public function get totalTime():Number{
return (this.cachedTotalTime);
}
public function get startTime():Number{
return (this.cachedStartTime);
}
public function set currentTime(_arg1:Number):void{
setTotalTime(_arg1, false);
}
protected function setDirtyCache(_arg1:Boolean=true):void{
var _local2:TweenCore;
_local2 = (_arg1) ? this : this.timeline;
while (_local2) {
_local2.cacheIsDirty = true;
_local2 = _local2.timeline;
};
}
public function reverse(_arg1:Boolean=true):void{
this.reversed = true;
if (_arg1){
this.paused = false;
} else {
if (this.gc){
this.setEnabled(true, false);
};
};
}
public function set paused(_arg1:Boolean):void{
if (((!((_arg1 == this.cachedPaused))) && (this.timeline))){
if (_arg1){
_pauseTime = this.timeline.rawTime;
} else {
this.cachedStartTime = (this.cachedStartTime + (this.timeline.rawTime - _pauseTime));
_pauseTime = NaN;
setDirtyCache(false);
};
this.cachedPaused = _arg1;
this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration))));
};
if (((!(_arg1)) && (this.gc))){
this.setTotalTime(this.cachedTotalTime, false);
this.setEnabled(true, false);
};
}
public function kill():void{
setEnabled(false, false);
}
public function set totalTime(_arg1:Number):void{
setTotalTime(_arg1, false);
}
public function get currentTime():Number{
return (this.cachedTime);
}
protected function setTotalTime(_arg1:Number, _arg2:Boolean=false):void{
var _local3:Number;
var _local4:Number;
if (this.timeline){
_local3 = (((_pauseTime) || ((_pauseTime == 0)))) ? _pauseTime : this.timeline.cachedTotalTime;
if (this.cachedReversed){
_local4 = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration;
this.cachedStartTime = (_local3 - ((_local4 - _arg1) / this.cachedTimeScale));
} else {
this.cachedStartTime = (_local3 - (_arg1 / this.cachedTimeScale));
};
if (!this.timeline.cacheIsDirty){
setDirtyCache(false);
};
if (this.cachedTotalTime != _arg1){
renderTime(_arg1, _arg2, false);
};
};
}
public function pause():void{
this.paused = true;
}
public function set totalDuration(_arg1:Number):void{
this.duration = _arg1;
}
public function get totalDuration():Number{
return (this.cachedTotalDuration);
}
public function setEnabled(_arg1:Boolean, _arg2:Boolean=false):Boolean{
if (_arg1){
this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration))));
if (((!(_arg2)) && (this.gc))){
this.timeline.addChild(this);
};
} else {
this.active = false;
if (!_arg2){
this.timeline.remove(this, true);
};
};
this.gc = !(_arg1);
return (false);
}
}
}//package com.greensock.core
Section 4
//Linear (com.greensock.easing.Linear)
package com.greensock.easing {
public class Linear {
public static const power:uint = 0;
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package com.greensock.easing
Section 5
//FrameLabelPlugin (com.greensock.plugins.FrameLabelPlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
public class FrameLabelPlugin extends FramePlugin {
public static const API:Number = 1;
public function FrameLabelPlugin(){
this.propName = "frameLabel";
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:Array;
var _local5:String;
var _local6:int;
var _local7:int;
if ((!(_arg3.target) is MovieClip)){
return (false);
};
_target = (_arg1 as MovieClip);
this.frame = _target.currentFrame;
_local4 = _target.currentLabels;
_local5 = _arg2;
_local6 = _target.currentFrame;
_local7 = _local4.length;
while (_local7--) {
if (_local4[_local7].name == _local5){
_local6 = _local4[_local7].frame;
break;
};
};
if (this.frame != _local6){
addTween(this, "frame", this.frame, _local6, "frame");
};
return (true);
}
}
}//package com.greensock.plugins
Section 6
//FramePlugin (com.greensock.plugins.FramePlugin)
package com.greensock.plugins {
import flash.display.*;
import com.greensock.*;
public class FramePlugin extends TweenPlugin {
public var frame:int;
protected var _target:MovieClip;
public static const API:Number = 1;
public function FramePlugin(){
this.propName = "frame";
this.overwriteProps = ["frame", "frameLabel"];
this.round = true;
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((!((_arg1 is MovieClip))) || (isNaN(_arg2)))){
return (false);
};
_target = (_arg1 as MovieClip);
this.frame = _target.currentFrame;
addTween(this, "frame", this.frame, _arg2, "frame");
return (true);
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.gotoAndStop(this.frame);
}
}
}//package com.greensock.plugins
Section 7
//TweenPlugin (com.greensock.plugins.TweenPlugin)
package com.greensock.plugins {
import com.greensock.*;
import com.greensock.core.*;
public class TweenPlugin {
public var activeDisable:Boolean;
public var onEnable:Function;
public var round:Boolean;
public var onDisable:Function;
public var propName:String;
protected var _tweens:Array;
public var priority:int;// = 0
public var overwriteProps:Array;
public var onComplete:Function;
protected var _changeFactor:Number;// = 0
public static const VERSION:Number = 1.31;
public static const API:Number = 1;
public function TweenPlugin(){
priority = 0;
_tweens = [];
_changeFactor = 0;
super();
}
public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_changeFactor = _arg1;
}
protected function addTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4, _arg5:String=null):void{
var _local6:Number;
if (_arg4 != null){
_local6 = ((typeof(_arg4))=="number") ? (Number(_arg4) - _arg3) : Number(_arg4);
if (_local6 != 0){
_tweens[_tweens.length] = new PropTween(_arg1, _arg2, _arg3, _local6, ((_arg5) || (_arg2)), false);
};
};
}
protected function updateTweens(_arg1:Number):void{
var _local2:int;
var _local3:PropTween;
var _local4:Number;
_local2 = _tweens.length;
if (this.round){
while (_local2--) {
_local3 = _tweens[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
_local3.target[_local3.property] = ((_local4)>0) ? int((_local4 + 0.5)) : int((_local4 - 0.5));
};
} else {
while (_local2--) {
_local3 = _tweens[_local2];
_local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1));
};
};
}
public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
addTween(_arg1, this.propName, _arg1[this.propName], _arg2, this.propName);
return (true);
}
public function get changeFactor():Number{
return (_changeFactor);
}
public function killProps(_arg1:Object):void{
var _local2:int;
_local2 = this.overwriteProps.length;
while (_local2--) {
if ((this.overwriteProps[_local2] in _arg1)){
this.overwriteProps.splice(_local2, 1);
};
};
_local2 = _tweens.length;
while (_local2--) {
if ((PropTween(_tweens[_local2]).name in _arg1)){
_tweens.splice(_local2, 1);
};
};
}
public static function activate(_arg1:Array):Boolean{
var _local2:int;
var _local3:Object;
TweenLite.onPluginEvent = TweenPlugin.onTweenEvent;
_local2 = _arg1.length;
while (_local2--) {
if (_arg1[_local2].hasOwnProperty("API")){
_local3 = new ((_arg1[_local2] as Class));
TweenLite.plugins[_local3.propName] = _arg1[_local2];
};
};
return (true);
}
private static function onTweenEvent(_arg1:String, _arg2:TweenLite):Boolean{
var _local3:PropTween;
var _local4:Boolean;
var _local5:Array;
var _local6:int;
_local3 = _arg2.cachedPT1;
if (_arg1 == "onInit"){
_local5 = [];
while (_local3) {
_local5[_local5.length] = _local3;
_local3 = _local3.nextNode;
};
_local5.sortOn("priority", (Array.NUMERIC | Array.DESCENDING));
_local6 = _local5.length;
while (_local6--) {
PropTween(_local5[_local6]).nextNode = _local5[(_local6 + 1)];
PropTween(_local5[_local6]).prevNode = _local5[(_local6 - 1)];
};
_arg2.cachedPT1 = _local5[0];
} else {
while (_local3) {
if (((_local3.isPlugin) && (_local3.target[_arg1]))){
if (_local3.target.activeDisable){
_local4 = true;
};
var _local7 = _local3.target;
_local7[_arg1]();
};
_local3 = _local3.nextNode;
};
};
return (_local4);
}
}
}//package com.greensock.plugins
Section 8
//TweenLite (com.greensock.TweenLite)
package com.greensock {
import flash.utils.*;
import flash.display.*;
import com.greensock.core.*;
import flash.events.*;
import com.greensock.plugins.*;
public class TweenLite extends TweenCore {
public var target:Object;
protected var _overwrite:uint;
public var ratio:Number;// = 0
protected var _notifyPluginsOfEnabled:Boolean;
protected var _hasPlugins:Boolean;
public var cachedPT1:PropTween;
protected var _overwrittenProps:Object;
public var propTweenLookup:Object;
protected var _ease:Function;
public static const version:Number = 11.133;
public static var rootTimeline:SimpleTimeline;
public static var fastEaseLookup:Dictionary = new Dictionary(false);
public static var onPluginEvent:Function;
public static var rootFramesTimeline:SimpleTimeline;
public static var defaultEase:Function = TweenLite.easeOut;
public static var plugins:Object = {};
public static var masterList:Dictionary = new Dictionary(false);
public static var overwriteManager:Object;
public static var rootFrame:Number;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
private static var _shape:Shape = new Shape();
protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, roundProps:1, onStart:1, onStartParams:1, onReverseComplete:1, onReverseCompleteParams:1, onRepeat:1, onRepeatParams:1, proxiedEase:1, easeParams:1, yoyo:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, onReverseCompleteListener:1, onRepeatListener:1, orientToBezier:1, timeScale:1, immediateRender:1, repeat:1, repeatDelay:1, timeline:1, data:1, paused:1};
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
var _local4:Array;
var _local5:TweenLite;
ratio = 0;
super(_arg2, _arg3);
this.target = _arg1;
if ((((this.target is TweenCore)) && (("timeScale" in this.vars)))){
this.cachedTimeScale = 1;
};
propTweenLookup = {};
_ease = defaultEase;
_overwrite = (((!((Number(_arg3.overwrite) > -1))) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
_local4 = masterList[_arg1];
if (!_local4){
masterList[_arg1] = [this];
} else {
if (_overwrite == 1){
for each (_local5 in _local4) {
if (!_local5.gc){
_local5.setEnabled(false, false);
};
};
masterList[_arg1] = [this];
} else {
_local4[_local4.length] = this;
};
};
if (((this.active) || (this.vars.immediateRender))){
renderTime(0, false, true);
};
}
override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
var _local4:Boolean;
var _local5:Number;
var _local6:PropTween;
_local5 = this.cachedTime;
if (_arg1 >= this.cachedDuration){
this.cachedTotalTime = (this.cachedTime = this.cachedDuration);
this.ratio = 1;
_local4 = true;
if (this.cachedDuration == 0){
if ((((((_arg1 == 0)) || ((_rawPrevTime < 0)))) && (!((_rawPrevTime == _arg1))))){
_arg3 = true;
};
_rawPrevTime = _arg1;
};
} else {
if (_arg1 <= 0){
this.cachedTotalTime = (this.cachedTime = (this.ratio = 0));
if (_arg1 < 0){
this.active = false;
if (this.cachedDuration == 0){
if (_rawPrevTime > 0){
_arg3 = true;
_local4 = true;
};
_rawPrevTime = _arg1;
};
};
if (((this.cachedReversed) && (!((_local5 == 0))))){
_local4 = true;
};
} else {
this.cachedTotalTime = (this.cachedTime = _arg1);
this.ratio = _ease(_arg1, 0, 1, this.cachedDuration);
};
};
if ((((this.cachedTime == _local5)) && (!(_arg3)))){
return;
};
if (!this.initted){
init();
if (((!(_local4)) && (this.cachedTime))){
this.ratio = _ease(this.cachedTime, 0, 1, this.cachedDuration);
};
};
if (((!(this.active)) && (!(this.cachedPaused)))){
this.active = true;
};
if ((((((((_local5 == 0)) && (this.vars.onStart))) && (!((this.cachedTime == 0))))) && (!(_arg2)))){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
_local6 = this.cachedPT1;
while (_local6) {
_local6.target[_local6.property] = (_local6.start + (this.ratio * _local6.change));
_local6 = _local6.nextNode;
};
if (((_hasUpdate) && (!(_arg2)))){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local4){
if (((_hasPlugins) && (this.cachedPT1))){
onPluginEvent("onComplete", this);
};
complete(true, _arg2);
};
}
protected function init():void{
var _local1:String;
var _local2:int;
var _local3:*;
var _local4:Boolean;
var _local5:Array;
var _local6:PropTween;
if (typeof(this.vars.ease) == "function"){
_ease = this.vars.ease;
};
if (this.vars.easeParams){
this.vars.proxiedEase = _ease;
_ease = easeProxy;
};
this.cachedPT1 = null;
this.propTweenLookup = {};
for (_local1 in this.vars) {
if ((((_local1 in _reservedProps)) && (!((((_local1 == "timeScale")) && ((this.target is TweenCore))))))){
} else {
if ((((_local1 in plugins)) && (new ((plugins[_local1] as Class)).onInitTween(this.target, this.vars[_local1], this)))){
this.cachedPT1 = new PropTween(_local3, "changeFactor", 0, 1, ((_local3.overwriteProps.length)==1) ? _local3.overwriteProps[0] : "_MULTIPLE_", true, this.cachedPT1);
if (this.cachedPT1.name == "_MULTIPLE_"){
_local2 = _local3.overwriteProps.length;
while (_local2--) {
this.propTweenLookup[_local3.overwriteProps[_local2]] = this.cachedPT1;
};
} else {
this.propTweenLookup[this.cachedPT1.name] = this.cachedPT1;
};
if (_local3.priority){
this.cachedPT1.priority = _local3.priority;
_local4 = true;
};
if (((_local3.onDisable) || (_local3.onEnable))){
_notifyPluginsOfEnabled = true;
};
_hasPlugins = true;
} else {
this.cachedPT1 = new PropTween(this.target, _local1, Number(this.target[_local1]), ((typeof(this.vars[_local1]))=="number") ? (Number(this.vars[_local1]) - this.target[_local1]) : Number(this.vars[_local1]), _local1, false, this.cachedPT1);
this.propTweenLookup[_local1] = this.cachedPT1;
};
};
};
if (_local4){
onPluginEvent("onInit", this);
};
if (this.vars.runBackwards){
_local6 = this.cachedPT1;
while (_local6) {
_local6.start = (_local6.start + _local6.change);
_local6.change = -(_local6.change);
_local6 = _local6.nextNode;
};
};
_hasUpdate = Boolean(!((this.vars.onUpdate == null)));
if (_overwrittenProps){
killVars(_overwrittenProps);
if (this.cachedPT1 == null){
this.setEnabled(false, false);
};
};
if ((((((((_overwrite > 1)) && (this.cachedPT1))) && (masterList[this.target]))) && ((_local5.length > 1)))){
if (overwriteManager.manageOverwrites(this, this.propTweenLookup, _local5, _overwrite)){
init();
};
};
this.initted = true;
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
override public function invalidate():void{
if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){
onPluginEvent("onDisable", this);
};
this.cachedPT1 = null;
_overwrittenProps = null;
_hasUpdate = (this.initted = (this.active = (_notifyPluginsOfEnabled = false)));
this.propTweenLookup = {};
}
public function killVars(_arg1:Object, _arg2:Boolean=true):Boolean{
var _local3:String;
var _local4:PropTween;
var _local5:Boolean;
if (_overwrittenProps == null){
_overwrittenProps = {};
};
for (_local3 in _arg1) {
if ((_local3 in propTweenLookup)){
_local4 = propTweenLookup[_local3];
if (((_local4.isPlugin) && ((_local4.name == "_MULTIPLE_")))){
_local4.target.killProps(_arg1);
if (_local4.target.overwriteProps.length == 0){
_local4.name = "";
};
};
if (_local4.name != "_MULTIPLE_"){
if (_local4.nextNode){
_local4.nextNode.prevNode = _local4.prevNode;
};
if (_local4.prevNode){
_local4.prevNode.nextNode = _local4.nextNode;
} else {
if (this.cachedPT1 == _local4){
this.cachedPT1 = _local4.nextNode;
};
};
if (((_local4.isPlugin) && (_local4.target.onDisable))){
_local4.target.onDisable();
if (_local4.target.activeDisable){
_local5 = true;
};
};
delete propTweenLookup[_local3];
};
};
if (_arg2){
_overwrittenProps[_local3] = 1;
};
};
return (_local5);
}
override public function setEnabled(_arg1:Boolean, _arg2:Boolean=false):Boolean{
var _local3:Array;
if (_arg1){
_local3 = TweenLite.masterList[this.target];
if (!_local3){
TweenLite.masterList[this.target] = [this];
} else {
_local3[_local3.length] = this;
};
};
super.setEnabled(_arg1, _arg2);
if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){
return (onPluginEvent((_arg1) ? "onEnable" : "onDisable", this));
};
return (false);
}
public static function initClass():void{
rootFrame = 0;
rootTimeline = new SimpleTimeline(null);
rootFramesTimeline = new SimpleTimeline(null);
rootTimeline.cachedStartTime = (getTimer() * 0.001);
rootFramesTimeline.cachedStartTime = rootFrame;
rootTimeline.autoRemoveChildren = true;
rootFramesTimeline.autoRemoveChildren = true;
_shape.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
}
public static function killTweensOf(_arg1:Object, _arg2:Boolean=false):void{
var _local3:Array;
var _local4:int;
if ((_arg1 in masterList)){
_local3 = masterList[_arg1];
_local4 = _local3.length;
while (_local4--) {
if (!TweenLite(_local3[_local4]).gc){
if (_arg2){
TweenLite(_local3[_local4]).complete(false, false);
} else {
TweenLite(_local3[_local4]).setEnabled(false, false);
};
};
};
delete masterList[_arg1];
};
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
if (!("immediateRender" in _arg3)){
_arg3.immediateRender = true;
};
return (new TweenLite(_arg1, _arg2, _arg3));
}
protected static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (1 - (_arg1 / _arg4));
return ((1 - (_arg1 * _arg1)));
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, immediateRender:false, useFrames:_arg4, overwrite:0}));
}
protected static function updateAll(_arg1:Event=null):void{
var _local2:Dictionary;
var _local3:Object;
var _local4:Array;
var _local5:int;
rootTimeline.renderTime((((getTimer() * 0.001) - rootTimeline.cachedStartTime) * rootTimeline.cachedTimeScale), false, false);
rootFrame++;
rootFramesTimeline.renderTime(((rootFrame - rootFramesTimeline.cachedStartTime) * rootFramesTimeline.cachedTimeScale), false, false);
if (!(rootFrame % 60)){
_local2 = masterList;
for (_local3 in _local2) {
_local4 = _local2[_local3];
_local5 = _local4.length;
while (_local5--) {
if (TweenLite(_local4[_local5]).gc){
_local4.splice(_local5, 1);
};
};
if (_local4.length == 0){
delete _local2[_local3];
};
};
};
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package com.greensock
Section 9
//Broccoli (com.totaldramaonline.games.splatoberfest.items.Broccoli)
package com.totaldramaonline.games.splatoberfest.items {
import com.totaldramaonline.games.splatoberfest.*;
public class Broccoli extends Item {
public function Broccoli(){
weight = 2;
disablePlayer = true;
}
}
}//package com.totaldramaonline.games.splatoberfest.items
Section 10
//LargeMeat (com.totaldramaonline.games.splatoberfest.items.LargeMeat)
package com.totaldramaonline.games.splatoberfest.items {
import com.totaldramaonline.games.splatoberfest.*;
public class LargeMeat extends Item {
public function LargeMeat(){
weight = 2;
pointValue = 100;
}
}
}//package com.totaldramaonline.games.splatoberfest.items
Section 11
//MediumMeat (com.totaldramaonline.games.splatoberfest.items.MediumMeat)
package com.totaldramaonline.games.splatoberfest.items {
import com.totaldramaonline.games.splatoberfest.*;
public class MediumMeat extends Item {
public function MediumMeat(){
weight = 2.5;
pointValue = 60;
}
}
}//package com.totaldramaonline.games.splatoberfest.items
Section 12
//PointMultiplier (com.totaldramaonline.games.splatoberfest.items.PointMultiplier)
package com.totaldramaonline.games.splatoberfest.items {
import com.totaldramaonline.games.splatoberfest.*;
import flash.text.*;
public class PointMultiplier extends Item {
public var pointAmount:TextField;
public function PointMultiplier(){
weight = 2;
pointValue = 0;
pointMultiplier = 2;
pointAmount.text = String((pointMultiplier + "x"));
}
}
}//package com.totaldramaonline.games.splatoberfest.items
Section 13
//SmallMeat (com.totaldramaonline.games.splatoberfest.items.SmallMeat)
package com.totaldramaonline.games.splatoberfest.items {
import com.totaldramaonline.games.splatoberfest.*;
public class SmallMeat extends Item {
public function SmallMeat(){
weight = 3;
pointValue = 30;
}
}
}//package com.totaldramaonline.games.splatoberfest.items
Section 14
//BonusLevel (com.totaldramaonline.games.splatoberfest.levels.BonusLevel)
package com.totaldramaonline.games.splatoberfest.levels {
import com.zincroe.games.*;
import com.totaldramaonline.games.splatoberfest.*;
public class BonusLevel extends Level {
public function BonusLevel(){
totalTime = 20000;
pointsNeeded = 1000000000;
nozzleMoveSpeed = 0.1;
itemProbability = ["items.LargeMeat", "items.PointMultiplier", "items.MediumMeat", "items.SmallMeat"];
}
override protected function moveNozzle():void{
var _local1:GameProperties;
super.moveNozzle();
_local1 = GameProperties.getInstance();
_local1.sound.play("BonusNozzle");
}
}
}//package com.totaldramaonline.games.splatoberfest.levels
Section 15
//Level1 (com.totaldramaonline.games.splatoberfest.levels.Level1)
package com.totaldramaonline.games.splatoberfest.levels {
import com.zincroe.games.*;
import com.zincroe.media.*;
import com.totaldramaonline.games.splatoberfest.*;
public class Level1 extends Level {
public function Level1(){
totalTime = 90000;
pointsNeeded = 1000;
nozzleMoveSpeed = 0.5;
itemProbability = ["items.PointMultiplier", "items.LargeMeat", "items.MediumMeat", "items.SmallMeat", "items.MediumMeat", "items.SmallMeat", "items.Bug", "items.Bug", "items.Fly", "items.Bug", "items.Fly"];
}
override protected function moveNozzle():void{
var _local1:GameProperties;
var _local2:SimpleSoundOptions;
super.moveNozzle();
_local1 = GameProperties.getInstance();
_local2 = new SimpleSoundOptions();
_local2.volume = 0.6;
_local1.sound.play("Nozzle1", _local2);
}
}
}//package com.totaldramaonline.games.splatoberfest.levels
Section 16
//Level2 (com.totaldramaonline.games.splatoberfest.levels.Level2)
package com.totaldramaonline.games.splatoberfest.levels {
import com.zincroe.games.*;
import com.zincroe.media.*;
import com.totaldramaonline.games.splatoberfest.*;
public class Level2 extends Level {
public function Level2(){
totalTime = 60000;
pointsNeeded = 1000;
nozzleMoveSpeed = 0.3;
itemProbability = ["items.LargeMeat", "items.PointMultiplier", "items.MediumMeat", "items.SmallMeat", "items.MediumMeat", "items.SmallMeat", "items.MediumMeat", "items.SmallMeat", "items.Bug", "items.Bandaid", "items.Fly", "items.Bandaid", "items.Fly", "items.Bandaid", "items.Bug", "items.Bug"];
}
override protected function moveNozzle():void{
var _local1:GameProperties;
var _local2:SimpleSoundOptions;
super.moveNozzle();
_local1 = GameProperties.getInstance();
_local2 = new SimpleSoundOptions();
_local2.volume = 0.6;
_local1.sound.play("Nozzle2", _local2);
}
}
}//package com.totaldramaonline.games.splatoberfest.levels
Section 17
//Level3 (com.totaldramaonline.games.splatoberfest.levels.Level3)
package com.totaldramaonline.games.splatoberfest.levels {
import com.zincroe.games.*;
import com.zincroe.media.*;
import com.totaldramaonline.games.splatoberfest.*;
public class Level3 extends Level {
public function Level3(){
totalTime = 45000;
nozzleMoveSpeed = 0.2;
pointsNeeded = 1000;
itemProbability = ["items.LargeMeat", "items.LargeMeat", "items.PointMultiplier", "items.MediumMeat", "items.SmallMeat", "items.MediumMeat", "items.SmallMeat", "items.MediumMeat", "items.SmallMeat", "items.Spider", "items.Fly", "items.Rat", "items.Bug", "items.Fly", "items.Rat", "items.Bandaid", "items.Spider", "items.Rat", "items.Fly", "items.Bandaid", "items.Bug"];
}
override protected function moveNozzle():void{
var _local1:GameProperties;
var _local2:SimpleSoundOptions;
super.moveNozzle();
_local1 = GameProperties.getInstance();
_local2 = new SimpleSoundOptions();
_local2.volume = 0.6;
_local1.sound.play("Nozzle3", _local2);
}
}
}//package com.totaldramaonline.games.splatoberfest.levels
Section 18
//Level4 (com.totaldramaonline.games.splatoberfest.levels.Level4)
package com.totaldramaonline.games.splatoberfest.levels {
import com.zincroe.games.*;
import com.zincroe.media.*;
import com.totaldramaonline.games.splatoberfest.*;
public class Level4 extends Level {
public function Level4(){
totalTime = 30000;
pointsNeeded = 1000;
nozzleMoveSpeed = 0.1;
itemProbability = ["items.LargeMeat", "items.LargeMeat", "items.PointMultiplier", "items.MediumMeat", "items.SmallMeat", "items.MediumMeat", "items.SmallMeat", "items.MediumMeat", "items.SmallMeat", "items.SmallMeat", "items.Bug", "items.Fly", "items.Rat", "items.Fly", "items.Bandaid", "items.Spider", "items.Bug", "items.Fly", "items.Rat", "items.Rat", "items.Bandaid", "items.Fly", "items.Spider", "items.Bug", "items.Rat", "items.Spider", "items.Bandaid", "items.Fly"];
}
override protected function moveNozzle():void{
var _local1:GameProperties;
var _local2:SimpleSoundOptions;
super.moveNozzle();
_local1 = GameProperties.getInstance();
_local2 = new SimpleSoundOptions();
_local2.volume = 0.6;
_local1.sound.play("Nozzle4", _local2);
}
}
}//package com.totaldramaonline.games.splatoberfest.levels
Section 19
//ARAppBase (com.totaldramaonline.games.splatoberfest.ui.webcam.ARAppBase)
package com.totaldramaonline.games.splatoberfest.ui.webcam {
import flash.display.*;
import org.libspark.flartoolkit.core.param.*;
import org.libspark.flartoolkit.core.*;
import org.libspark.flartoolkit.core.raster.rgb.*;
import flash.events.*;
import flash.media.*;
import flash.net.*;
import org.libspark.flartoolkit.detector.*;
public class ARAppBase extends Sprite {
protected var _capture:Bitmap;
public var _webcam:Camera;
protected var _detector:FLARSingleMarkerDetector;
private var _loader:URLLoader;
private var _codeWidth:int;
private var _codeFile:String;
public var _video:Video;
private var _height:int;
protected var _param:FLARParam;
protected var _raster:FLARRgbRaster_BitmapData;
protected var _code:FLARCode;
private var _width:int;
private var _cameraFile:String;
protected function init(_arg1:String, _arg2:String, _arg3:int=320, _arg4:int=240, _arg5:int=80):void{
this._cameraFile = _arg1;
this._width = _arg3;
this._height = _arg4;
this._codeFile = _arg2;
this._codeWidth = _arg5;
this._loader = new URLLoader();
this._loader.dataFormat = URLLoaderDataFormat.BINARY;
this._loader.addEventListener(Event.COMPLETE, this._onLoadParam);
this._loader.addEventListener(IOErrorEvent.IO_ERROR, this.dispatchEvent);
this._loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.dispatchEvent);
this._loader.load(new URLRequest(this._cameraFile));
}
private function _onLoadParam(_arg1:Event):void{
this._loader.removeEventListener(Event.COMPLETE, this._onLoadParam);
this._param = new FLARParam();
this._param.loadARParam(this._loader.data);
this._param.changeScreenSize(this._width, this._height);
this._loader.dataFormat = URLLoaderDataFormat.TEXT;
this._loader.addEventListener(Event.COMPLETE, this._onLoadCode);
this._loader.load(new URLRequest(this._codeFile));
}
private function _onLoadCode(_arg1:Event):void{
this._code = new FLARCode(16, 16);
this._code.loadARPatt(this._loader.data);
this._loader.removeEventListener(Event.COMPLETE, this._onLoadCode);
this._loader.removeEventListener(IOErrorEvent.IO_ERROR, this.dispatchEvent);
this._loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, this.dispatchEvent);
this._loader = null;
this._webcam = Camera.getCamera();
if (!this._webcam){
};
this._webcam.setMode(320, 240, 30);
this._video = new Video(this._width, this._height);
this._video.attachCamera(this._webcam);
this._capture = new Bitmap(new BitmapData(this._width, this._height, true, 0), PixelSnapping.AUTO, true);
this._raster = new FLARRgbRaster_BitmapData(this._capture.bitmapData);
this._detector = new FLARSingleMarkerDetector(this._param, this._code, this._codeWidth);
this._detector.setContinueMode(true);
this.onInit();
}
protected function onInit():void{
}
}
}//package com.totaldramaonline.games.splatoberfest.ui.webcam
Section 20
//Catch (com.totaldramaonline.games.splatoberfest.ui.webcam.Catch)
package com.totaldramaonline.games.splatoberfest.ui.webcam {
import flash.geom.*;
import org.libspark.flartoolkit.core.transmat.*;
import flash.events.*;
import flash.media.*;
public class Catch extends ARAppBase {
private var __height:Number;
protected var _resultMat:FLARTransMatResult;
private var _baseNode:SpriteBaseNode;
private var __width:Number;
public static const CAMERA_DENIED:String = "camera_denied";
public static const CAMERA_ALLOWED:String = "camera_allowed";
public function Catch(_arg1:Number, _arg2:Number){
_resultMat = new FLARTransMatResult();
super();
__width = _arg1;
__height = _arg2;
this.init("Data/camera_para.dat", "Data/robot.pat");
}
protected function checkCameraPermission(_arg1:StatusEvent):void{
removeEventListener(StatusEvent.STATUS, checkCameraPermission);
switch (_arg1.code){
case "Camera.Unmuted":
dispatchEvent(new Event(Catch.CAMERA_ALLOWED));
break;
case "Camera.Muted":
dispatchEvent(new Event(Catch.CAMERA_DENIED));
break;
};
}
public function switchCamera(_arg1:String):void{
_webcam = Camera.getCamera(_arg1);
_video.attachCamera(_webcam);
}
override protected function onInit():void{
super.onInit();
this._capture.height = __height;
this._capture.width = __width;
this._capture.scaleX = -((this._capture.width / 320));
this._capture.x = this._capture.width;
this._capture.y = 91;
addChild(this._capture);
this._baseNode = new SpriteBaseNode();
this.addEventListener(Event.ENTER_FRAME, this._update, false, 0, true);
_webcam.addEventListener(StatusEvent.STATUS, checkCameraPermission, false, 0, true);
}
public function getPosition():Point{
var _local1:Number;
var _local2:Number;
_local1 = (((this._baseNode.x / 320) * this._capture.width) + (this._capture.width / 2));
_local2 = (((this._baseNode.y / 240) * this._capture.height) + (this._capture.height / 2));
if (this._baseNode.visible){
return (new Point(_local1, (_local2 + 91)));
};
return (null);
}
private function _update(_arg1:Event):void{
var detected:Boolean;
var e = _arg1;
this._capture.bitmapData.draw(this._video);
detected = false;
try {
detected = ((this._detector.detectMarkerLite(this._raster, 80)) && ((this._detector.getConfidence() > 0.8)));
} catch(e:Error) {
};
if (detected){
this._detector.getTransformMatrix(this._resultMat);
this._baseNode.setTransformMatrix(this._resultMat);
this._baseNode.visible = true;
} else {
this._baseNode.visible = false;
};
}
}
}//package com.totaldramaonline.games.splatoberfest.ui.webcam
Section 21
//SpriteBaseNode (com.totaldramaonline.games.splatoberfest.ui.webcam.SpriteBaseNode)
package com.totaldramaonline.games.splatoberfest.ui.webcam {
import flash.display.*;
import org.libspark.flartoolkit.core.transmat.*;
public class SpriteBaseNode extends Sprite {
public var z:Number;
public function setTransformMatrix(_arg1:FLARTransMatResult):void{
var _local2:Number;
_local2 = ((40 * 8.7) / (8.7 + _arg1.m23));
this.x = (-(_arg1.m03) * _local2);
this.y = (_arg1.m13 * _local2);
z = _arg1.m23;
this.rotation = (-(_arg1.m10) * 100);
}
}
}//package com.totaldramaonline.games.splatoberfest.ui.webcam
Section 22
//AbstractPlayer (com.totaldramaonline.games.splatoberfest.ui.AbstractPlayer)
package com.totaldramaonline.games.splatoberfest.ui {
import flash.display.*;
import flash.geom.*;
public class AbstractPlayer extends Sprite {
protected var __initCallback:Function;
public function AbstractPlayer(_arg1:Function){
__initCallback = _arg1;
}
public function getPosition():Point{
return (new Point());
}
public function update():void{
}
}
}//package com.totaldramaonline.games.splatoberfest.ui
Section 23
//MousePlayer (com.totaldramaonline.games.splatoberfest.ui.MousePlayer)
package com.totaldramaonline.games.splatoberfest.ui {
import com.greensock.*;
import flash.geom.*;
public class MousePlayer extends AbstractPlayer {
private var __currentPosition:Point;
public function MousePlayer(_arg1:Function){
super(_arg1);
__currentPosition = new Point(0, 0);
_arg1(true);
}
override public function getPosition():Point{
return (__currentPosition);
}
override public function update():void{
TweenLite.to(__currentPosition, 0.5, {x:mouseX, y:mouseY});
}
}
}//package com.totaldramaonline.games.splatoberfest.ui
Section 24
//WebcamPlayer (com.totaldramaonline.games.splatoberfest.ui.WebcamPlayer)
package com.totaldramaonline.games.splatoberfest.ui {
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import com.totaldramaonline.games.splatoberfest.ui.webcam.*;
public class WebcamPlayer extends AbstractPlayer {
private var __catch:Catch;
private var __currentPosition:Point;
public function WebcamPlayer(_arg1){
super(_arg1);
__currentPosition = new Point(0, 0);
setupCameraDetection();
__catch = new Catch(660, 495);
__catch.addEventListener(Catch.CAMERA_ALLOWED, cameraAllowed, false, 0, true);
__catch.addEventListener(Catch.CAMERA_DENIED, cameraDenied, false, 0, true);
addChild(__catch);
}
protected function cameraDenied(_arg1:Event):void{
__catch.removeEventListener(Catch.CAMERA_ALLOWED, cameraAllowed);
__catch.removeEventListener(Catch.CAMERA_DENIED, cameraDenied);
__initCallback(false, "Feed.DENIED");
}
public function checkVideoFeed():Boolean{
var _local1:BitmapData;
var _local2:Boolean;
_local1 = new BitmapData(this.width, this.height);
_local1.draw(this);
_local2 = !((_local1.getPixel(100, 108) == 0xFF00FF));
removeChildAt(0);
return (_local2);
}
override public function getPosition():Point{
return (__currentPosition);
}
public function setupCameraDetection(_arg1:String=null):void{
var _local2:BitmapData;
var _local3:Bitmap;
if (_arg1){
__catch.switchCamera(_arg1);
};
_local2 = new BitmapData(1, 1, false);
_local2.setPixel(0, 0, 0xFF00FF);
_local3 = new Bitmap(_local2);
_local3.x = 100;
_local3.y = 108;
addChildAt(_local3, 0);
}
protected function cameraAllowed(_arg1:Event):void{
var _local2:Timer;
__catch.removeEventListener(Catch.CAMERA_ALLOWED, cameraAllowed);
__catch.removeEventListener(Catch.CAMERA_DENIED, cameraDenied);
_local2 = new Timer(1000, 1);
_local2.addEventListener(TimerEvent.TIMER, checkFeed, false, 0, true);
_local2.start();
}
override public function update():void{
__currentPosition = __catch.getPosition();
}
protected function checkFeed(_arg1:TimerEvent):void{
_arg1.currentTarget.stop();
_arg1.currentTarget.removeEventListener(TimerEvent.TIMER, checkFeed);
if (checkVideoFeed()){
__initCallback(true);
} else {
__initCallback(false, "Feed.NONE");
};
}
}
}//package com.totaldramaonline.games.splatoberfest.ui
Section 25
//GameStatus (com.totaldramaonline.games.splatoberfest.GameStatus)
package com.totaldramaonline.games.splatoberfest {
import com.zincroe.games.*;
import flash.utils.*;
import flash.display.*;
import com.greensock.*;
import flash.events.*;
import flash.text.*;
import com.zincroe.display.*;
public class GameStatus extends MovieClip {
private var __timeBar:TimeBar;
public var multiplierIndicator:MovieClip;
private var __totalTime:Number;
private var __timeColorDuration:int;
public var scoreField:TextField;
private var __score:Number;// = 0
private var __timeColor:String;
private var __currentLevelTally:Number;
private var __timeRemaining:Number;
public var meater:MovieClip;
public var timeRemainingField:TextField;
private var __active:Boolean;
public static const TIME_DONE:String = "time_done";
public function GameStatus(){
__score = 0;
super();
__timeBar = new TimeBar();
__timeBar.addEventListener(TimeBar.TIME_DONE, timeDone, false, 0, true);
meater.infinityMeater.visible = false;
meater.loadedBar.scaleX = 0;
multiplierIndicator.scaleX = (multiplierIndicator.scaleY = 0);
__timeColor = "#300C03";
__timeColorDuration = 0;
}
protected function tallyLevelScore(_arg1:TimerEvent):void{
_arg1.currentTarget.removeEventListener(TimerEvent.TIMER, tallyLevelScore);
TweenLite.to(meater.loadedBar, 0.2, {scaleX:0});
TweenLite.to(this, 0.5, {score:__currentLevelTally, timeRemaining:0, onUpdate:updateDisplays});
}
public function multiplierIndicatorState(_arg1:Boolean):void{
if (_arg1){
TweenLite.to(multiplierIndicator, 0.2, {scaleX:1, scaleY:1});
} else {
TweenLite.to(multiplierIndicator, 0.2, {scaleX:0, scaleY:0});
};
}
public function winLevel(_arg1:Number):void{
var _local2:Timer;
pause();
__currentLevelTally = _arg1;
TweenLite.to(meater.loadedBar, 0.2, {scaleX:1});
_local2 = new Timer(1000, 1);
_local2.addEventListener(TimerEvent.TIMER, tallyLevelScore, false, 0, true);
_local2.start();
}
public function set score(_arg1:Number):void{
__score = _arg1;
}
public function get totalTime():Number{
return (__totalTime);
}
protected function updateScoreDisplay():void{
scoreField.text = String(Math.round(score));
}
public function updateScore(_arg1:Number, _arg2:Number=0.5):void{
TweenLite.to(this, _arg2, {score:_arg1, onUpdate:updateScoreDisplay});
}
public function start():void{
__timeBar.timeTotalValue = totalTime;
__active = true;
__timeBar.start();
multiplierIndicator.scaleX = (multiplierIndicator.scaleY = 0);
__timeColor = "#300C03";
}
public function loseLevel():void{
pause();
}
public function reset():void{
updateScore(0, 0);
meater.loadedBar.scaleX = 0;
timeRemainingField.text = "0";
}
public function set timeRemaining(_arg1:Number):void{
__timeRemaining = _arg1;
}
public function set totalTime(_arg1:Number):void{
__totalTime = _arg1;
}
public function get score():Number{
return (__score);
}
protected function updateTimeDisplay():void{
timeRemainingField.text = String(Math.round(timeRemaining));
}
public function get timeRemaining():Number{
return (__timeRemaining);
}
public function bonusLevel():void{
meater.infinityMeater.visible = true;
meater.loadedBar.visible = false;
}
protected function updateDisplays():void{
updateTimeDisplay();
updateScoreDisplay();
}
public function endBonusLevel():void{
meater.infinityMeater.visible = false;
meater.loadedBar.visible = true;
updateMeater(0);
}
public function update():void{
var _local1:GameProperties;
if (__active){
__timeBar.update();
timeRemaining = Math.round((__timeBar.timeRemainingValue / 1000));
timeRemainingField.htmlText = (((("<font color='" + __timeColor) + "'>") + String(timeRemaining)) + "</font>");
if (timeRemaining <= 10){
_local1 = GameProperties.getInstance();
if (!_local1.sound.isPlaying("Tick")){
_local1.sound.play("Tick");
};
if (__timeColorDuration < 3){
__timeColorDuration++;
} else {
__timeColorDuration = 0;
if (__timeColor == "#300C03"){
__timeColor = "#D42B01";
} else {
__timeColor = "#300C03";
};
};
};
};
}
public function updateMeater(_arg1:Number):void{
if (__active){
TweenLite.to(meater.loadedBar, 0.2, {scaleX:_arg1});
};
}
protected function timeDone(_arg1:Event):void{
dispatchEvent(new Event(GameStatus.TIME_DONE));
pause();
}
public function pause():void{
__active = false;
}
}
}//package com.totaldramaonline.games.splatoberfest
Section 26
//Item (com.totaldramaonline.games.splatoberfest.Item)
package com.totaldramaonline.games.splatoberfest {
import flash.display.*;
public class Item extends MovieClip {
private var __disablePlayer:Boolean;// = false
private var __weight:Number;
private var __pointMultiplier:Number;
private var __pointValue:Number;// = 0
public function Item(){
__pointValue = 0;
__disablePlayer = false;
super();
}
public function get pointMultiplier():Number{
return (__pointMultiplier);
}
public function get weight():Number{
return (__weight);
}
public function set pointValue(_arg1:Number):void{
__pointValue = _arg1;
}
public function get pointValue():Number{
return (__pointValue);
}
public function update():void{
var _local1:uint;
if (this.parent){
_local1 = Math.round((this.y + weight));
this.y = _local1;
};
}
public function set disablePlayer(_arg1:Boolean):void{
__disablePlayer = _arg1;
}
public function get disablePlayer():Boolean{
return (__disablePlayer);
}
public function set pointMultiplier(_arg1:Number):void{
__pointMultiplier = _arg1;
}
public function set weight(_arg1:Number):void{
__weight = _arg1;
}
}
}//package com.totaldramaonline.games.splatoberfest
Section 27
//Level (com.totaldramaonline.games.splatoberfest.Level)
package com.totaldramaonline.games.splatoberfest {
import com.zincroe.games.*;
import flash.utils.*;
import flash.display.*;
import com.greensock.*;
import flash.geom.*;
import flash.events.*;
import com.zincroe.utils.*;
import com.greensock.plugins.*;
import com.greensock.easing.*;
public class Level extends MovieClip {
public var nozzle:MovieClip;
private var __currentLevelPoints:Number;
private var __nozzleMoveSpeed:Number;
private var __gameDimensions:Rectangle;
public var gradientMask:MovieClip;
private var __pointsNeeded:Number;
private var __totalTime:Number;
private var __currentTween:TweenLite;
private var __itemProbability:Array;
public var itemsContainer:MovieClip;
private var __activeItems:Array;
private var __active:Boolean;
public static const START_LEVEL:String = "start_level";
public static const NEXT_LEVEL:String = "next_level";
public static const LOSE_LEVEL:String = "lose_level";
public function Level(){
__activeItems = [];
nozzle.stop();
TweenPlugin.activate([FrameLabelPlugin, FramePlugin]);
if (gradientMask){
gradientMask.cacheAsBitmap = true;
itemsContainer.cacheAsBitmap = true;
itemsContainer.mask = gradientMask;
};
}
public function get active():Boolean{
return (__active);
}
public function set active(_arg1:Boolean):void{
__active = _arg1;
}
public function get nozzleMoveSpeed():Number{
return (__nozzleMoveSpeed);
}
public function get itemProbability():Array{
return (__itemProbability);
}
protected function moveNozzle():void{
var _local1:uint;
_local1 = MathUtil.getRandom((gameDimensions.x + 50), (gameDimensions.width - (gameDimensions.x + 50)));
__currentTween = new TweenLite(nozzle, nozzleMoveSpeed, {x:_local1, onComplete:shootNozzle});
}
protected function takeShot():void{
var _local1:Number;
dropItem();
nozzle.gotoAndStop("shoot");
_local1 = (LabelUtil.totalFrames(nozzle, "shoot") / 30);
__currentTween = new TweenLite(nozzle, _local1, {frameLabel:"end_shoot", onComplete:shotTaken});
}
protected function setupNextShot():void{
LabelUtil.loop(nozzle, "normal");
moveNozzle();
}
public function set nozzleMoveSpeed(_arg1:Number):void{
__nozzleMoveSpeed = _arg1;
}
public function set itemProbability(_arg1:Array):void{
__itemProbability = _arg1;
}
protected function missedItem(_arg1:Item):void{
var _local2:uint;
_local2 = __activeItems.indexOf(_arg1);
__activeItems.splice(_local2, 1);
itemsContainer.removeChild(_arg1);
}
public function get gameDimensions():Rectangle{
return (__gameDimensions);
}
public function endLevel(_arg1:Boolean=false):void{
var _local2:uint;
if (!active){
return;
};
if (__currentTween){
__currentTween.pause();
};
LabelUtil.play(nozzle, "outro", (_arg1) ? loseGame : nextLevel);
_local2 = itemsContainer.numChildren;
while (_local2--) {
missedItem((itemsContainer.getChildAt(0) as Item));
};
active = false;
}
protected function showIntroState():void{
LabelUtil.play(nozzle, "intro", startGame);
}
public function get totalTime():Number{
return (__totalTime);
}
public function reset():void{
var _local1:uint;
if (__currentTween){
__currentTween.pause();
__currentTween = null;
};
_local1 = itemsContainer.numChildren;
while (_local1--) {
missedItem((itemsContainer.getChildAt(0) as Item));
};
currentLevelPoints = 0;
active = false;
}
protected function startGame():void{
dispatchEvent(new Event(Level.START_LEVEL));
LabelUtil.loop(nozzle, "normal");
moveNozzle();
}
protected function nextLevel():void{
nozzle.stop();
dispatchEvent(new Event(Level.NEXT_LEVEL));
}
public function get pointsNeeded():Number{
return (__pointsNeeded);
}
public function itemHit(_arg1:Item):void{
missedItem(_arg1);
}
public function start():void{
currentLevelPoints = 0;
showIntroState();
}
protected function dropItem():void{
var _local1:uint;
var _local2:GameProperties;
var _local3:Class;
var _local4:Item;
_local1 = Math.round((Math.random() * (itemProbability.length - 1)));
_local2 = GameProperties.getInstance();
if (_local2.cheats.carnivore.enabled){
_local3 = (getDefinitionByName("items.LargeMeat") as Class);
playItemSound("items.LargeMeat");
} else {
_local3 = (getDefinitionByName(itemProbability[_local1]) as Class);
playItemSound(itemProbability[_local1]);
};
_local4 = (new (_local3) as Item);
_local4.x = (nozzle.x - (_local4.width / 2));
_local4.y = nozzle.y;
itemsContainer.addChild(_local4);
TweenLite.to(_local4, _local4.weight, {y:((gameDimensions.y + gameDimensions.height) + 10), ease:Linear.easeNone});
__activeItems.push(_local4);
}
public function get activeItems():Array{
return (__activeItems);
}
public function set gameDimensions(_arg1:Rectangle):void{
__gameDimensions = _arg1;
}
public function get currentLevelPoints():Number{
return (__currentLevelPoints);
}
public function set totalTime(_arg1:Number):void{
__totalTime = _arg1;
}
protected function loseGame():void{
nozzle.stop();
dispatchEvent(new Event(Level.LOSE_LEVEL));
}
public function update():void{
var _local1:uint;
var _local2:Item;
if (!active){
return;
};
_local1 = itemsContainer.numChildren;
while (_local1--) {
_local2 = Item(itemsContainer.getChildAt(_local1));
if (_local2.y > (gameDimensions.y + gameDimensions.height)){
missedItem(_local2);
};
};
}
public function set currentLevelPoints(_arg1:Number):void{
__currentLevelPoints = _arg1;
}
protected function playItemSound(_arg1:String):void{
var _local2:GameProperties;
var _local3:String;
_local2 = GameProperties.getInstance();
switch (_arg1){
case "items.Bandaid":
_local3 = "BandAid";
break;
case "items.Bug":
_local3 = "Bug";
break;
case "items.Fly":
_local3 = "Fly";
break;
case "items.LargeMeat":
_local3 = "Meat";
break;
case "items.MediumMeat":
_local3 = "Meat";
break;
case "items.Rat":
_local3 = "Rat";
break;
case "items.SmallMeat":
_local3 = "Meat";
break;
case "items.Spider":
_local3 = "Spider";
break;
};
if (_local3){
_local2.sound.play(_local3);
};
}
protected function shotTaken():void{
var _local1:Number;
nozzle.gotoAndStop("shoot_finish");
_local1 = (LabelUtil.totalFrames(nozzle, "shoot_finish") / 30);
__currentTween = new TweenLite(nozzle, _local1, {frameLabel:"end_shoot_finish", onComplete:setupNextShot});
}
protected function shootNozzle():void{
var _local1:Number;
nozzle.gotoAndStop("shoot_ready");
_local1 = (LabelUtil.totalFrames(nozzle, "shoot_ready") / 30);
__currentTween = new TweenLite(nozzle, _local1, {frameLabel:"end_shoot_ready", onComplete:takeShot});
}
public function pause():void{
}
public function set pointsNeeded(_arg1:Number):void{
__pointsNeeded = _arg1;
}
}
}//package com.totaldramaonline.games.splatoberfest
Section 28
//LevelManager (com.totaldramaonline.games.splatoberfest.LevelManager)
package com.totaldramaonline.games.splatoberfest {
import com.zincroe.games.*;
import flash.display.*;
import com.greensock.*;
import flash.geom.*;
import flash.events.*;
import com.zincroe.utils.*;
public class LevelManager extends MovieClip {
private var __backgrounds:MovieClip;
public var level1:Level;
public var level2:Level;
public var level4:Level;
private var __scrollRect:Rectangle;
public var level3:Level;
private var __gameDimensions:Rectangle;
private var __currentLevel:Level;
private var __levels:Array;
public var bonusLevel:Level;
public var bonusIntro:BonusCutScene;
public static const BONUS_LEVEL_INTRO:String = "bonus_level_intro";
public static const BONUS_LEVEL:String = "bonus_level";
public static const GAME_FINISHED:String = "game_finished";
public static const NEXT_LEVEL:String = "next_level";
public static const LOSE_GAME:String = "lose_game";
public function LevelManager():void{
__levels = [level1, level2, level3, level4];
__scrollRect = new Rectangle(0, 0, 660, 660);
this.scrollRect = __scrollRect;
bonusIntro.stop();
}
protected function robotShoot3():void{
var _local1:GameProperties;
LabelUtil.play(bonusIntro, "shoot3", loadBonusLevel);
_local1 = GameProperties.getInstance();
_local1.music.play("RobotShoot");
}
protected function robotShoot1():void{
var _local1:GameProperties;
LabelUtil.play(bonusIntro, "shoot1", robotShoot2);
_local1 = GameProperties.getInstance();
_local1.music.play("RobotShoot");
}
protected function startNextLevel():void{
dispatchEvent(new Event(LevelManager.NEXT_LEVEL));
}
public function set backgrounds(_arg1:MovieClip):void{
__backgrounds = _arg1;
backgrounds.scrollRect = __scrollRect;
}
protected function loadBonusLevel():void{
var _local1:GameProperties;
_local1 = GameProperties.getInstance();
_local1.music.stop("RobotMusic");
bonusIntro.gotoAndStop(1);
__scrollRect.x = bonusLevel.x;
dispatchEvent(new Event(LevelManager.BONUS_LEVEL));
}
public function get backgrounds():MovieClip{
return (__backgrounds);
}
public function set currentLevel(_arg1:Level):void{
__currentLevel = _arg1;
}
public function setNextLevel():void{
var _local1:int;
if (!currentLevel){
currentLevel = __levels[0];
} else {
_local1 = (__levels.indexOf(currentLevel) + 1);
if (_local1 < __levels.length){
currentLevel = __levels[_local1];
};
};
currentLevel.active = true;
}
public function get gameDimensions():Rectangle{
return (__gameDimensions);
}
public function start():void{
var _local1:uint;
_local1 = __levels.length;
while (_local1--) {
__levels[_local1].gameDimensions = gameDimensions;
__levels[_local1].addEventListener(Level.NEXT_LEVEL, nextLevel, false, 0, true);
__levels[_local1].addEventListener(Level.LOSE_LEVEL, loseGame, false, 0, true);
};
bonusLevel.gameDimensions = gameDimensions;
bonusLevel.addEventListener(Level.NEXT_LEVEL, bonusLevelDone, false, 0, true);
}
protected function nextLevel(_arg1:Event):void{
var _local2:int;
var _local3:GameProperties;
_local2 = (__levels.indexOf(currentLevel) + 1);
if (_local2 < __levels.length){
TweenLite.to(__scrollRect, 2, {x:__levels[_local2].x, onComplete:startNextLevel});
} else {
dispatchEvent(new Event(LevelManager.BONUS_LEVEL_INTRO));
LabelUtil.play(bonusIntro, "show", robotEnter);
_local3 = GameProperties.getInstance();
_local3.music.play("RobotMusic");
__scrollRect.x = bonusIntro.x;
};
}
protected function robotEnter():void{
var _local1:GameProperties;
LabelUtil.play(bonusIntro, "robot_enter", robotShoot1);
_local1 = GameProperties.getInstance();
_local1.music.play("RobotEnter");
}
public function get currentLevel():Level{
return (__currentLevel);
}
protected function loseGame(_arg1:Event):void{
dispatchEvent(new Event(LevelManager.LOSE_GAME));
}
public function get levelIndex():uint{
return ((__levels.indexOf(currentLevel) + 1));
}
public function set gameDimensions(_arg1:Rectangle):void{
__gameDimensions = _arg1;
}
public function reset():void{
var _local1:uint;
_local1 = __levels.length;
while (_local1--) {
__levels[_local1].reset();
};
currentLevel = null;
__scrollRect.x = 0;
}
public function update():void{
if (currentLevel){
currentLevel.update();
};
this.scrollRect = __scrollRect;
backgrounds.scrollRect = __scrollRect;
}
protected function bonusLevelDone(_arg1:Event):void{
dispatchEvent(new Event(LevelManager.GAME_FINISHED));
}
public function setBonusLevel():void{
currentLevel = bonusLevel;
currentLevel.active = true;
currentLevel.start();
}
protected function robotShoot2():void{
var _local1:GameProperties;
LabelUtil.play(bonusIntro, "shoot2", robotShoot3);
_local1 = GameProperties.getInstance();
_local1.music.play("RobotShoot");
}
}
}//package com.totaldramaonline.games.splatoberfest
Section 29
//PlayerContainer (com.totaldramaonline.games.splatoberfest.PlayerContainer)
package com.totaldramaonline.games.splatoberfest {
import com.zincroe.games.*;
import flash.utils.*;
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import com.totaldramaonline.games.splatoberfest.ui.*;
import com.zincroe.utils.*;
public class PlayerContainer extends Sprite {
private var __gameDimensions:Rectangle;
private var __disabled:Boolean;
public var playerAvatar:PlayerAvatar;
private var __levelTransitions:Array;
private var __undefinedPosition:Boolean;// = false
private var __badReactions:Array;
private var __userInterface:AbstractPlayer;
private var __delayBetweenEating:Timer;
public function PlayerContainer(){
__badReactions = ["puke", "queasy", "dizzy", "burp", "disgusted"];
__levelTransitions = ["drinking", "pant", "sucker", "rubbing"];
__undefinedPosition = false;
super();
loopNormal();
}
public function setPlayer(_arg1:AbstractPlayer):void{
if (__userInterface){
removeChild(__userInterface);
};
__userInterface = _arg1;
addChildAt(__userInterface, 0);
}
protected function noMarker(_arg1:Boolean):void{
if (__undefinedPosition != _arg1){
if (_arg1){
if (__levelTransitions.indexOf(playerAvatar.currentLabel) != -1){
return;
};
LabelUtil.loop(playerAvatar, "mouth_closed");
__disabled = true;
} else {
loopNormal();
};
__undefinedPosition = _arg1;
};
}
public function checkItemHit(_arg1:Item):Boolean{
if (((playerAvatar.hitBox.hitTestObject(_arg1)) && (!(__disabled)))){
return (true);
};
return (false);
}
public function get gameDimensions():Rectangle{
return (__gameDimensions);
}
public function eat():void{
LabelUtil.play(playerAvatar, "eat", finishEating);
__disabled = true;
}
protected function eatDelayFinished(_arg1:TimerEvent):void{
__delayBetweenEating.stop();
__delayBetweenEating.removeEventListener(TimerEvent.TIMER, eatDelayFinished);
__delayBetweenEating = null;
loopNormal();
}
public function getPosition():Point{
return (__userInterface.getPosition());
}
public function playTransition():void{
var _local1:String;
var _local2:String;
var _local3:GameProperties;
_local1 = __levelTransitions[Math.round((Math.random() * (__levelTransitions.length - 1)))];
switch (_local1){
case "drinking":
_local2 = "Drinking";
break;
case "pant":
_local2 = "Panting";
break;
case "sucker":
_local2 = "Soother";
break;
case "rubbing":
_local2 = "Tummy";
break;
};
_local3 = GameProperties.getInstance();
_local3.sound.play(_local2);
LabelUtil.play(playerAvatar, _local1, loopNormal);
__disabled = true;
}
protected function loopNormal():void{
LabelUtil.loop(playerAvatar, "mouth_open");
__disabled = false;
}
public function update():void{
var _local1:Point;
__userInterface.update();
_local1 = __userInterface.getPosition();
if (((_local1) && (gameDimensions.containsPoint(_local1)))){
if (__badReactions.indexOf(playerAvatar.currentLabel) == -1){
playerAvatar.x = _local1.x;
playerAvatar.y = _local1.y;
};
noMarker(false);
} else {
if (__badReactions.indexOf(playerAvatar.currentLabel) == -1){
noMarker(true);
};
};
}
public function set gameDimensions(_arg1:Rectangle):void{
__gameDimensions = _arg1;
}
public function disable():void{
var _local1:String;
var _local2:GameProperties;
var _local3:String;
_local2 = GameProperties.getInstance();
if (_local2.cheats.gross.enabled){
_local1 = "puke";
} else {
_local1 = __badReactions[Math.round((Math.random() * (__badReactions.length - 1)))];
};
switch (_local1){
case "puke":
_local3 = "Puke";
break;
};
_local2.sound.play(_local3);
LabelUtil.play(playerAvatar, _local1, loopNormal);
__disabled = true;
}
protected function finishEating():void{
LabelUtil.loop(playerAvatar, "mouth_open");
__delayBetweenEating = new Timer(100, 1);
__delayBetweenEating.addEventListener(TimerEvent.TIMER, eatDelayFinished, false, 0, true);
__delayBetweenEating.start();
}
}
}//package com.totaldramaonline.games.splatoberfest
Section 30
//SplatCheatCodeScreen (com.totaldramaonline.games.splatoberfest.SplatCheatCodeScreen)
package com.totaldramaonline.games.splatoberfest {
import flash.events.*;
import com.zincroe.games.screens.*;
public class SplatCheatCodeScreen extends CheatCodeScreen {
protected function rollOver(_arg1:MouseEvent):void{
gameProperties.sound.play("ButtonRoll");
}
override public function start():void{
super.start();
continueButton.addEventListener(MouseEvent.ROLL_OVER, rollOver, false, 0, true);
}
override protected function onClick(_arg1:MouseEvent):void{
switch (_arg1.target){
case continueButton:
pause();
gameProperties.screenManager.showTitleScreen(this);
gameProperties.sound.play("ButtonClick");
break;
};
}
override public function pause():void{
super.pause();
continueButton.addEventListener(MouseEvent.ROLL_OVER, rollOver);
}
}
}//package com.totaldramaonline.games.splatoberfest
Section 31
//SplatDocument (com.totaldramaonline.games.splatoberfest.SplatDocument)
package com.totaldramaonline.games.splatoberfest {
import flash.utils.*;
import flash.events.*;
import com.zincroe.utils.*;
import com.zincroe.display.*;
public class SplatDocument extends Document {
private var __splatTimer:Timer;
private var __splats:Array;
public function SplatDocument(){
__splats = [];
super();
}
protected function splat(_arg1:TimerEvent):void{
var _local2:uint;
var _local3:PreloaderSplat;
_local2 = __splats.length;
while (_local2--) {
if (__splats[_local2].currentFrame == __splats[_local2].totalFrames){
removeChild(__splats[_local2]);
__splats.splice(_local2, 1);
};
};
_local3 = new PreloaderSplat();
_local3.x = (Math.random() * (stage.stageWidth - _local3.width));
_local3.y = (Math.random() * (stage.stageHeight - (_local3.height * 2)));
_local3.scaleX = (_local3.scaleY = (Math.random() + 1));
LabelUtil.once(_local3, "show");
addChildAt(_local3, 1);
__splats.push(_local3);
}
override protected function startFramework():void{
var _local1:uint;
__splatTimer.stop();
__splatTimer.removeEventListener(TimerEvent.TIMER, splat);
_local1 = __splats.length;
while (_local1--) {
removeChild(__splats[_local1]);
};
__splats = null;
super.startFramework();
}
override protected function showPreloader():void{
super.showPreloader();
__splatTimer = new Timer(1500);
__splatTimer.addEventListener(TimerEvent.TIMER, splat, false, 0, true);
__splatTimer.start();
}
}
}//package com.totaldramaonline.games.splatoberfest
Section 32
//SplatEngine (com.totaldramaonline.games.splatoberfest.SplatEngine)
package com.totaldramaonline.games.splatoberfest {
import com.zincroe.games.*;
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import com.totaldramaonline.games.splatoberfest.ui.*;
public class SplatEngine extends Engine {
private var __gameDimensions:Rectangle;
public var engineContainer:SplatEngineContainer;
private var __ui:String;
private var __bitmapDisplay:Bitmap;
public function SplatEngine(){
__gameDimensions = new Rectangle(27, 91, 605, 486);
}
protected function gameLose(_arg1:Event):void{
engineContainer.removeEventListener(SplatEngineContainer.GAME_LOSE, gameLose);
pause();
score = engineContainer.score;
engineContainer.reset();
gameProperties.screenManager.showLoseScreen(this);
}
override public function start():void{
if (engineContainer.stage){
removeChild(engineContainer);
};
engineContainer.addEventListener(SplatEngineContainer.GAME_FINISHED, gameFinished, false, 0, true);
engineContainer.addEventListener(SplatEngineContainer.GAME_LOSE, gameLose, false, 0, true);
engineContainer.gameDimensions = __gameDimensions;
engineContainer.start();
super.start();
if (gameProperties.music.isPlaying("MusicLevel1")){
gameProperties.music.stop("MusicLevel1");
};
}
public function setUI(_arg1:String, _arg2:Function):AbstractPlayer{
if (_arg1 == __ui){
return (null);
};
__ui = _arg1;
return (engineContainer.setPlayer(_arg1, _arg2));
}
protected function gameFinished(_arg1:Event):void{
score = engineContainer.score;
engineContainer.removeEventListener(SplatEngineContainer.GAME_FINISHED, gameFinished);
pause();
engineContainer.reset();
gameProperties.screenManager.showWinScreen(this);
}
public function get ui():String{
return (__ui);
}
override protected function update(_arg1:Event):void{
var _local2:BitmapData;
if (__bitmapDisplay){
removeChild(__bitmapDisplay);
__bitmapDisplay.bitmapData.dispose();
};
_local2 = new BitmapData(660, 660, false, 0);
_local2.draw(engineContainer);
__bitmapDisplay = new Bitmap(_local2);
addChildAt(__bitmapDisplay, 1);
}
override public function pause():void{
super.pause();
if (gameProperties.music.isPlaying("MusicLevel1")){
gameProperties.music.stop("MusicLevel1");
};
}
}
}//package com.totaldramaonline.games.splatoberfest
Section 33
//SplatEngineContainer (com.totaldramaonline.games.splatoberfest.SplatEngineContainer)
package com.totaldramaonline.games.splatoberfest {
import com.zincroe.games.*;
import flash.utils.*;
import com.zincroe.media.*;
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import com.totaldramaonline.games.splatoberfest.ui.*;
public class SplatEngineContainer extends Sprite {
private var __multiplierTimer:Timer;
private var __currentPlayerType:AbstractPlayer;
private var __gameDimensions:Rectangle;
public var gameStatus:GameStatus;
public var levelManager:LevelManager;
private var __currentPointMultiplier:Number;
public var playerContainer:PlayerContainer;
private var __currentLevelDone:Boolean;
private var __score:Number;// = 0
public var levelBackgrounds:MovieClip;
public static const GAME_LOSE:String = "game_lose";
public static const GAME_FINISHED:String = "game_finished";
public function SplatEngineContainer(){
__score = 0;
super();
gameStatus.addEventListener(GameStatus.TIME_DONE, timeDone, false, 0, true);
levelManager.addEventListener(LevelManager.NEXT_LEVEL, setLevel, false, 0, true);
levelManager.addEventListener(LevelManager.BONUS_LEVEL, bonusLevel, false, 0, true);
levelManager.addEventListener(LevelManager.GAME_FINISHED, gameFinished, false, 0, true);
levelManager.addEventListener(LevelManager.LOSE_GAME, loseGame, false, 0, true);
levelManager.addEventListener(LevelManager.BONUS_LEVEL_INTRO, bonusLevelIntro, false, 0, true);
levelManager.backgrounds = levelBackgrounds;
}
public function setPlayer(_arg1:String, _arg2:Function):AbstractPlayer{
switch (_arg1){
case "mouse":
__currentPlayerType = new MousePlayer(_arg2);
break;
case "webcam":
__currentPlayerType = new WebcamPlayer(_arg2);
break;
};
playerContainer.setPlayer(__currentPlayerType);
return (__currentPlayerType);
}
protected function endCurrentLevel():void{
var _local1:Number;
var _local2:GameProperties;
__currentLevelDone = true;
levelManager.currentLevel.endLevel();
_local1 = ((gameStatus.timeRemaining * 10) + score);
score = _local1;
gameStatus.winLevel(score);
if (levelManager.levelIndex != 4){
playerContainer.playTransition();
};
_local2 = GameProperties.getInstance();
_local2.music.stop(("MusicLevel" + levelManager.levelIndex));
if (__multiplierTimer){
finishMultiplier();
};
}
public function set score(_arg1:Number):void{
__score = _arg1;
}
protected function setLevel(_arg1:Event=null):void{
__currentLevelDone = false;
levelManager.setNextLevel();
levelManager.currentLevel.start();
gameStatus.totalTime = levelManager.currentLevel.totalTime;
levelManager.currentLevel.addEventListener(Level.START_LEVEL, startLevel, false, 0, true);
}
public function checkItemHit():void{
var _local1:Array;
var _local2:uint;
var _local3:Item;
_local1 = levelManager.currentLevel.activeItems;
_local2 = _local1.length;
while (_local2--) {
_local3 = _local1[_local2];
if (playerContainer.checkItemHit(_local3)){
itemHit(_local3);
};
};
}
public function get gameDimensions():Rectangle{
return (__gameDimensions);
}
public function reset():void{
pause();
levelManager.reset();
score = 0;
}
public function start():void{
playerContainer.gameDimensions = gameDimensions;
levelManager.gameDimensions = gameDimensions;
score = 0;
levelManager.start();
setLevel();
this.addEventListener(Event.ENTER_FRAME, update, false, 0, true);
}
protected function startLevel(_arg1:Event):void{
var _local2:GameProperties;
var _local3:SimpleSoundOptions;
__currentPointMultiplier = 0;
levelManager.currentLevel.removeEventListener(Level.START_LEVEL, startLevel);
gameStatus.start();
_local2 = GameProperties.getInstance();
_local3 = new SimpleSoundOptions();
_local3.loop = 100;
_local3.volume = 0.5;
_local2.music.play(("MusicLevel" + levelManager.levelIndex), _local3);
}
protected function itemHit(_arg1:Item):void{
var _local2:Number;
levelManager.currentLevel.itemHit(_arg1);
if (_arg1.pointValue > 0){
playerContainer.eat();
_local2 = (__currentPointMultiplier) ? (_arg1.pointValue * __currentPointMultiplier) : _arg1.pointValue;
score = (score + _local2);
gameStatus.updateScore(score);
trace(("itemValue: " + _local2));
levelManager.currentLevel.currentLevelPoints = (levelManager.currentLevel.currentLevelPoints + _local2);
} else {
if (_arg1.pointMultiplier){
playerContainer.eat();
if (!__multiplierTimer){
__currentPointMultiplier = _arg1.pointMultiplier;
__multiplierTimer = new Timer(10000, 1);
__multiplierTimer.addEventListener(TimerEvent.TIMER, finishMultiplier, false, 0, true);
__multiplierTimer.start();
gameStatus.multiplierIndicatorState(true);
};
} else {
if (_arg1.disablePlayer){
playerContainer.disable();
};
};
};
playEatSound(getQualifiedClassName(_arg1));
}
public function get score():Number{
return (__score);
}
protected function gameFinished(_arg1:Event):void{
var _local2:GameProperties;
__currentLevelDone = true;
_local2 = GameProperties.getInstance();
_local2.music.stop("MusicLevel0");
gameStatus.endBonusLevel();
gameStatus.reset();
dispatchEvent(new Event(SplatEngineContainer.GAME_FINISHED));
if (__multiplierTimer){
finishMultiplier();
};
_local2.sound.stop("Tick");
}
protected function bonusLevel(_arg1:Event):void{
__currentLevelDone = false;
gameStatus.visible = true;
gameStatus.bonusLevel();
levelManager.setBonusLevel();
gameStatus.totalTime = levelManager.currentLevel.totalTime;
levelManager.currentLevel.addEventListener(Level.START_LEVEL, startLevel, false, 0, true);
}
protected function finishMultiplier(_arg1:TimerEvent=null):void{
trace("finish multiplier");
__multiplierTimer.stop();
__multiplierTimer.removeEventListener(TimerEvent.TIMER, finishMultiplier);
__multiplierTimer = null;
__currentPointMultiplier = 0;
gameStatus.multiplierIndicatorState(false);
}
public function set gameDimensions(_arg1:Rectangle):void{
__gameDimensions = _arg1;
}
protected function bonusLevelIntro(_arg1:Event):void{
gameStatus.visible = false;
}
protected function loseGame(_arg1:Event):void{
var _local2:GameProperties;
var _local3:uint;
gameStatus.reset();
_local2 = GameProperties.getInstance();
_local3 = 0;
while (_local3 < 5) {
_local2.music.stop(("MusicLevel" + _local3));
_local3++;
};
dispatchEvent(new Event(SplatEngineContainer.GAME_LOSE));
_local2.sound.stop("Tick");
}
public function update(_arg1:Event):void{
var _local2:Number;
gameStatus.update();
_local2 = (levelManager.currentLevel.currentLevelPoints / levelManager.currentLevel.pointsNeeded);
if (_local2 > 1){
_local2 = 1;
};
gameStatus.updateMeater(_local2);
levelManager.update();
playerContainer.update();
if (__currentLevelDone){
return;
};
checkItemHit();
checkLevelWin();
}
protected function checkLevelWin():void{
var _local1:Level;
_local1 = levelManager.currentLevel;
if (_local1 == levelManager.bonusLevel){
return;
};
if (_local1.currentLevelPoints >= _local1.pointsNeeded){
endCurrentLevel();
};
}
protected function playEatSound(_arg1:String):void{
var _local2:String;
var _local3:GameProperties;
switch (_arg1){
case "items::Bandaid":
_local2 = "EatBandAid";
break;
case "items::Bug":
_local2 = "EatBug";
break;
case "items::Fly":
_local2 = "EatFly";
break;
case "items::LargeMeat":
_local2 = "EatMeat";
break;
case "items::MediumMeat":
_local2 = "EatMeat";
break;
case "items::Rat":
_local2 = "EatRat";
break;
case "items::SmallMeat":
_local2 = "EatMeat";
break;
case "items::Spider":
_local2 = "EatSpider";
break;
};
_local3 = GameProperties.getInstance();
if (_local2){
_local3.sound.play(_local2);
};
}
protected function timeDone(_arg1:Event):void{
__currentLevelDone = true;
if (levelManager.currentLevel == levelManager.bonusLevel){
levelManager.currentLevel.endLevel();
} else {
levelManager.currentLevel.endLevel(true);
};
}
public function pause():void{
levelManager.currentLevel.pause();
this.removeEventListener(Event.ENTER_FRAME, update);
}
}
}//package com.totaldramaonline.games.splatoberfest
Section 34
//SplatGame (com.totaldramaonline.games.splatoberfest.SplatGame)
package com.totaldramaonline.games.splatoberfest {
import com.zincroe.games.*;
public class SplatGame extends Game {
public function SplatGame(){
gameProperties.cheats.carnivore = new Cheat("carnivore");
gameProperties.cheats.gross = new Cheat("gross");
}
}
}//package com.totaldramaonline.games.splatoberfest
Section 35
//SplatHighScoreScreen (com.totaldramaonline.games.splatoberfest.SplatHighScoreScreen)
package com.totaldramaonline.games.splatoberfest {
import com.zincroe.games.*;
import com.zincroe.media.*;
import flash.display.*;
import flash.events.*;
import com.zincroe.games.screens.*;
public class SplatHighScoreScreen extends HighScoreScreen {
public var menuButton:DisplayObject;
protected function rollOver(_arg1:MouseEvent):void{
gameProperties.sound.play("ButtonRoll");
}
override public function start():void{
var _local1:GameProperties;
var _local2:SimpleSoundOptions;
super.start();
if (gameProperties.screenManager.engine.ui){
playAgainButton.visible = true;
menuButton.visible = false;
} else {
playAgainButton.visible = false;
menuButton.visible = true;
};
playAgainButton.addEventListener(MouseEvent.ROLL_OVER, rollOver, false, 0, true);
menuButton.addEventListener(MouseEvent.ROLL_OVER, rollOver, false, 0, true);
_local1 = GameProperties.getInstance();
if (!_local1.music.isPlaying("MusicLevel1")){
_local2 = new SimpleSoundOptions();
_local2.loop = 100;
_local2.volume = 1;
_local1.music.play("MusicLevel1", _local2);
};
}
override protected function onClick(_arg1:MouseEvent):void{
switch (_arg1.target){
case playAgainButton:
pause();
gameProperties.sound.play("ButtonClick");
gameProperties.screenManager.showEngine(this);
break;
case menuButton:
pause();
gameProperties.sound.play("ButtonClick");
gameProperties.screenManager.showTitleScreen(this);
break;
};
}
override public function pause():void{
super.pause();
playAgainButton.removeEventListener(MouseEvent.ROLL_OVER, rollOver);
menuButton.removeEventListener(MouseEvent.ROLL_OVER, rollOver);
}
}
}//package com.totaldramaonline.games.splatoberfest
Section 36
//SplatInstructionScreen (com.totaldramaonline.games.splatoberfest.SplatInstructionScreen)
package com.totaldramaonline.games.splatoberfest {
import flash.display.*;
import flash.events.*;
import com.zincroe.games.screens.*;
public class SplatInstructionScreen extends InstructionScreen {
public var menuButton:DisplayObject;
public var playButton:DisplayObject;
protected function rollOver(_arg1:MouseEvent):void{
gameProperties.sound.play("ButtonRoll");
}
override public function start():void{
super.start();
menuButton.addEventListener(MouseEvent.ROLL_OVER, rollOver, false, 0, true);
}
override protected function onClick(_arg1:MouseEvent):void{
switch (_arg1.target){
case playButton:
pause();
gameProperties.screenManager.showSetupScreen(this);
break;
case menuButton:
gameProperties.screenManager.showTitleScreen(this);
gameProperties.sound.play("ButtonClick");
break;
};
}
override public function pause():void{
super.pause();
menuButton.removeEventListener(MouseEvent.ROLL_OVER, rollOver);
}
}
}//package com.totaldramaonline.games.splatoberfest
Section 37
//SplatLoseScreen (com.totaldramaonline.games.splatoberfest.SplatLoseScreen)
package com.totaldramaonline.games.splatoberfest {
import flash.display.*;
import flash.events.*;
import com.zincroe.utils.*;
import com.zincroe.games.screens.*;
public class SplatLoseScreen extends LoseScreen {
public var loseAnimation:MovieClip;
public function SplatLoseScreen(){
loseAnimation.gotoAndStop(1);
}
override public function start():void{
super.start();
loseAnimation.gotoAndStop(1);
LabelUtil.once(loseAnimation, "animation");
gameProperties.music.play("LoseMusic");
playAgainButton.addEventListener(MouseEvent.ROLL_OVER, rollOver, false, 0, true);
if (highScoreButton){
highScoreButton.addEventListener(MouseEvent.ROLL_OVER, rollOver, false, 0, true);
};
}
override protected function onClick(_arg1:MouseEvent):void{
switch (_arg1.target){
case highScoreButton:
pause();
gameProperties.screenManager.showHighScoreScreen(this);
gameProperties.sound.play("ButtonClick");
break;
case playAgainButton:
pause();
gameProperties.screenManager.showEngine(this);
gameProperties.sound.play("ButtonClick");
break;
};
}
protected function rollOver(_arg1:MouseEvent):void{
gameProperties.sound.play("ButtonRoll");
}
override public function pause():void{
super.pause();
gameProperties.music.stop("LoseMusic");
playAgainButton.removeEventListener(MouseEvent.ROLL_OVER, rollOver);
if (highScoreButton){
highScoreButton.removeEventListener(MouseEvent.ROLL_OVER, rollOver);
};
}
}
}//package com.totaldramaonline.games.splatoberfest
Section 38
//SplatSetupScreen (com.totaldramaonline.games.splatoberfest.SplatSetupScreen)
package com.totaldramaonline.games.splatoberfest {
import com.zincroe.games.*;
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.media.*;
import com.totaldramaonline.games.splatoberfest.ui.*;
import com.zincroe.utils.*;
import com.zincroe.games.screens.*;
import flash.printing.*;
public class SplatSetupScreen extends SetupScreen {
private var __feedAvailable:Boolean;
private var __introDone:Boolean;
private var __currentCameraIndex:uint;
public var printMarkerButton:DisplayObject;
public var introAnimation:MovieClip;
public var mousePlay:DisplayObject;
public var marker:Sprite;
public var stillChecking:StillCheckingFeed;
private var __playerType:AbstractPlayer;
private var __checkFeedDone:Boolean;
public var webcamPlayButton:DisplayObject;
public function SplatSetupScreen(){
removeChild(introAnimation);
removeChild(stillChecking);
introAnimation.gotoAndStop(1);
}
protected function showCheckingFeedScreen(_arg1:String, _arg2:Function=null):void{
if (!stillChecking.parent){
addChild(stillChecking);
};
if (_arg2){
LabelUtil.play(stillChecking, _arg1, _arg2);
} else {
LabelUtil.loop(stillChecking, _arg1);
};
}
protected function checkIfGameReady():void{
if (gameProperties.screenManager.engine.ui == "mouse"){
startGame(true);
} else {
if (((((__checkFeedDone) && (__feedAvailable))) && (__introDone))){
stillChecking.gotoAndStop(1);
if (stillChecking.parent){
removeChild(stillChecking);
};
startGame(true);
} else {
if (((__introDone) && (!(__checkFeedDone)))){
showCheckingFeedScreen("checking");
} else {
if (((((__introDone) && (__checkFeedDone))) && (!(__feedAvailable)))){
showCheckingFeedScreen("noCamera", forceMouseMode);
};
};
};
};
}
protected function animationFinished():void{
gameProperties.music.stop("IntroMusic");
__introDone = true;
introAnimation.gotoAndStop(1);
removeChild(introAnimation);
checkIfGameReady();
}
protected function forceMouseMode():void{
stillChecking.gotoAndStop(1);
removeChild(stillChecking);
__playerType = gameProperties.screenManager.engine.setUI("mouse", startGame);
}
protected function printMarker():void{
var _local1:PrintJob;
_local1 = new PrintJob();
if (_local1.start()){
marker.scaleX = (marker.scaleY = 1);
_local1.addPage(marker);
_local1.send();
};
}
override public function start():void{
addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
printMarkerButton.addEventListener(MouseEvent.ROLL_OVER, rollOver, false, 0, true);
webcamPlayButton.addEventListener(MouseEvent.ROLL_OVER, rollOver, false, 0, true);
mousePlay.addEventListener(MouseEvent.ROLL_OVER, rollOver, false, 0, true);
}
protected function checkFeeds():void{
var _local1:WebcamPlayer;
var _local2:Timer;
if (__currentCameraIndex < Camera.names.length){
_local1 = (__playerType as WebcamPlayer);
_local1.setupCameraDetection(String(__currentCameraIndex));
_local2 = new Timer(2000, 1);
_local2.addEventListener(TimerEvent.TIMER, checkForPixel, false, 0, true);
_local2.start();
} else {
__checkFeedDone = true;
checkIfGameReady();
};
}
protected function initPlayerCallback(_arg1:Boolean, _arg2:String=null):void{
if (_arg1){
showIntroAnimation();
if (gameProperties.screenManager.engine.ui == "webcam"){
__feedAvailable = true;
__checkFeedDone = true;
};
} else {
if (_arg2 == "Feed.DENIED"){
__playerType = gameProperties.screenManager.engine.setUI("mouse", initPlayerCallback);
} else {
if (_arg2 == "Feed.NONE"){
showIntroAnimation();
startCheckingForFeeds();
};
};
};
}
protected function startGame(_arg1:Boolean, _arg2:String=null):void{
if (_arg1){
pause();
gameProperties.screenManager.showEngine(this);
};
}
protected function checkForPixel(_arg1:TimerEvent):void{
var _local2:WebcamPlayer;
_arg1.currentTarget.stop();
_arg1.currentTarget.removeEventListener(TimerEvent.TIMER, checkFeeds);
_local2 = (__playerType as WebcamPlayer);
if (!_local2.checkVideoFeed()){
__currentCameraIndex++;
checkFeeds();
} else {
__checkFeedDone = true;
__feedAvailable = true;
checkIfGameReady();
};
}
protected function startCheckingForFeeds():void{
var _local1:Array;
_local1 = Camera.names;
__currentCameraIndex = 0;
checkFeeds();
}
protected function showIntroAnimation():void{
addChild(introAnimation);
gameProperties.music.stop("MusicLevel1");
LabelUtil.play(introAnimation, "show", animationFinished);
gameProperties.music.play("IntroMusic");
}
protected function onClick(_arg1:MouseEvent):void{
switch (_arg1.target){
case printMarkerButton:
printMarker();
gameProperties.sound.play("ButtonClick");
break;
case webcamPlayButton:
__playerType = gameProperties.screenManager.engine.setUI("webcam", initPlayerCallback);
gameProperties.sound.play("ButtonClick");
break;
case mousePlay:
__playerType = gameProperties.screenManager.engine.setUI("mouse", initPlayerCallback);
gameProperties.sound.play("ButtonClick");
break;
};
}
protected function rollOver(_arg1:MouseEvent):void{
gameProperties.sound.play("ButtonRoll");
}
override public function pause():void{
printMarkerButton.removeEventListener(MouseEvent.ROLL_OVER, rollOver);
webcamPlayButton.removeEventListener(MouseEvent.ROLL_OVER, rollOver);
mousePlay.removeEventListener(MouseEvent.ROLL_OVER, rollOver);
removeEventListener(MouseEvent.CLICK, onClick);
}
}
}//package com.totaldramaonline.games.splatoberfest
Section 39
//SplatTitleScreen (com.totaldramaonline.games.splatoberfest.SplatTitleScreen)
package com.totaldramaonline.games.splatoberfest {
import com.zincroe.media.*;
import flash.display.*;
import flash.events.*;
import com.zincroe.games.screens.*;
public class SplatTitleScreen extends TitleScreen {
public var instructionsButton:DisplayObject;
public var titleCopy:MovieClip;
override public function start():void{
var _local1:SimpleSoundOptions;
super.start();
if (!gameProperties.music.isPlaying("MusicLevel1")){
_local1 = new SimpleSoundOptions();
_local1.loop = 100;
_local1.volume = 1;
gameProperties.music.play("MusicLevel1", _local1);
};
playButton.addEventListener(MouseEvent.ROLL_OVER, rollOver, false, 0, true);
instructionsButton.addEventListener(MouseEvent.ROLL_OVER, rollOver, false, 0, true);
if (highScoreButton){
highScoreButton.addEventListener(MouseEvent.ROLL_OVER, rollOver, false, 0, true);
};
}
override protected function onClick(_arg1:MouseEvent):void{
switch (_arg1.target){
case highScoreButton:
pause();
gameProperties.screenManager.showHighScoreScreen(this);
gameProperties.sound.play("ButtonClick");
break;
case playButton:
pause();
gameProperties.screenManager.showSetupScreen(this);
gameProperties.sound.play("ButtonClick");
break;
case instructionsButton:
pause();
gameProperties.screenManager.showInstructionScreen(this);
gameProperties.sound.play("ButtonClick");
break;
};
}
protected function rollOver(_arg1:MouseEvent):void{
gameProperties.sound.play("ButtonRoll");
}
override public function pause():void{
super.pause();
playButton.removeEventListener(MouseEvent.ROLL_OVER, rollOver);
instructionsButton.removeEventListener(MouseEvent.ROLL_OVER, rollOver);
if (highScoreButton){
highScoreButton.removeEventListener(MouseEvent.ROLL_OVER, rollOver);
};
}
}
}//package com.totaldramaonline.games.splatoberfest
Section 40
//SplatWinScreen (com.totaldramaonline.games.splatoberfest.SplatWinScreen)
package com.totaldramaonline.games.splatoberfest {
import com.zincroe.games.*;
import flash.display.*;
import flash.events.*;
import com.zincroe.utils.*;
import com.zincroe.games.screens.*;
public class SplatWinScreen extends WinScreen {
public var winAnimation:MovieClip;
public function SplatWinScreen(){
winAnimation.gotoAndStop(1);
}
override public function start():void{
var _local1:GameProperties;
super.start();
winAnimation.gotoAndStop(1);
LabelUtil.once(winAnimation, "animation");
_local1 = GameProperties.getInstance();
_local1.music.play("WinMusic");
playAgainButton.addEventListener(MouseEvent.ROLL_OVER, rollOver, false, 0, true);
if (highScoreButton){
highScoreButton.addEventListener(MouseEvent.ROLL_OVER, rollOver, false, 0, true);
};
}
override protected function onClick(_arg1:MouseEvent):void{
switch (_arg1.target){
case highScoreButton:
pause();
gameProperties.screenManager.showHighScoreScreen(this);
gameProperties.sound.play("ButtonClick");
break;
case playAgainButton:
pause();
gameProperties.screenManager.showEngine(this);
gameProperties.sound.play("ButtonClick");
break;
};
}
protected function rollOver(_arg1:MouseEvent):void{
gameProperties.sound.play("ButtonRoll");
}
override public function pause():void{
var _local1:GameProperties;
super.pause();
_local1 = GameProperties.getInstance();
_local1.music.stop("WinMusic");
playAgainButton.removeEventListener(MouseEvent.ROLL_OVER, rollOver);
if (highScoreButton){
highScoreButton.removeEventListener(MouseEvent.ROLL_OVER, rollOver);
};
}
}
}//package com.totaldramaonline.games.splatoberfest
Section 41
//Document (com.zincroe.display.Document)
package com.zincroe.display {
import com.zincroe.games.*;
import flash.display.*;
import flash.events.*;
import com.zincroe.utils.*;
public class Document extends MovieClip {
public var preloader:DocumentPreloader;
public function Document(){
gotoAndStop("preloader");
showPreloader();
}
protected function rootLoadComplete(_arg1:Event):void{
preloader.removeEventListener(DocumentPreloader.ROOT_LOAD_COMPLETE, rootLoadComplete);
if (preloader.progress == 1){
startFramework();
} else {
startQueue();
};
}
protected function initGameProps():void{
var _local1:GameProperties;
var _local2:*;
_local1 = GameProperties.getInstance();
_local1.preloadedExternalFiles = preloader.externalFiles;
SharedAssets.master = stage.loaderInfo.applicationDomain;
for (_local2 in _local1.preloadedExternalFiles) {
SharedAssets.addLibrary(_local2, _local1.preloadedExternalFiles[_local2].contentLoaderInfo.applicationDomain);
};
}
protected function loadProgress(_arg1:Event):void{
preloader.scaleX = preloader.progress;
}
protected function startFramework():void{
removeChild(preloader);
initGameProps();
gotoAndStop("framework");
this.removeEventListener(Event.ENTER_FRAME, loadProgress);
}
protected function startQueue():void{
preloader.addEventListener(DocumentPreloader.QUEUE_LOAD_COMPLETE, queueLoadComplete, false, 0, true);
preloader.startLoad();
}
protected function showPreloader():void{
preloader.addEventListener(DocumentPreloader.ROOT_LOAD_COMPLETE, rootLoadComplete, false, 0, true);
this.addEventListener(Event.ENTER_FRAME, loadProgress, false, 0, true);
}
protected function queueLoadComplete(_arg1:Event):void{
preloader.removeEventListener(DocumentPreloader.QUEUE_LOAD_COMPLETE, queueLoadComplete);
startFramework();
}
}
}//package com.zincroe.display
Section 42
//DocumentPreloader (com.zincroe.display.DocumentPreloader)
package com.zincroe.display {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class DocumentPreloader extends Sprite {
private var __progress:Number;
private var __currentLoader:Loader;
private var __loadedLoaders:Array;
private var __currentLoad:String;
private var __documentClass:Document;
private var __loadQueue:Array;
public static const QUEUE_LOAD_COMPLETE:String = "queue_load_complete";
public static const ROOT_LOAD_COMPLETE:String = "root_load_complete";
public function DocumentPreloader(){
__loadQueue = [];
__loadedLoaders = [];
this.addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
}
public function get progress():Number{
return (__progress);
}
public function get loadedQueue():Array{
return (__loadedLoaders);
}
protected function loadComplete(_arg1:Event):void{
var _local2:Loader;
var _local3:uint;
_local2 = Loader(_arg1.currentTarget.loader);
__loadedLoaders.push(_local2);
_local3 = (__loadQueue.indexOf(__currentLoad) + 1);
if (_local3 < __loadQueue.length){
load(__loadQueue[_local3]);
} else {
this.removeEventListener(Event.ENTER_FRAME, checkQueueProgress);
dispatchEvent(new Event(DocumentPreloader.QUEUE_LOAD_COMPLETE));
};
_local2.removeEventListener(Event.COMPLETE, loadComplete);
}
protected function checkRootLoadProgress(_arg1:Event):void{
__progress = ((loaderInfo.bytesLoaded / loaderInfo.bytesTotal) / (__loadQueue.length + 1));
if (loaderInfo.bytesLoaded == loaderInfo.bytesTotal){
dispatchEvent(new Event(DocumentPreloader.ROOT_LOAD_COMPLETE));
this.removeEventListener(Event.ENTER_FRAME, checkRootLoadProgress);
};
}
protected function checkQueueProgress(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
_local2 = (__currentLoader.contentLoaderInfo.bytesLoaded / __currentLoader.contentLoaderInfo.bytesTotal);
_local3 = ((__loadQueue.indexOf(__currentLoad) + 1) + _local2);
__progress = (_local3 / (__loadQueue.length + 1));
}
public function startLoad():void{
if (!__loadQueue.length){
return;
};
load(__loadQueue[0]);
this.addEventListener(Event.ENTER_FRAME, checkQueueProgress, false, 0, true);
}
public function addToQueue(_arg1:String):void{
if (__loadQueue.indexOf(_arg1) == -1){
__loadQueue.push(_arg1);
};
}
public function get externalFiles():Dictionary{
var _local1:Dictionary;
var _local2:uint;
_local1 = new Dictionary();
_local2 = __loadQueue.length;
while (_local2--) {
_local1[__loadQueue[_local2]] = __loadedLoaders[_local2];
};
return (_local1);
}
protected function onAddedToStage(_arg1:Event):void{
this.removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
this.addEventListener(Event.ENTER_FRAME, checkRootLoadProgress, false, 0, true);
}
protected function load(_arg1:String):void{
__currentLoad = _arg1;
__currentLoader = new Loader();
__currentLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete, false, 0, true);
__currentLoader.load(new URLRequest(_arg1));
}
}
}//package com.zincroe.display
Section 43
//SoundToggle (com.zincroe.display.SoundToggle)
package com.zincroe.display {
import flash.display.*;
import flash.events.*;
import flash.media.*;
public class SoundToggle extends MovieClip {
private var _target:Sprite;
public function SoundToggle(_arg1:Sprite=null){
this.target = _arg1;
addEventListener(MouseEvent.CLICK, onClick, false, 0, true);
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
stop();
}
public function set target(_arg1:Sprite):void{
_target = _arg1;
}
public function get target():Sprite{
return (_target);
}
private function onAddedToStage(_arg1:Event):void{
if (target){
if (target.soundTransform.volume){
gotoAndStop("on");
} else {
gotoAndStop("off");
};
} else {
if (SoundMixer.soundTransform.volume){
gotoAndStop("on");
} else {
gotoAndStop("off");
};
};
}
private function onClick(_arg1:MouseEvent):void{
if (target){
if (target.soundTransform.volume){
target.soundTransform = new SoundTransform(0, target.soundTransform.pan);
gotoAndStop("off");
} else {
target.soundTransform = new SoundTransform(1, target.soundTransform.pan);
gotoAndStop("on");
};
} else {
if (SoundMixer.soundTransform.volume){
SoundMixer.soundTransform = new SoundTransform(0, SoundMixer.soundTransform.pan);
gotoAndStop("off");
} else {
SoundMixer.soundTransform = new SoundTransform(1, SoundMixer.soundTransform.pan);
gotoAndStop("on");
};
};
}
}
}//package com.zincroe.display
Section 44
//TimeBar (com.zincroe.display.TimeBar)
package com.zincroe.display {
import flash.utils.*;
import flash.events.*;
public class TimeBar extends EventDispatcher {
private const DEFAULT_BLINK_TIME:Number = 5000;
private const DEFAULT_TOTAL_TIME:Number = 30000;
private var __pauseTime:Number;
private var __pause:Boolean;
private var __timeTotalValue:Number;
private var __timeRemainingValue:Number;
private var __blinkTime:Number;
private var __blinking:Boolean;
private var __intervals:Array;
private var __startTime:Number;
public static const TIME_START:String = "timeStart";
public static const TIME_DONE:String = "timeDone";
public static const BLINK_END:String = "blinkEnd";
public static const BLINK_START:String = "blinkStart";
public function TimeBar(){
__intervals = [];
__pause = false;
__blinking = false;
timeTotalValue = DEFAULT_TOTAL_TIME;
blinkTime = DEFAULT_BLINK_TIME;
}
private function updateIntervals():void{
var _local1:int;
var _local2:Object;
_local1 = 0;
while (_local1 < __intervals.length) {
_local2 = __intervals[_local1];
updateInterval(_local2);
_local1++;
};
}
public function subtractTime(_arg1:Number):void{
__startTime = (__startTime - _arg1);
}
public function set timeTotalValue(_arg1:Number):void{
__timeTotalValue = _arg1;
}
public function addTime(_arg1:Number):void{
if ((timeRemainingValue + _arg1) <= timeTotalValue){
__startTime = (__startTime + _arg1);
} else {
__startTime = (__startTime + (timeTotalValue - timeRemainingValue));
};
}
public function set timeRemainingValue(_arg1:Number):void{
__timeRemainingValue = _arg1;
}
public function set blinkTime(_arg1:Number):void{
__blinkTime = _arg1;
}
public function addInterval(_arg1:Number, _arg2:Function):Object{
var _local3:Object;
_local3 = {offset:_arg1, listener:_arg2, lastCheck:0};
__intervals.push(_local3);
return (_local3);
}
public function clearAllIntervals():void{
while (__intervals.length) {
__intervals.shift();
};
}
private function updateInterval(_arg1:Object):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local2 = (timeTotalValue - timeRemainingValue);
_local3 = Math.floor((_local2 / _arg1.offset));
_local4 = (_local2 - (_arg1.offset * _local3));
if (_local4 < _arg1.lastCheck){
_arg1.listener();
};
_arg1.lastCheck = _local4;
}
public function get timeTotalValue():Number{
return (__timeTotalValue);
}
private function resetIntervals():void{
var _local1:int;
var _local2:Object;
_local1 = 0;
while (_local1 < __intervals.length) {
_local2 = __intervals[_local1];
_local2.lastCheck = 0;
_local1++;
};
}
public function get timeRemainingValue():Number{
return (__timeRemainingValue);
}
public function update():void{
var _local1:Number;
_local1 = (getTimer() - __startTime);
if (!pause){
timeRemainingValue = (timeTotalValue - _local1);
};
if (!isNaN(__blinkTime)){
if (timeRemainingValue <= __blinkTime){
if (!__blinking){
__blinking = true;
dispatchEvent(new Event(TimeBar.BLINK_START));
};
} else {
if (__blinking){
__blinking = false;
dispatchEvent(new Event(TimeBar.BLINK_END));
};
};
};
if (timeRemainingValue <= 0){
dispatchEvent(new Event(TimeBar.BLINK_END));
dispatchEvent(new Event(TimeBar.TIME_DONE));
timeRemainingValue = 0;
};
updateIntervals();
}
public function get isBlinking():Boolean{
return (__blinking);
}
public function get blinkTime():Number{
return (__blinkTime);
}
public function start():void{
if (isNaN(timeTotalValue)){
throw (new Error("timeTotalValue must be set before start() method can be called"));
};
__startTime = getTimer();
resetIntervals();
dispatchEvent(new Event(TimeBar.TIME_START));
}
public function removeInterval(_arg1:Object):Boolean{
var _local2:int;
_local2 = __intervals.indexOf(_arg1);
if (_local2 != -1){
__intervals.splice(_local2, 1);
return (true);
};
return (false);
}
public function set pause(_arg1:Boolean):void{
if (((__pause) && (!(_arg1)))){
__startTime = (__startTime + (getTimer() - __pauseTime));
} else {
if (_arg1){
__pauseTime = getTimer();
};
};
__pause = _arg1;
}
public function get pause():Boolean{
return (__pause);
}
}
}//package com.zincroe.display
Section 45
//CheatCodeEnabled (com.zincroe.games.screens.sounds.CheatCodeEnabled)
package com.zincroe.games.screens.sounds {
import flash.media.*;
public dynamic class CheatCodeEnabled extends Sound {
}
}//package com.zincroe.games.screens.sounds
Section 46
//CheatCodeScreen (com.zincroe.games.screens.CheatCodeScreen)
package com.zincroe.games.screens {
import com.zincroe.games.*;
import flash.utils.*;
import flash.display.*;
import flash.events.*;
import fl.transitions.*;
import flash.text.*;
import fl.transitions.easing.*;
public class CheatCodeScreen extends Screen {
private var _continueButton:DisplayObject;
private var _cheats:Object;
private var _cheatCodeMessageTween:Tween;
private var _cheatCodeField:TextField;
private var _cheatCodeMessage:DisplayObject;
private var _cheatCodeMessageTimer:Timer;
public static const SOUND_CHEAT_CODE_ENABLED:String = "com.zincroe.games.screens.sounds.CheatCodeEnabled";
public function get cheats():Object{
return (_cheats);
}
protected function onClick(_arg1:MouseEvent):void{
switch (_arg1.target){
case continueButton:
pause();
gameProperties.screenManager.showInstructionScreen(this);
break;
};
}
public function set cheatCodeMessageTimer(_arg1:Timer):void{
_cheatCodeMessageTimer = _arg1;
}
public function get cheatCodeMessageTimer():Timer{
return (_cheatCodeMessageTimer);
}
public function set cheatCodeMessage(_arg1:DisplayObject):void{
_cheatCodeMessage = _arg1;
}
protected function stopCheatCodeMessageTimer():void{
if (cheatCodeMessageTimer){
cheatCodeMessageTimer.stop();
cheatCodeMessageTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onCheatCodeMessageTimerComplete);
cheatCodeMessageTimer = null;
};
}
public function get cheatCodeMessageTween():Tween{
return (_cheatCodeMessageTween);
}
public function set cheatCodeField(_arg1:TextField):void{
if (cheatCodeField != _arg1){
_cheatCodeField = _arg1;
if (cheatCodeField){
cheatCodeField.multiline = false;
cheatCodeField.text = "";
cheatCodeField.type = TextFieldType.INPUT;
cheatCodeField.wordWrap = false;
};
};
}
public function set cheatCodeMessageTween(_arg1:Tween):void{
_cheatCodeMessageTween = _arg1;
}
public function set cheats(_arg1:Object):void{
_cheats = _arg1;
}
override public function start():void{
cheats = gameProperties.cheats;
addEventListener(MouseEvent.CLICK, onClick);
enableCheatCodeField();
hideCheatCodeMessage();
}
protected function stopCheatCodeMessageTween():void{
if (cheatCodeMessageTween){
cheatCodeMessageTween.stop();
cheatCodeMessageTween.removeEventListener(TweenEvent.MOTION_FINISH, onCheatCodeMessageTweenComplete);
cheatCodeMessageTween = null;
};
}
public function get cheatCodeMessage():DisplayObject{
return (_cheatCodeMessage);
}
protected function disableCheatCodeField():void{
if (cheatCodeField){
cheatCodeField.type = TextFieldType.DYNAMIC;
cheatCodeField.removeEventListener(TextEvent.TEXT_INPUT, onTextInput);
};
}
public function set continueButton(_arg1:DisplayObject):void{
_continueButton = _arg1;
}
public function get cheatCodeField():TextField{
return (_cheatCodeField);
}
protected function showCheatCodeMessage():void{
if (cheatCodeMessage){
cheatCodeMessage.alpha = 1;
addChild(cheatCodeMessage);
};
}
protected function onTextInput(_arg1:TextEvent):void{
var _local2:String;
var _local3:Cheat;
if (_arg1.text == "*"){
_arg1.preventDefault();
_arg1.stopImmediatePropagation();
} else {
_local2 = (cheatCodeField.text + _arg1.text);
for each (_local3 in cheats) {
if (_local3.code == _local2){
_local3.enabled = true;
stopCheatCodeMessageTimer();
stopCheatCodeMessageTween();
disableCheatCodeField();
showCheatCodeMessage();
startCheatCodeMessageTimer();
gameProperties.sound.play(SOUND_CHEAT_CODE_ENABLED);
break;
};
};
};
}
public function get continueButton():DisplayObject{
return (_continueButton);
}
protected function startCheatCodeMessageTimer():void{
cheatCodeMessageTimer = new Timer(1000, 1);
cheatCodeMessageTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onCheatCodeMessageTimerComplete);
cheatCodeMessageTimer.start();
}
protected function onCheatCodeMessageTimerComplete(_arg1:TimerEvent=null):void{
stopCheatCodeMessageTimer();
enableCheatCodeField();
startCheatCodeMessageTween();
}
protected function enableCheatCodeField():void{
if (cheatCodeField){
stage.focus = cheatCodeField;
cheatCodeField.type = TextFieldType.INPUT;
cheatCodeField.text = "";
cheatCodeField.setSelection(0, 0);
cheatCodeField.addEventListener(TextEvent.TEXT_INPUT, onTextInput);
};
}
protected function onCheatCodeMessageTweenComplete(_arg1:TweenEvent=null):void{
stopCheatCodeMessageTween();
hideCheatCodeMessage();
}
protected function hideCheatCodeMessage():void{
if (((cheatCodeMessage) && (contains(cheatCodeMessage)))){
removeChild(cheatCodeMessage);
};
}
protected function startCheatCodeMessageTween():void{
cheatCodeMessageTween = new Tween(cheatCodeMessage, "alpha", Strong.easeOut, 1, 0, 1, true);
cheatCodeMessageTween.addEventListener(TweenEvent.MOTION_FINISH, onCheatCodeMessageTweenComplete);
}
override public function pause():void{
removeEventListener(MouseEvent.CLICK, onClick);
stopCheatCodeMessageTimer();
stopCheatCodeMessageTween();
hideCheatCodeMessage();
disableCheatCodeField();
}
}
}//package com.zincroe.games.screens
Section 47
//HighScoreScreen (com.zincroe.games.screens.HighScoreScreen)
package com.zincroe.games.screens {
import com.zincroe.games.*;
import flash.display.*;
import flash.events.*;
public class HighScoreScreen extends Screen {
private var _highScores:Array;
private var _listContainer:MovieClip;
private var _playAgainButton:DisplayObject;
public function set listContainer(_arg1:MovieClip):void{
_listContainer = _arg1;
}
public function get highScores():Array{
return (_highScores);
}
override public function start():void{
var _local1:uint;
var _local2:Object;
var _local3:MovieClip;
_local1 = 0;
while (_local1 < listContainer.numChildren) {
_local3 = (listContainer.getChildByName(("item" + _local1)) as MovieClip);
if (_local3){
_local2 = (highScores) ? highScores[_local1] : null;
if (_local2){
_local3.nameField.text = String(_local2.name);
_local3.rankField.text = String(_local2.rank);
_local3.scoreField.text = String(_local2.score);
} else {
_local3.nameField.text = "";
_local3.rankField.text = "";
_local3.scoreField.text = "";
};
};
_local1++;
};
addEventListener(MouseEvent.CLICK, onClick);
}
public function get listContainer():MovieClip{
return (_listContainer);
}
public function set playAgainButton(_arg1:DisplayObject):void{
_playAgainButton = _arg1;
}
public function set highScores(_arg1:Array):void{
_highScores = _arg1;
}
public function get playAgainButton():DisplayObject{
return (_playAgainButton);
}
protected function onClick(_arg1:MouseEvent):void{
switch (_arg1.target){
case playAgainButton:
pause();
gameProperties.screenManager.showInstructionScreen(this);
break;
};
}
override public function pause():void{
removeEventListener(MouseEvent.CLICK, onClick);
}
}
}//package com.zincroe.games.screens
Section 48
//InstructionScreen (com.zincroe.games.screens.InstructionScreen)
package com.zincroe.games.screens {
import com.zincroe.games.*;
import flash.display.*;
import flash.events.*;
public class InstructionScreen extends Screen {
private var _continueButton:DisplayObject;
override public function start():void{
addEventListener(MouseEvent.CLICK, onClick);
}
public function set continueButton(_arg1:DisplayObject):void{
_continueButton = _arg1;
}
public function get continueButton():DisplayObject{
return (_continueButton);
}
protected function onClick(_arg1:MouseEvent):void{
switch (_arg1.target){
case continueButton:
pause();
gameProperties.screenManager.showSetupScreen(this);
break;
};
}
override public function pause():void{
removeEventListener(MouseEvent.CLICK, onClick);
}
}
}//package com.zincroe.games.screens
Section 49
//LoseScreen (com.zincroe.games.screens.LoseScreen)
package com.zincroe.games.screens {
import com.zincroe.games.*;
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class LoseScreen extends Screen {
private var _highScoreButton:DisplayObject;
private var _scoreField:TextField;
private var _engine:MovieClip;
private var _playAgainButton:DisplayObject;
public function set scoreField(_arg1:TextField):void{
_scoreField = _arg1;
}
override public function start():void{
scoreField.text = String(gameProperties.screenManager.engine.score);
addEventListener(MouseEvent.CLICK, onClick);
}
public function get highScoreButton():DisplayObject{
return (_highScoreButton);
}
public function get engine():MovieClip{
return (_engine);
}
public function set engine(_arg1:MovieClip):void{
_engine = _arg1;
}
public function get scoreField():TextField{
return (_scoreField);
}
public function set playAgainButton(_arg1:DisplayObject):void{
_playAgainButton = _arg1;
}
public function set highScoreButton(_arg1:DisplayObject):void{
_highScoreButton = _arg1;
}
public function get playAgainButton():DisplayObject{
return (_playAgainButton);
}
protected function onClick(_arg1:MouseEvent):void{
switch (_arg1.target){
case highScoreButton:
pause();
gameProperties.screenManager.showHighScoreScreen(this);
break;
case playAgainButton:
pause();
gameProperties.screenManager.showInstructionScreen(this);
break;
};
}
override public function pause():void{
removeEventListener(MouseEvent.CLICK, onClick);
}
}
}//package com.zincroe.games.screens
Section 50
//SetupScreen (com.zincroe.games.screens.SetupScreen)
package com.zincroe.games.screens {
import com.zincroe.games.*;
public class SetupScreen extends Screen {
override public function start():void{
gameProperties.setup = new Object();
pause();
gameProperties.screenManager.showEngine(this);
}
override public function pause():void{
}
}
}//package com.zincroe.games.screens
Section 51
//TitleScreen (com.zincroe.games.screens.TitleScreen)
package com.zincroe.games.screens {
import com.zincroe.games.*;
import flash.display.*;
import flash.events.*;
import flash.ui.*;
public class TitleScreen extends Screen {
private var _highScoreButton:DisplayObject;
private var _playButton:DisplayObject;
public function set playButton(_arg1:DisplayObject):void{
_playButton = _arg1;
}
override public function start():void{
super.start();
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
addEventListener(MouseEvent.CLICK, onClick);
}
public function get highScoreButton():DisplayObject{
return (_highScoreButton);
}
public function get playButton():DisplayObject{
return (_playButton);
}
protected function onKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.NUMPAD_MULTIPLY){
pause();
gameProperties.screenManager.showCheatCodeScreen(this);
};
}
public function set highScoreButton(_arg1:DisplayObject):void{
_highScoreButton = _arg1;
}
protected function onClick(_arg1:MouseEvent):void{
switch (_arg1.target){
case highScoreButton:
pause();
gameProperties.screenManager.showHighScoreScreen(this);
break;
case playButton:
pause();
gameProperties.screenManager.showInstructionScreen(this);
break;
};
}
override public function pause():void{
super.pause();
stage.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
removeEventListener(MouseEvent.CLICK, onClick);
}
}
}//package com.zincroe.games.screens
Section 52
//WinScreen (com.zincroe.games.screens.WinScreen)
package com.zincroe.games.screens {
import com.zincroe.games.*;
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class WinScreen extends Screen {
private var _highScoreButton:DisplayObject;
private var _scoreField:TextField;
private var _playAgainButton:DisplayObject;
public function set scoreField(_arg1:TextField):void{
_scoreField = _arg1;
}
override public function start():void{
scoreField.text = String(gameProperties.screenManager.engine.score);
addEventListener(MouseEvent.CLICK, onClick);
}
public function get highScoreButton():DisplayObject{
return (_highScoreButton);
}
public function get scoreField():TextField{
return (_scoreField);
}
public function set playAgainButton(_arg1:DisplayObject):void{
_playAgainButton = _arg1;
}
public function set highScoreButton(_arg1:DisplayObject):void{
_highScoreButton = _arg1;
}
public function get playAgainButton():DisplayObject{
return (_playAgainButton);
}
protected function onClick(_arg1:MouseEvent):void{
switch (_arg1.target){
case highScoreButton:
pause();
gameProperties.screenManager.showHighScoreScreen(this);
break;
case playAgainButton:
pause();
gameProperties.screenManager.showInstructionScreen(this);
break;
};
}
override public function pause():void{
removeEventListener(MouseEvent.CLICK, onClick);
}
}
}//package com.zincroe.games.screens
Section 53
//Cheat (com.zincroe.games.Cheat)
package com.zincroe.games {
public class Cheat {
private var _enabled:Boolean;
private var _code:String;
public function Cheat(_arg1:String=null, _arg2:Boolean=false){
this.code = _arg1;
this.enabled = _arg2;
}
public function get enabled():Boolean{
return (_enabled);
}
public function set enabled(_arg1:Boolean):void{
_enabled = _arg1;
}
public function get code():String{
return (_code);
}
public function set code(_arg1:String):void{
_code = _arg1;
}
}
}//package com.zincroe.games
Section 54
//Engine (com.zincroe.games.Engine)
package com.zincroe.games {
import flash.events.*;
public class Engine extends Screen {
private var _score:int;
public function set score(_arg1:uint):void{
_score = _arg1;
}
override public function start():void{
this.addEventListener(Event.ENTER_FRAME, update, false, 0, true);
}
public function get score():uint{
return (_score);
}
protected function update(_arg1:Event):void{
}
override public function pause():void{
this.removeEventListener(Event.ENTER_FRAME, update);
}
}
}//package com.zincroe.games
Section 55
//Game (com.zincroe.games.Game)
package com.zincroe.games {
import com.zincroe.media.*;
import flash.display.*;
public class Game extends MovieClip {
public var cheatCodeScreen:MovieClip;
public var titleScreen:MovieClip;
public var setupScreen:MovieClip;
public var winScreen:MovieClip;
public var engine:MovieClip;
public var instructionScreen:MovieClip;
public var levelUpScreen:MovieClip;
public var highScoreScreen:MovieClip;
public var gameProperties:GameProperties;
public var loadingScreen:MovieClip;
public var loseScreen:MovieClip;
public function Game(){
var _local1:ScreenManager;
super();
initGameProperties();
_local1 = gameProperties.screenManager;
if (engine){
engine.initLanguage();
_local1.engine = engine;
removeChild(engine);
};
if (cheatCodeScreen){
cheatCodeScreen.initLanguage();
_local1.cheatCodeScreen = cheatCodeScreen;
removeChild(cheatCodeScreen);
};
if (highScoreScreen){
highScoreScreen.initLanguage();
_local1.highScoreScreen = highScoreScreen;
removeChild(highScoreScreen);
};
if (instructionScreen){
instructionScreen.initLanguage();
_local1.instructionScreen = instructionScreen;
removeChild(instructionScreen);
};
if (levelUpScreen){
levelUpScreen.initLanguage();
_local1.levelUpScreen = levelUpScreen;
removeChild(levelUpScreen);
};
if (loadingScreen){
loadingScreen.initLanguage();
_local1.loadingScreen = loadingScreen;
removeChild(loadingScreen);
};
if (loseScreen){
loseScreen.initLanguage();
_local1.loseScreen = loseScreen;
removeChild(loseScreen);
};
if (setupScreen){
setupScreen.initLanguage();
_local1.setupScreen = setupScreen;
removeChild(setupScreen);
};
if (titleScreen){
titleScreen.initLanguage();
_local1.titleScreen = titleScreen;
removeChild(titleScreen);
};
if (winScreen){
winScreen.initLanguage();
_local1.winScreen = winScreen;
removeChild(winScreen);
};
addChild(_local1);
_local1.showTitleScreen(this);
}
protected function initGameProperties():void{
gameProperties = GameProperties.getInstance();
gameProperties.screenManager = new ScreenManager();
gameProperties.cheats = new Object();
gameProperties.sound = new SimpleSoundManager();
gameProperties.music = new SimpleSoundManager();
}
}
}//package com.zincroe.games
Section 56
//GameProperties (com.zincroe.games.GameProperties)
package com.zincroe.games {
import flash.utils.*;
import com.zincroe.media.*;
public class GameProperties {
private var __settings;
private var __preloadedExternalFiles:Dictionary;
private var __music:SimpleSoundManager;
private var __screenManager:ScreenManager;
private var __setup:Object;
private var __cheats:Object;
private var __sound:SimpleSoundManager;
private var __language:String;
private static var __instance:GameProperties;
private static var __allowInstance:Boolean;
public function GameProperties(){
if (!__allowInstance){
throw (new Error("Can't create another instance of GameProperties. It's a singleton."));
};
}
public function set screenManager(_arg1:ScreenManager):void{
__screenManager = _arg1;
}
public function set settings(_arg1):void{
__settings = _arg1;
}
public function set music(_arg1:SimpleSoundManager):void{
__music = _arg1;
}
public function set setup(_arg1:Object):void{
__setup = _arg1;
}
public function get sound():SimpleSoundManager{
return (__sound);
}
public function set preloadedExternalFiles(_arg1:Dictionary):void{
__preloadedExternalFiles = _arg1;
}
public function get language():String{
return (__language);
}
public function get screenManager():ScreenManager{
return (__screenManager);
}
public function get cheats():Object{
return (__cheats);
}
public function get settings(){
return (__settings);
}
public function get preloadedExternalFiles():Dictionary{
return (__preloadedExternalFiles);
}
public function set sound(_arg1:SimpleSoundManager):void{
__sound = _arg1;
}
public function get music():SimpleSoundManager{
return (__music);
}
public function set cheats(_arg1:Object):void{
__cheats = _arg1;
}
public function set language(_arg1:String):void{
__language = _arg1;
}
public function get setup():Object{
return (__setup);
}
public static function getInstance():GameProperties{
if (!__instance){
__allowInstance = true;
__instance = new (GameProperties);
__allowInstance = false;
};
return (__instance);
}
}
}//package com.zincroe.games
Section 57
//Screen (com.zincroe.games.Screen)
package com.zincroe.games {
import flash.display.*;
public class Screen extends MovieClip {
private var __gameProperties:GameProperties;
public function Screen(){
stop();
gameProperties = GameProperties.getInstance();
}
public function start():void{
}
public function set gameProperties(_arg1:GameProperties):void{
__gameProperties = _arg1;
}
public function initLanguage():void{
}
public function get gameProperties():GameProperties{
return (__gameProperties);
}
public function pause():void{
}
}
}//package com.zincroe.games
Section 58
//ScreenManager (com.zincroe.games.ScreenManager)
package com.zincroe.games {
import flash.display.*;
public class ScreenManager extends MovieClip {
private var _instructionScreen:MovieClip;
private var _titleScreen:MovieClip;
private var _highScoreScreen:MovieClip;
private var _engine:MovieClip;
private var _loseScreen:MovieClip;
private var _setupScreen:MovieClip;
private var _cheatCodeScreen:MovieClip;
private var _language:String;
private var _levelUpScreen:MovieClip;
private var _loadingScreen:MovieClip;
private var _winScreen:MovieClip;
public function ScreenManager(){
stop();
}
public function get cheatCodeScreen():MovieClip{
return (_cheatCodeScreen);
}
public function set cheatCodeScreen(_arg1:MovieClip):void{
_cheatCodeScreen = _arg1;
}
public function get titleScreen():MovieClip{
return (_titleScreen);
}
public function showWinScreen(_arg1:Object=null):void{
clear();
addChild(winScreen);
winScreen.start();
}
public function showInstructionScreen(_arg1:Object=null):void{
clear();
addChild(instructionScreen);
instructionScreen.start();
}
public function set levelUpScreen(_arg1:MovieClip):void{
_levelUpScreen = _arg1;
}
public function set highScoreScreen(_arg1:MovieClip):void{
_highScoreScreen = _arg1;
}
public function set instructionScreen(_arg1:MovieClip):void{
_instructionScreen = _arg1;
}
public function showCheatCodeScreen(_arg1:Object=null):void{
clear();
addChild(cheatCodeScreen);
cheatCodeScreen.start();
}
public function showSetupScreen(_arg1:Object=null):void{
if (setupScreen){
clear();
addChild(setupScreen);
setupScreen.start();
} else {
showEngine(_arg1);
};
}
public function get setupScreen():MovieClip{
return (_setupScreen);
}
public function get engine():MovieClip{
return (_engine);
}
public function set engine(_arg1:MovieClip):void{
_engine = _arg1;
}
public function set loadingScreen(_arg1:MovieClip):void{
_loadingScreen = _arg1;
}
public function get winScreen():MovieClip{
return (_winScreen);
}
public function get instructionScreen():MovieClip{
return (_instructionScreen);
}
public function showLevelUpScreen(_arg1:Object=null):void{
clear();
addChild(levelUpScreen);
levelUpScreen.start();
}
public function showEngine(_arg1:Object=null):void{
clear();
addChild(engine);
engine.start();
}
public function set setupScreen(_arg1:MovieClip):void{
_setupScreen = _arg1;
}
public function showTitleScreen(_arg1:Object=null):void{
clear();
addChild(titleScreen);
titleScreen.start();
}
protected function clear():void{
var _local1:DisplayObject;
while (numChildren) {
_local1 = getChildAt(0);
removeChild(_local1);
};
}
public function get highScoreScreen():MovieClip{
return (_highScoreScreen);
}
public function showLoseScreen(_arg1:Object=null):void{
clear();
addChild(loseScreen);
loseScreen.start();
}
public function get loadingScreen():MovieClip{
return (_loadingScreen);
}
public function set winScreen(_arg1:MovieClip):void{
_winScreen = _arg1;
}
public function get levelUpScreen():MovieClip{
return (_levelUpScreen);
}
public function set titleScreen(_arg1:MovieClip):void{
_titleScreen = _arg1;
}
public function set loseScreen(_arg1:MovieClip):void{
_loseScreen = _arg1;
}
public function get loseScreen():MovieClip{
return (_loseScreen);
}
public function showHighScoreScreen(_arg1:Object=null):void{
clear();
addChild(highScoreScreen);
highScoreScreen.start();
}
}
}//package com.zincroe.games
Section 59
//SimpleSound (com.zincroe.media.SimpleSound)
package com.zincroe.media {
import flash.events.*;
import flash.media.*;
import flash.net.*;
import com.zincroe.utils.*;
public class SimpleSound extends EventDispatcher {
private var _sound:Sound;
private var _channels:Array;
private var _defaultOptions:SimpleSoundOptions;
public function SimpleSound(_arg1:Sound, _arg2:Object=null){
setChannels(new Array());
setSound(_arg1);
defaultOptions = new SimpleSoundOptions(_arg2);
}
public function stop():void{
var channels:Array;
channels = getChannels();
ArrayUtil.each(channels, function (_arg1:SimpleSoundChannel):void{
_arg1.stop();
});
}
private function onSoundStop(_arg1:Event):void{
var _local2:SimpleSoundChannel;
var _local3:Array;
_local2 = (_arg1.target as SimpleSoundChannel);
_local2.removeEventListener(SimpleSoundChannelEvent.FADE_CHANGE, dispatchEvent);
_local2.removeEventListener(SimpleSoundChannelEvent.FADE_COMPLETE, dispatchEvent);
_local2.removeEventListener(SimpleSoundChannelEvent.FADE_START, dispatchEvent);
_local2.removeEventListener(SimpleSoundChannelEvent.FADE_STOP, dispatchEvent);
_local2.removeEventListener(SimpleSoundChannelEvent.PAN_CHANGE, dispatchEvent);
_local2.removeEventListener(SimpleSoundChannelEvent.PAN_COMPLETE, dispatchEvent);
_local2.removeEventListener(SimpleSoundChannelEvent.PAN_START, dispatchEvent);
_local2.removeEventListener(SimpleSoundChannelEvent.PAN_STOP, dispatchEvent);
_local2.removeEventListener(SimpleSoundChannelEvent.SOUND_COMPLETE, dispatchEvent);
_local2.removeEventListener(SimpleSoundChannelEvent.SOUND_STOP, dispatchEvent);
_local2.removeEventListener(SimpleSoundChannelEvent.SOUND_STOP, onSoundStop);
_local3 = getChannels();
_local3 = ArrayUtil.remove(_local3, _local2);
setChannels(_local3);
}
public function get isBuffering():Boolean{
var _local1:Sound;
_local1 = getSound();
return (_local1.isBuffering);
}
public function get bytesTotal():uint{
var _local1:Sound;
_local1 = getSound();
return (_local1.bytesTotal);
}
public function pan(_arg1:Number=0):void{
panStart(0, NaN, _arg1);
}
public function fadeStop():void{
var channels:Array;
channels = getChannels();
ArrayUtil.each(channels, function (_arg1:SimpleSoundChannel):void{
_arg1.fadeStop();
});
}
public function volume(_arg1:Number=1):void{
fadeStart(0, NaN, _arg1);
}
public function get defaultOptions():SimpleSoundOptions{
return (_defaultOptions);
}
public function get id3():ID3Info{
var _local1:Sound;
_local1 = getSound();
return (_local1.id3);
}
public function get isPlaying():Boolean{
return (getIsPlaying());
}
public function fadeOut(_arg1:Number):void{
var channels:Array;
var duration = _arg1;
channels = getChannels();
ArrayUtil.each(channels, function (_arg1:SimpleSoundChannel):void{
_arg1.fadeOut(duration);
});
}
public function play(_arg1:Object=null):SimpleSoundChannel{
var channel:SimpleSoundChannel;
var channels:Array;
var sound:Sound;
var options = _arg1;
sound = getSound();
options = new SimpleSoundOptions(defaultOptions, options);
if (options.mode === SimpleSoundOptions.PLAY_NEW){
stop();
};
if ((((((options.mode === SimpleSoundOptions.PLAY_ALL)) || ((options.mode === SimpleSoundOptions.PLAY_NEW)))) || (!(isPlaying)))){
try {
channel = new SimpleSoundChannel(sound.play(options.offset, options.loop), this);
channel.volume = options.volume;
channel.pan = options.pan;
channel.addEventListener(SimpleSoundChannelEvent.FADE_CHANGE, dispatchEvent, false, 0, true);
channel.addEventListener(SimpleSoundChannelEvent.FADE_COMPLETE, dispatchEvent, false, 0, true);
channel.addEventListener(SimpleSoundChannelEvent.FADE_START, dispatchEvent, false, 0, true);
channel.addEventListener(SimpleSoundChannelEvent.FADE_STOP, dispatchEvent, false, 0, true);
channel.addEventListener(SimpleSoundChannelEvent.PAN_CHANGE, dispatchEvent, false, 0, true);
channel.addEventListener(SimpleSoundChannelEvent.PAN_COMPLETE, dispatchEvent, false, 0, true);
channel.addEventListener(SimpleSoundChannelEvent.PAN_START, dispatchEvent, false, 0, true);
channel.addEventListener(SimpleSoundChannelEvent.PAN_STOP, dispatchEvent, false, 0, true);
channel.addEventListener(SimpleSoundChannelEvent.SOUND_COMPLETE, dispatchEvent, false, 0, true);
channel.addEventListener(SimpleSoundChannelEvent.SOUND_STOP, dispatchEvent, false, 0, true);
channel.addEventListener(SimpleSoundChannelEvent.SOUND_STOP, onSoundStop, false, 0, true);
channels = getChannels();
channels = ArrayUtil.add(channels, channel);
setChannels(channels);
} catch(error:ArgumentError) {
};
};
return (channel);
}
public function set defaultOptions(_arg1:SimpleSoundOptions):void{
_defaultOptions = _arg1;
}
public function panStop():void{
var channels:Array;
channels = getChannels();
ArrayUtil.each(channels, function (_arg1:SimpleSoundChannel):void{
_arg1.panStop();
});
}
public function fadeIn(_arg1:Number):void{
var channels:Array;
var duration = _arg1;
channels = getChannels();
ArrayUtil.each(channels, function (_arg1:SimpleSoundChannel):void{
_arg1.fadeIn(duration);
});
}
public function panLeft(_arg1:Number):void{
var channels:Array;
var duration = _arg1;
channels = getChannels();
ArrayUtil.each(channels, function (_arg1:SimpleSoundChannel):void{
_arg1.panLeft(duration);
});
}
public function panStart(_arg1:Number, _arg2:Number=NaN, _arg3:Number=NaN):void{
var channels:Array;
var duration = _arg1;
var start = _arg2;
var finish = _arg3;
channels = getChannels();
ArrayUtil.each(channels, function (_arg1:SimpleSoundChannel):void{
_arg1.panStart(duration, start, finish);
});
}
public function fadeStart(_arg1:Number, _arg2:Number=NaN, _arg3:Number=NaN):void{
var channels:Array;
var duration = _arg1;
var start = _arg2;
var finish = _arg3;
channels = getChannels();
ArrayUtil.each(channels, function (_arg1:SimpleSoundChannel):void{
_arg1.fadeStart(duration, start, finish);
});
}
public function get bytesLoaded():uint{
var _local1:Sound;
_local1 = getSound();
return (_local1.bytesLoaded);
}
private function setChannels(_arg1:Array):void{
_channels = _arg1;
}
private function setSound(_arg1:Sound):void{
if (!_arg1){
throw (new ArgumentError("Sound cannot be null."));
};
_sound = _arg1;
_sound.addEventListener(Event.COMPLETE, dispatchEvent, false, 0, true);
_sound.addEventListener(Event.ID3, dispatchEvent, false, 0, true);
_sound.addEventListener(Event.OPEN, dispatchEvent, false, 0, true);
_sound.addEventListener(IOErrorEvent.IO_ERROR, dispatchEvent, false, 0, true);
_sound.addEventListener(ProgressEvent.PROGRESS, dispatchEvent, false, 0, true);
}
private function getChannels():Array{
return (_channels.concat());
}
public function get channels():Array{
return (getChannels());
}
private function getSound():Sound{
return (_sound);
}
public function panCenter(_arg1:Number):void{
var channels:Array;
var duration = _arg1;
channels = getChannels();
ArrayUtil.each(channels, function (_arg1:SimpleSoundChannel):void{
_arg1.panCenter(duration);
});
}
public function get length():Number{
var _local1:Sound;
_local1 = getSound();
return (_local1.length);
}
public function fadeOutAndStop(_arg1:Number):void{
var channels:Array;
var duration = _arg1;
channels = getChannels();
ArrayUtil.each(channels, function (_arg1:SimpleSoundChannel):void{
_arg1.fadeOutAndStop(duration);
});
}
public function load(_arg1:URLRequest, _arg2:SoundLoaderContext=null):void{
var _local3:Sound;
_local3 = getSound();
_local3.load(_arg1, _arg2);
}
private function getIsPlaying():Boolean{
return (((_channels) && (_channels.length)));
}
public function get url():String{
var _local1:Sound;
_local1 = getSound();
return (_local1.url);
}
public function close():void{
var _local1:Sound;
_local1 = getSound();
_local1.close();
}
public function panRight(_arg1:Number):void{
var channels:Array;
var duration = _arg1;
channels = getChannels();
ArrayUtil.each(channels, function (_arg1:SimpleSoundChannel):void{
_arg1.panRight(duration);
});
}
}
}//package com.zincroe.media
Section 60
//SimpleSoundChannel (com.zincroe.media.SimpleSoundChannel)
package com.zincroe.media {
import flash.events.*;
import flash.media.*;
import fl.transitions.*;
import fl.transitions.easing.*;
public class SimpleSoundChannel extends EventDispatcher {
private var _sound:SimpleSound;
private var _isPlaying:Boolean;
private var _panTween:Tween;
private var _volumeTween:Tween;
private var _channel:SoundChannel;
private var _isPanning:Boolean;
private var _isFading:Boolean;
public function SimpleSoundChannel(_arg1:SoundChannel, _arg2:SimpleSound){
setSound(_arg2);
setChannel(_arg1);
setIsPlaying(true);
}
public function stop():void{
var _local1:SoundChannel;
fadeStop();
panStop();
_local1 = getChannel();
_local1.stop();
setIsPlaying(false);
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.SOUND_STOP, false, false, this));
}
public function get isFading():Boolean{
return (getIsFading());
}
private function setIsFading(_arg1:Boolean):void{
_isFading = _arg1;
}
private function onFadeChange(_arg1:TweenEvent):void{
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.FADE_CHANGE, false, false, this));
}
private function setIsPanning(_arg1:Boolean):void{
_isPanning = _arg1;
}
private function onPanChange(_arg1:TweenEvent):void{
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.PAN_CHANGE, false, false, this));
}
private function getIsPanning():Boolean{
return (_isPanning);
}
public function get leftPeak():Number{
var _local1:SoundChannel;
_local1 = getChannel();
return (_local1.leftPeak);
}
public function get sound():SimpleSound{
return (getSound());
}
private function onPanComplete(_arg1:TweenEvent):void{
panStop();
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.PAN_COMPLETE, false, false, this));
}
public function get volume():Number{
return (getVolume());
}
public function get rightPeak():Number{
var _local1:SoundChannel;
_local1 = getChannel();
return (_local1.rightPeak);
}
private function setVolume(_arg1:Number):void{
var _local2:SoundChannel;
var _local3:Number;
_local2 = getChannel();
_local3 = getPan();
_local2.soundTransform = new SoundTransform(_arg1, _local3);
}
public function get pan():Number{
return (getPan());
}
public function fadeStop():void{
var _local1:Tween;
_local1 = getVolumeTween();
if (_local1){
_local1.removeEventListener(TweenEvent.MOTION_CHANGE, onFadeChange);
_local1.removeEventListener(TweenEvent.MOTION_FINISH, onFadeComplete);
_local1.stop();
setIsFading(false);
setVolumeTween(null);
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.FADE_STOP, false, false, this));
};
}
public function get isPlaying():Boolean{
return (getIsPlaying());
}
private function getVolume():Number{
var _local1:SoundChannel;
_local1 = getChannel();
return (_local1.soundTransform.volume);
}
public function get position():Number{
var _local1:SoundChannel;
_local1 = getChannel();
return (_local1.position);
}
public function get soundTransform():SoundTransform{
var _local1:SoundChannel;
_local1 = getChannel();
return (_local1.soundTransform);
}
private function setVolumeTween(_arg1:Tween):void{
_volumeTween = _arg1;
}
public function set volume(_arg1:Number):void{
setVolume(_arg1);
}
public function fadeOut(_arg1:Number):void{
fadeStart(_arg1, NaN, 0);
}
public function set pan(_arg1:Number):void{
setPan(_arg1);
}
private function getVolumeTween():Tween{
return (_volumeTween);
}
public function panStop():void{
var _local1:Tween;
_local1 = getPanTween();
if (_local1){
_local1.removeEventListener(TweenEvent.MOTION_CHANGE, onPanChange);
_local1.removeEventListener(TweenEvent.MOTION_FINISH, onPanComplete);
_local1.stop();
setIsPanning(false);
setPanTween(null);
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.PAN_STOP, false, false, this));
};
}
private function setChannel(_arg1:SoundChannel):void{
if (!_arg1){
throw (new ArgumentError("Channel cannot be null."));
};
_channel = _arg1;
_channel.addEventListener(Event.SOUND_COMPLETE, onSoundComplete);
}
public function panStart(_arg1:Number, _arg2:Number=NaN, _arg3:Number=NaN):void{
var _local4:Tween;
if (isNaN(_arg2)){
_arg2 = pan;
};
if (isNaN(_arg3)){
_arg3 = pan;
};
if (isNaN(_arg1)){
_arg1 = 0;
};
panStop();
if ((((_arg2 === _arg3)) || ((_arg1 <= 0)))){
pan = _arg2;
setIsPanning(true);
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.PAN_START, false, false, this));
pan = _arg3;
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.PAN_CHANGE, false, false, this));
setIsPanning(false);
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.PAN_STOP, false, false, this));
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.PAN_COMPLETE, false, false, this));
} else {
_local4 = new Tween(this, "pan", Regular.easeInOut, _arg2, _arg3, _arg1, true);
_local4.addEventListener(TweenEvent.MOTION_CHANGE, onPanChange);
_local4.addEventListener(TweenEvent.MOTION_FINISH, onPanComplete);
setIsPanning(true);
setPanTween(_local4);
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.PAN_START, false, false, this));
};
}
public function fadeStart(_arg1:Number, _arg2:Number=NaN, _arg3:Number=NaN):void{
var _local4:Tween;
if (isNaN(_arg2)){
_arg2 = volume;
};
if (isNaN(_arg3)){
_arg3 = volume;
};
if (isNaN(_arg1)){
_arg1 = 0;
};
fadeStop();
if ((((_arg2 === _arg3)) || ((_arg1 <= 0)))){
volume = _arg2;
setIsFading(true);
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.FADE_START, false, false, this));
volume = _arg3;
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.FADE_CHANGE, false, false, this));
setIsFading(false);
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.FADE_STOP, false, false, this));
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.FADE_COMPLETE, false, false, this));
} else {
_local4 = new Tween(this, "volume", Regular.easeInOut, _arg2, _arg3, _arg1, true);
_local4.addEventListener(TweenEvent.MOTION_CHANGE, onFadeChange);
_local4.addEventListener(TweenEvent.MOTION_FINISH, onFadeComplete);
setIsFading(true);
setVolumeTween(_local4);
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.FADE_START, false, false, this));
};
}
private function onSoundComplete(_arg1:Event):void{
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.SOUND_COMPLETE, false, false, this));
stop();
}
public function get isPanning():Boolean{
return (getIsPanning());
}
private function setPanTween(_arg1:Tween):void{
_panTween = _arg1;
}
public function set soundTransform(_arg1:SoundTransform):void{
var _local2:SoundChannel;
_local2 = getChannel();
_local2.soundTransform = _arg1;
}
private function getPanTween():Tween{
return (_panTween);
}
private function getSound():SimpleSound{
return (_sound);
}
private function setPan(_arg1:Number):void{
var _local2:SoundChannel;
var _local3:Number;
_local2 = getChannel();
_local3 = getVolume();
_local2.soundTransform = new SoundTransform(_local3, _arg1);
}
private function getChannel():SoundChannel{
return (_channel);
}
public function panCenter(_arg1:Number):void{
panStart(_arg1, NaN, 0);
}
private function onFadeComplete(_arg1:TweenEvent):void{
fadeStop();
dispatchEvent(new SimpleSoundChannelEvent(SimpleSoundChannelEvent.FADE_COMPLETE, false, false, this));
}
private function setSound(_arg1:SimpleSound):void{
_sound = _arg1;
}
public function panLeft(_arg1:Number):void{
panStart(_arg1, NaN, -1);
}
private function getPan():Number{
var _local1:SoundChannel;
_local1 = getChannel();
return (_local1.soundTransform.pan);
}
private function getIsPlaying():Boolean{
return (_isPlaying);
}
private function setIsPlaying(_arg1:Boolean):void{
_isPlaying = _arg1;
}
public function fadeOutAndStop(_arg1:Number):void{
var self:SimpleSoundChannel;
var onComplete:Function;
var onStop:Function;
var duration = _arg1;
onComplete = function (_arg1:Event):void{
self.removeEventListener("fadeComplete", onComplete);
self.removeEventListener("fadeStop", onStop);
};
onStop = function (_arg1:Event):void{
self.removeEventListener("fadeComplete", onComplete);
self.removeEventListener("fadeStop", onStop);
self.stop();
};
self = this;
self.addEventListener("fadeComplete", onComplete);
self.addEventListener("fadeStop", onStop);
fadeOut(duration);
}
private function getIsFading():Boolean{
return (_isFading);
}
public function fadeIn(_arg1:Number):void{
fadeStart(_arg1, NaN, 1);
}
public function panRight(_arg1:Number):void{
panStart(_arg1, NaN, 1);
}
}
}//package com.zincroe.media
Section 61
//SimpleSoundChannelEvent (com.zincroe.media.SimpleSoundChannelEvent)
package com.zincroe.media {
import flash.events.*;
public class SimpleSoundChannelEvent extends Event {
private var _channel:SimpleSoundChannel;
public static const PAN_START:String = "panStart";
public static const SOUND_STOP:String = "soundStop";
public static const FADE_STOP:String = "fadeStop";
public static const SOUND_COMPLETE:String = "soundComplete";
public static const PAN_STOP:String = "panStop";
public static const PAN_CHANGE:String = "panChange";
public static const FADE_CHANGE:String = "fadeChange";
public static const PAN_COMPLETE:String = "panComplete";
public static const FADE_COMPLETE:String = "fadeComplete";
public static const FADE_START:String = "fadeStart";
public function SimpleSoundChannelEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:SimpleSoundChannel=null){
super(_arg1, _arg2, _arg3);
setChannel(_arg4);
}
override public function toString():String{
return (formatToString("SimpleSoundChannelEvent", "type", "bubbles", "cancelable", "channel"));
}
private function getChannel():SimpleSoundChannel{
return (_channel);
}
private function setChannel(_arg1:SimpleSoundChannel):void{
_channel = _arg1;
}
public function get channel():SimpleSoundChannel{
return (_channel);
}
override public function clone():Event{
return (new SimpleSoundChannelEvent(type, bubbles, cancelable, channel));
}
}
}//package com.zincroe.media
Section 62
//SimpleSoundManager (com.zincroe.media.SimpleSoundManager)
package com.zincroe.media {
import flash.utils.*;
import flash.media.*;
import com.zincroe.utils.*;
public class SimpleSoundManager {
private var _nameLookup:Dictionary;
private var _soundList:Array;
private var _nameList:Array;
private var _soundLookup:Dictionary;
public function SimpleSoundManager(){
setNameList(new Array());
setNameLookup(new Dictionary());
setSoundList(new Array());
setSoundLookup(new Dictionary());
}
public function stop(_arg1=null):void{
var sounds:Array;
var names = _arg1;
sounds = getSounds(names);
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.stop();
});
}
public function panStart(_arg1:Number, _arg2:Number=NaN, _arg3:Number=NaN, _arg4=null):void{
var sounds:Array;
var duration = _arg1;
var start = _arg2;
var finish = _arg3;
var names = _arg4;
sounds = getSounds(names);
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.panStart(duration, start, finish);
});
}
public function getChannels(_arg1):Array{
var _local2:Array;
var _local3:Array;
_local3 = getSounds(_arg1);
_local2 = ArrayUtil.map(_local3, mapSoundToChannels);
_local2 = ArrayUtil.flatten(_local2);
_local2 = ArrayUtil.unique(_local2);
_local2 = ArrayUtil.type(_local2, SimpleSoundChannel);
return (_local2);
}
public function getSounds(_arg1=null):Array{
var _local2:Array;
if (_arg1 === null){
_local2 = getSoundList();
} else {
_arg1 = new Array(_arg1);
_arg1 = ArrayUtil.flatten(_arg1);
_local2 = ArrayUtil.map(_arg1, mapNameToSound);
_local2 = ArrayUtil.type(_local2, SimpleSound);
_local2 = ArrayUtil.unique(_local2);
};
return (_local2);
}
private function setNameList(_arg1:Array):void{
_nameList = _arg1;
}
public function fadeStart(_arg1:Number, _arg2:Number=NaN, _arg3:Number=NaN, _arg4=null):void{
var sounds:Array;
var duration = _arg1;
var start = _arg2;
var finish = _arg3;
var names = _arg4;
sounds = getSounds(names);
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.fadeStart(duration, start, finish);
});
}
private function mapNameToSound(_arg1:String):SimpleSound{
return (getSound(_arg1));
}
private function setSoundList(_arg1:Array):void{
_soundList = _arg1;
}
public function panLeft(_arg1:Number, _arg2=null):void{
var sounds:Array;
var duration = _arg1;
var names = _arg2;
sounds = getSounds(names);
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.panLeft(duration);
});
}
public function fadeIn(_arg1:Number, _arg2=null):void{
var sounds:Array;
var duration = _arg1;
var names = _arg2;
sounds = getSounds(names);
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.fadeIn(duration);
});
}
public function unbind(_arg1:String):void{
bind(_arg1, null);
}
private function getSoundList():Array{
return (_soundList.concat());
}
public function createAndBind(_arg1:String, _arg2:Object=null):SimpleSound{
var _local3:SimpleSound;
_local3 = create(_arg1, _arg2);
if (_local3){
bind(_arg1, _local3);
};
return (_local3);
}
private function mapSoundToName(_arg1:SimpleSound){
return (getName(_arg1));
}
public function volume(_arg1:Number=1, _arg2=null):void{
var sounds:Array;
var value = _arg1;
var names = _arg2;
sounds = getSounds(names);
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.volume(value);
});
}
private function getNameLookup():Dictionary{
return (_nameLookup);
}
public function pan(_arg1:Number=0, _arg2=null):void{
var sounds:Array;
var value = _arg1;
var names = _arg2;
sounds = getSounds(names);
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.pan(value);
});
}
private function mapSoundToChannels(_arg1:SimpleSound):Array{
return (_arg1.channels);
}
public function getSound(_arg1:String):SimpleSound{
var _local2:Dictionary;
_local2 = getNameLookup();
return ((_local2[_arg1] as SimpleSound));
}
public function createFromClass(_arg1:Class):SimpleSound{
var _local2:Sound;
var _local3:SimpleSound;
var _local4:String;
_local2 = (new (_arg1) as Sound);
_local3 = new SimpleSound(_local2);
_local4 = getQualifiedClassName(_arg1);
bind(_local4, _local3);
return (_local3);
}
public function getName(_arg1:SimpleSound):String{
var _local2:Dictionary;
_local2 = getSoundLookup();
return (((_local2[_arg1]) || (null)));
}
public function isPlaying(_arg1=null):Boolean{
var _local2:Array;
_local2 = getChannels(_arg1);
return ((_local2.length > 0));
}
public function fadeStop(_arg1=null):void{
var sounds:Array;
var names = _arg1;
sounds = getSounds(names);
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.fadeStop();
});
}
public function panCenter(_arg1:Number, _arg2=null):void{
var sounds:Array;
var duration = _arg1;
var names = _arg2;
sounds = getSounds(names);
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.panCenter(duration);
});
}
private function setSoundLookup(_arg1:Dictionary):void{
_soundLookup = _arg1;
}
public function isolate(_arg1=null):void{
var sounds:Array;
var names = _arg1;
sounds = ArrayUtil.remove(getSounds(), getSounds(names));
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.stop();
});
}
public function panRight(_arg1:Number, _arg2=null):void{
var sounds:Array;
var duration = _arg1;
var names = _arg2;
sounds = getSounds(names);
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.panRight(duration);
});
}
private function setNameLookup(_arg1:Dictionary):void{
_nameLookup = _arg1;
}
public function fadeOut(_arg1:Number, _arg2=null):void{
var sounds:Array;
var duration = _arg1;
var names = _arg2;
sounds = getSounds(names);
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.fadeOut(duration);
});
}
private function getSoundLookup():Dictionary{
return (_soundLookup);
}
public function getNames(_arg1=null):Array{
var _local2:Array;
if (_arg1 === null){
_local2 = getNameList();
} else {
_arg1 = new Array(_arg1);
_arg1 = ArrayUtil.flatten(_arg1);
_local2 = ArrayUtil.map(_arg1, mapSoundToName);
_local2 = ArrayUtil.type(_local2, String);
_local2 = ArrayUtil.unique(_local2);
};
return (_local2);
}
public function fadeOutAndStop(_arg1:Number, _arg2=null):void{
var sounds:Array;
var duration = _arg1;
var names = _arg2;
sounds = getSounds(names);
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.fadeOutAndStop(duration);
});
}
public function panStop(_arg1=null):void{
var sounds:Array;
var names = _arg1;
sounds = getSounds(names);
ArrayUtil.each(sounds, function (_arg1:SimpleSound):void{
_arg1.panStop();
});
}
public function play(_arg1:String, _arg2:Object=null):SimpleSoundChannel{
var _local3:SimpleSound;
var _local4:SimpleSoundChannel;
_local3 = getSound(_arg1);
if (_local3){
_arg2 = new SimpleSoundOptions(_local3.defaultOptions, _arg2);
_local4 = _local3.play(_arg2);
} else {
_local3 = create((_arg1 as String), _arg2);
if (_local3){
_local4 = _local3.play(_local3.defaultOptions);
bind(_arg1, _local3);
};
};
return (_local4);
}
public function create(_arg1:String, _arg2:Object=null):SimpleSound{
var sound:Sound;
var simple:SimpleSound;
var classname = _arg1;
var options = _arg2;
try {
sound = (new (getDefinitionByName(classname)) as Sound);
simple = new SimpleSound(sound, options);
} catch(error:ReferenceError) {
} catch(error:ArgumentError) {
};
return (simple);
}
public function bind(_arg1:String, _arg2:SimpleSound):void{
var _local3:Array;
var _local4:Dictionary;
var _local5:Array;
var _local6:Dictionary;
var _local7:SimpleSound;
_local3 = getNameList();
_local4 = getNameLookup();
_local5 = getSoundList();
_local6 = getSoundLookup();
_local7 = getSound(_arg1);
if (_local7 !== _arg2){
if (_local7){
_local7.stop();
_local3 = ArrayUtil.remove(_local3, _arg1);
delete _local4[_arg1];
_local5 = ArrayUtil.remove(_local5, _local7);
delete _local6[_local7];
};
if (_arg2){
_local4[_arg1] = _arg2;
_local3 = ArrayUtil.add(_local3, _arg1);
_local6[_arg2] = _arg1;
_local5 = ArrayUtil.add(_local5, _arg2);
};
setNameList(_local3);
setNameLookup(_local4);
setSoundList(_local5);
setSoundLookup(_local6);
};
}
private function getNameList():Array{
return (_nameList.concat());
}
}
}//package com.zincroe.media
Section 63
//SimpleSoundOptions (com.zincroe.media.SimpleSoundOptions)
package com.zincroe.media {
import com.zincroe.utils.*;
public class SimpleSoundOptions {
private var _volume:Number;
private var _mode:uint;
private var _loop:int;
private var _pan:Number;
private var _offset:Number;
public static const PLAY_NEW:uint = 2;
public static const PLAY_ALL:uint = 0;
public static const PLAY_CURRENT:uint = 1;
public function SimpleSoundOptions(... _args){
offset = 0;
loop = 0;
pan = 0;
volume = 1;
merge(_args);
}
public function set loop(_arg1:int):void{
_loop = Math.abs(_arg1);
}
public function set mode(_arg1:uint):void{
switch (_arg1){
case PLAY_CURRENT:
case PLAY_NEW:
_mode = _arg1;
break;
default:
_mode = PLAY_ALL;
break;
};
}
public function get offset():Number{
return (_offset);
}
public function get volume():Number{
return (_volume);
}
public function get pan():Number{
return (_pan);
}
public function toObject():Object{
return ({loop:loop, mode:mode, offset:offset, pan:pan, volume:volume});
}
public function get mode():uint{
return (_mode);
}
public function set offset(_arg1:Number):void{
if (isNaN(_arg1)){
_offset = 0;
} else {
_offset = _arg1;
};
}
public function get loop():int{
return (_loop);
}
public function toString():String{
var _local1:String;
_local1 = "[SimpleSoundOptions loop=!loop offset=!offset pan=!pan volume=!volume]";
_local1 = _local1.replace("!loop", loop);
_local1 = _local1.replace("!offset", offset);
_local1 = _local1.replace("!pan", pan);
_local1 = _local1.replace("!volume", volume);
return (_local1);
}
public function set volume(_arg1:Number):void{
if (!isNaN(_arg1)){
_volume = _arg1;
};
}
public function merge(... _args):void{
var args = _args;
args = ArrayUtil.flatten(args);
args = ArrayUtil.compact(args);
args = args.reverse();
ArrayUtil.each(args, function (_arg1:Object):void{
if (("loop" in _arg1)){
loop = _arg1.loop;
};
if (("mode" in _arg1)){
mode = _arg1.mode;
};
if (("offset" in _arg1)){
offset = _arg1.offset;
};
if (("pan" in _arg1)){
pan = _arg1.pan;
};
if (("volume" in _arg1)){
volume = _arg1.volume;
};
});
}
public function set pan(_arg1:Number):void{
if (!isNaN(_arg1)){
_pan = _arg1;
};
}
}
}//package com.zincroe.media
Section 64
//ArrayUtil (com.zincroe.utils.ArrayUtil)
package com.zincroe.utils {
public class ArrayUtil {
public static function unique(_arg1:Array):Array{
var _local2:*;
var _local3:Array;
_local3 = new Array();
for each (_local2 in _arg1) {
if (_local3.indexOf(_local2) < 0){
_local3.push(_local2);
};
};
return (_local3);
}
public static function each(_arg1:Array, _arg2:Function, _arg3:Object=null):void{
var _local4:Array;
var _local5:uint;
var _local6:*;
if (((((_arg1) && (_arg1.length))) && ((_arg2 is Function)))){
_local5 = _arg1.length;
while (_local5--) {
_local6 = _arg1[_local5];
_local4 = [_local6, _local5, _arg1].slice(0, _arg2.length);
if (_arg2.apply(_arg3, _local4) === false){
return;
};
};
};
}
public static function compact(_arg1:Array):Array{
return (ArrayUtil.remove(_arg1, null, undefined));
}
public static function flatten(_arg1:Array):Array{
var _local3:uint;
var _local4:Array;
var _local5:*;
if (((_arg1) && (_arg1.length))){
_local4 = new Array();
_local3 = _arg1.length;
while (_local3--) {
_local5 = _arg1[_local3];
if ((_local5 is Array)){
_local5 = _local5.slice();
_local5 = arguments.callee(_local5);
};
_local4 = [].concat(_local5, _local4);
};
} else {
_local4 = new Array();
};
return (_local4);
}
public static function normalize(_arg1:Array):Array{
var _local2:Array;
if (_arg1){
_local2 = _arg1.concat();
_local2 = ArrayUtil.flatten(_local2);
_local2 = ArrayUtil.unique(_local2);
_local2 = ArrayUtil.compact(_local2);
} else {
_local2 = new Array();
};
return (_local2);
}
public static function add(_arg1:Array, ... _args):Array{
var _local3:Array;
var _local2:Array = ArrayUtil.flatten(_args);
_local2 = ArrayUtil.compact(_local2);
if (_arg1){
_local3 = _arg1.concat();
} else {
_local3 = new Array();
};
_local3 = _local3.concat(_local2);
_local3 = ArrayUtil.unique(_local3);
return (_local3);
}
public static function type(_arg1:Array, _arg2:Class):Array{
var temp:Array;
var array = _arg1;
var type = _arg2;
temp = ArrayUtil.map(array, function (_arg1){
return ((_arg1 as type));
});
temp = ArrayUtil.compact(temp);
return (temp);
}
public static function remove(_arg1:Array, ... _args):Array{
var _local3:uint;
var _local4:Array;
var _local5:*;
if (((((((_arg1) && (_arg1.length))) && (_args))) && (_args.length))){
_local4 = _arg1.slice();
var _local2:Array = ArrayUtil.flatten(_args);
_local3 = _local2.length;
while (_local3--) {
_local5 = _local2[_local3];
while (_local4.indexOf(_local5) >= 0) {
_local4.splice(_local4.indexOf(_local5), 1);
};
};
} else {
_local4 = new Array();
};
return (_local4);
}
public static function map(_arg1:Array, _arg2:Function, _arg3:Object=null):Array{
var _local4:Array;
var _local5:uint;
var _local6:Array;
var _local7:*;
if (((((_arg1) && (_arg1.length))) && ((_arg2 is Function)))){
_local6 = new Array();
_local5 = _arg1.length;
while (_local5--) {
_local7 = _arg1[_local5];
_local4 = [_local7, _local5, _arg1].slice(0, _arg2.length);
_local6.unshift(_arg2.apply(_arg3, _local4));
};
} else {
_local6 = new Array();
};
return (_local6);
}
public static function empty(_arg1:Array):Boolean{
return ((_arg1.length === 0));
}
public static function contains(_arg1:Array, ... _args):Boolean{
var _local3:uint;
var _local4:*;
if (((((((_arg1) && (_arg1.length))) && (_args))) && (_args.length))){
var _local2:Array = ArrayUtil.unique(_args);
_local3 = _local2.length;
while (_local3--) {
_local4 = _local2[_local3];
if (_arg1.indexOf(_local4) < 0){
return (false);
};
};
return (true);
};
return (false);
}
}
}//package com.zincroe.utils
Section 65
//LabelUtil (com.zincroe.utils.LabelUtil)
package com.zincroe.utils {
import flash.utils.*;
import flash.display.*;
public class LabelUtil {
private static var _hash:Object;
public static function totalFrames(_arg1:MovieClip, _arg2:String):uint{
var _local3:Label;
_local3 = LabelUtil.find(_arg1, _arg2);
return ((_local3) ? _local3.totalFrames : 0);
}
public static function play(_arg1:MovieClip, _arg2:String, _arg3:Function):void{
var _local4:Label;
_local4 = (LabelUtil.find(_arg1, _arg2) as Label);
if (_local4 === null){
_arg3();
} else {
_arg1.addFrameScript((_local4.lastFrame - 1), _arg3);
if (_local4.totalFrames === 1){
_arg1.gotoAndStop(_local4.name);
} else {
if (((!((_arg1.currentLabel === _local4.name))) || ((_arg1.currentFrame === _local4.lastFrame)))){
_arg1.gotoAndPlay(_local4.name);
} else {
_arg1.play();
};
};
};
}
public static function firstFrame(_arg1:MovieClip, _arg2:String):uint{
var _local3:Label;
_local3 = LabelUtil.find(_arg1, _arg2);
return ((_local3) ? _local3.firstFrame : 0);
}
public static function lastFrame(_arg1:MovieClip, _arg2:String):uint{
var _local3:Label;
_local3 = LabelUtil.find(_arg1, _arg2);
return ((_local3) ? _local3.lastFrame : 0);
}
public static function once(_arg1:MovieClip, _arg2:String):void{
var label:Label;
var context = _arg1;
var name = _arg2;
var _local4 = (LabelUtil.find(context, name) as Label);
label = _local4;
if (_local4){
context.addFrameScript((label.lastFrame - 1), function (){
context.stop();
});
if (label.totalFrames === 1){
context.gotoAndStop(label.name);
} else {
if (context.currentFrame === label.lastFrame){
context.stop();
} else {
if (context.currentLabel !== label.name){
context.gotoAndPlay(label.name);
} else {
context.play();
};
};
};
} else {
context.stop();
};
}
public static function find(_arg1:MovieClip, _arg2:String):Label{
var _local3:int;
var _local4:int;
var _local5:String;
var _local6:FrameLabel;
var _local7:int;
var _local8:int;
if (((((((_arg2) && (_arg2.length))) && (_arg1))) && (_arg1.currentLabels.length))){
_local5 = getQualifiedClassName(_arg1);
if (!_hash){
_hash = new Object();
};
if (!_hash[_local5]){
_hash[_local5] = new Object();
_local3 = (_arg1.totalFrames + 1);
_local4 = _arg1.currentLabels.length;
while (_local4--) {
_local6 = _arg1.currentLabels[_local4];
if (_local6.frame < _local3){
_local7 = (_local3 - 1);
_local8 = (_local3 - _local6.frame);
_local3 = _local6.frame;
};
_hash[_local5][_local6.name] = new Label(_local6.name, _local3, _local7, _local8);
};
};
return (((_hash[_local5][_arg2]) || (null)));
};
return (null);
}
public static function loop(_arg1:MovieClip, _arg2:String):void{
var label:Label;
var context = _arg1;
var name = _arg2;
var _local4 = (LabelUtil.find(context, name) as Label);
label = _local4;
if (_local4){
context.addFrameScript((label.lastFrame - 1), function (){
context.gotoAndPlay(label.name);
});
if (label.totalFrames === 1){
context.gotoAndStop(label.name);
} else {
if (label.lastFrame === context.currentFrame){
context.gotoAndPlay(label.name);
} else {
if (context.currentLabel !== label.name){
context.gotoAndPlay(label.name);
} else {
context.play();
};
};
};
} else {
context.stop();
};
}
public static function exists(_arg1:MovieClip, _arg2:String):Boolean{
return (Boolean(LabelUtil.find(_arg1, _arg2)));
}
public static function repeat(_arg1:MovieClip, _arg2:String, _arg3:Function):void{
var _local4:Label;
_local4 = (LabelUtil.find(_arg1, _arg2) as Label);
if ((((_local4 === null)) || ((_local4.totalFrames === 1)))){
_arg1.stop();
} else {
setTimeout(_arg3, 1);
};
}
}
}//package com.zincroe.utils
class Label {
private var _name:String;
private var _totalFrames:int;
private var _firstFrame:int;
private var _lastFrame:int;
private function Label(_arg1:String, _arg2:int, _arg3:int, _arg4:int){
_firstFrame = _arg2;
_lastFrame = _arg3;
_name = _arg1;
_totalFrames = _arg4;
}
public function get totalFrames():int{
return (_totalFrames);
}
public function get name():String{
return (_name);
}
public function get lastFrame():int{
return (_lastFrame);
}
public function get firstFrame():int{
return (_firstFrame);
}
}
Section 66
//MathUtil (com.zincroe.utils.MathUtil)
package com.zincroe.utils {
import flash.geom.*;
public class MathUtil {
public static var ONE_EIGHTY_OVER_PI:Number = 57.2957795130823;
public static var PI_OVER_ONE_EIGHTY:Number = 0.0174532925199433;
public static function getAngle(_arg1:Point, _arg2:Point):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local3 = (_arg2.x - _arg1.x);
_local4 = (_arg2.y - _arg1.y);
_local5 = Math.atan2(_local4, _local3);
_local6 = MathUtil.radiansToDegrees(_local5);
return (_local6);
}
public static function getPointAtAngle(_arg1:Point, _arg2:Point, _arg3:Number):Point{
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local4 = MathUtil.getDistance(_arg1, _arg2);
_local5 = (_arg1.x + (Math.cos(MathUtil.degreesToRadians(_arg3)) * _local4));
_local6 = (_arg1.y + (Math.sin(MathUtil.degreesToRadians(_arg3)) * _local4));
return (new Point(Math.round(_local5), Math.round(_local6)));
}
public static function getDistance(_arg1:Point, _arg2:Point):Number{
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = (_arg2.x - _arg1.x);
_local4 = (_arg2.y - _arg1.y);
_local5 = Math.sqrt(((_local3 * _local3) + (_local4 * _local4)));
return (_local5);
}
public static function getPercentDistance(_arg1:Point, _arg2:Point, _arg3:Number):Point{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local4 = MathUtil.getDistance(_arg1, _arg2);
_local5 = (_local4 * _arg3);
_local6 = MathUtil.getAngle(_arg1, _arg2);
_local7 = Math.sin(MathUtil.degreesToRadians(_local6));
_local8 = Math.cos(MathUtil.degreesToRadians(_local6));
_local9 = (_local5 * _local7);
_local10 = (_local5 * _local8);
return (new Point((_arg1.x + _local10), (_arg1.y + _local9)));
}
public static function getRandom(_arg1, _arg2):Number{
var _local3:Number;
_local3 = (Math.round((Math.random() * (_arg2 - _arg1))) + _arg1);
return (_local3);
}
public static function radiansToDegrees(_arg1:Number):Number{
return ((_arg1 * MathUtil.ONE_EIGHTY_OVER_PI));
}
public static function clamp(_arg1:Number, _arg2:Number, _arg3:Number):Number{
_arg1 = Math.max(_arg1, _arg2);
_arg1 = Math.min(_arg1, _arg3);
return (_arg1);
}
public static function sign(_arg1:Number):int{
return (((_arg1)<0) ? -1 : 1);
}
public static function degreesToRadians(_arg1:Number):Number{
return ((_arg1 * MathUtil.PI_OVER_ONE_EIGHTY));
}
}
}//package com.zincroe.utils
Section 67
//SharedAssets (com.zincroe.utils.SharedAssets)
package com.zincroe.utils {
import flash.utils.*;
import flash.display.*;
import flash.system.*;
public class SharedAssets {
private static var __libraries:Dictionary = new Dictionary();
public static var master:ApplicationDomain;
public static function get(_arg1:String, _arg2:String):Class{
var _local3:Class;
var _local4:ApplicationDomain;
_local4 = __libraries[_arg1];
if (_local4){
if (_local4.hasDefinition(_arg2)){
trace("as");
_local3 = (_local4.getDefinition(_arg2) as Class);
} else {
if (master.hasDefinition(_arg2)){
_local3 = (master.getDefinition(_arg2) as Class);
};
};
} else {
_local3 = (master.hasDefinition(_arg2)) ? Class(master.getDefinition(_arg2)) : null;
};
return (_local3);
}
public static function addLibrary(_arg1:String, _arg2:ApplicationDomain):void{
var _local3:String;
for (_local3 in __libraries) {
if (_local3 == _arg1){
throw (new Error((("Identifier '" + _arg1) + "' already exists.")));
};
if (__libraries[_local3] == _arg2){
throw (new Error("ApplicationDomain already exists."));
};
};
__libraries[_arg1] = _arg2;
}
public static function instantiate(_arg1:String, _arg2:String){
var _local3:Class;
_local3 = (SharedAssets.get(_arg1, _arg2) as Class);
if (!_local3){
return (null);
};
return (new (_local3));
}
public static function replaceDisplayObject(_arg1:String, _arg2:DisplayObject):void{
var _local3:Class;
var _local4:DisplayObject;
var _local5:uint;
_local3 = (SharedAssets.get(_arg1, getQualifiedClassName(_arg2)) as Class);
_local4 = new (_local3);
_local5 = _arg2.parent.getChildIndex(_arg2);
_arg2.parent.addChildAt(_local4, _local5);
_local4.x = _arg2.x;
_local4.y = _arg2.y;
_local4.name = _arg2.name;
_arg2.parent[_arg2.name] = _local4;
_arg2.parent.removeChild(_arg2);
_arg2 = null;
}
}
}//package com.zincroe.utils
Section 68
//Regular (fl.transitions.easing.Regular)
package fl.transitions.easing {
public class Regular {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
}
}//package fl.transitions.easing
Section 69
//Strong (fl.transitions.easing.Strong)
package fl.transitions.easing {
public class Strong {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
}
}//package fl.transitions.easing
Section 70
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.utils.*;
import flash.display.*;
import flash.events.*;
public class Tween extends EventDispatcher {
private var _position:Number;// = NAN
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var isPlaying:Boolean;// = false
public var begin:Number;// = NAN
private var _fps:Number;// = NAN
private var _time:Number;// = NAN
public var change:Number;// = NAN
private var _finish:Number;// = NAN
public var looping:Boolean;// = false
private var _intervalID:uint;// = 0
public var func:Function;
private var _timer:Timer;// = null
private var _startTime:Number;// = NAN
public var prop:String;// = ""
private var _duration:Number;// = NAN
public var obj:Object;// = null
public var useSeconds:Boolean;// = false
protected static var _mc:MovieClip = new MovieClip();
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){
isPlaying = false;
obj = null;
prop = "";
func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
begin = NaN;
change = NaN;
useSeconds = false;
prevTime = NaN;
prevPos = NaN;
looping = false;
_duration = NaN;
_time = NaN;
_fps = NaN;
_position = NaN;
_startTime = NaN;
_intervalID = 0;
_finish = NaN;
_timer = null;
super();
if (!arguments.length){
return;
};
this.obj = _arg1;
this.prop = _arg2;
this.begin = _arg4;
this.position = _arg4;
this.duration = _arg6;
this.useSeconds = _arg7;
if ((_arg3 is Function)){
this.func = _arg3;
};
this.finish = _arg5;
this._timer = new Timer(100);
this.start();
}
public function continueTo(_arg1:Number, _arg2:Number):void{
this.begin = this.position;
this.finish = _arg1;
if (!isNaN(_arg2)){
this.duration = _arg2;
};
this.start();
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
public function set FPS(_arg1:Number):void{
var _local2:Boolean;
_local2 = this.isPlaying;
this.stopEnterFrame();
this._fps = _arg1;
if (_local2){
this.startEnterFrame();
};
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function get duration():Number{
return (this._duration);
}
protected function startEnterFrame():void{
var _local1:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
_local1 = (1000 / this._fps);
this._timer.delay = _local1;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
public function set time(_arg1:Number):void{
this.prevTime = this._time;
if (_arg1 > this.duration){
if (this.looping){
this.rewind((_arg1 - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (_arg1 < 0){
this.rewind();
this.update();
} else {
this._time = _arg1;
this.update();
};
};
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function getPosition(_arg1:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = this._time;
};
return (this.func(_arg1, this.begin, this.change, this._duration));
}
public function set finish(_arg1:Number):void{
this.change = (_arg1 - this.begin);
}
public function set duration(_arg1:Number):void{
this._duration = ((_arg1)<=0) ? Infinity : _arg1;
}
public function setPosition(_arg1:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = _arg1);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
protected function onEnterFrame(_arg1:Event):void{
this.nextFrame();
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function timerHandler(_arg1:TimerEvent):void{
this.nextFrame();
_arg1.updateAfterEvent();
}
public function get FPS():Number{
return (this._fps);
}
public function rewind(_arg1:Number=0):void{
this._time = _arg1;
this.fixTime();
this.update();
}
public function set position(_arg1:Number):void{
this.setPosition(_arg1);
}
public function get time():Number{
return (this._time);
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function prevFrame():void{
if (!this.useSeconds){
this.time = (this._time - 1);
};
}
}
}//package fl.transitions
Section 71
//TweenEvent (fl.transitions.TweenEvent)
package fl.transitions {
import flash.events.*;
public class TweenEvent extends Event {
public var time:Number;// = NAN
public var position:Number;// = NAN
public static const MOTION_START:String = "motionStart";
public static const MOTION_STOP:String = "motionStop";
public static const MOTION_LOOP:String = "motionLoop";
public static const MOTION_CHANGE:String = "motionChange";
public static const MOTION_FINISH:String = "motionFinish";
public static const MOTION_RESUME:String = "motionResume";
public function TweenEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
time = NaN;
position = NaN;
super(_arg1, _arg4, _arg5);
this.time = _arg2;
this.position = _arg3;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable));
}
}
}//package fl.transitions
Section 72
//Bandaid (items.Bandaid)
package items {
import com.totaldramaonline.games.splatoberfest.items.*;
public dynamic class Bandaid extends Broccoli {
}
}//package items
Section 73
//Bug (items.Bug)
package items {
import com.totaldramaonline.games.splatoberfest.items.*;
public dynamic class Bug extends Broccoli {
}
}//package items
Section 74
//Fly (items.Fly)
package items {
import com.totaldramaonline.games.splatoberfest.items.*;
public dynamic class Fly extends Broccoli {
}
}//package items
Section 75
//LargeMeat (items.LargeMeat)
package items {
import com.totaldramaonline.games.splatoberfest.items.*;
public dynamic class LargeMeat extends LargeMeat {
}
}//package items
Section 76
//MediumMeat (items.MediumMeat)
package items {
import com.totaldramaonline.games.splatoberfest.items.*;
public dynamic class MediumMeat extends MediumMeat {
}
}//package items
Section 77
//PointMultiplier (items.PointMultiplier)
package items {
import com.totaldramaonline.games.splatoberfest.items.*;
public dynamic class PointMultiplier extends PointMultiplier {
}
}//package items
Section 78
//Rat (items.Rat)
package items {
import com.totaldramaonline.games.splatoberfest.items.*;
public dynamic class Rat extends Broccoli {
}
}//package items
Section 79
//SmallMeat (items.SmallMeat)
package items {
import com.totaldramaonline.games.splatoberfest.items.*;
public dynamic class SmallMeat extends SmallMeat {
}
}//package items
Section 80
//Spider (items.Spider)
package items {
import com.totaldramaonline.games.splatoberfest.items.*;
public dynamic class Spider extends Broccoli {
}
}//package items
Section 81
//FLARLabeling_BitmapData (org.libspark.flartoolkit.core.labeling.FLARLabeling_BitmapData)
package org.libspark.flartoolkit.core.labeling {
import flash.display.*;
import flash.geom.*;
import org.libspark.flartoolkit.core.types.*;
import org.libspark.flartoolkit.core.raster.*;
public class FLARLabeling_BitmapData implements IFLARLabeling {
private const work_holder:FLARWorkHolder;
private var _out_image:FLARLabelingImageBitmapData;
private var hSearch:BitmapData;
private var hLineRect:Rectangle;
private var tmp_img:BitmapData;
private var _dest_size:FLARIntSize;
private static const ONE_POINT:Point = new Point(1, 1);
private static const ZERO_POINT:Point = new Point();
private static const WORK_SIZE:int = 32768;
public function FLARLabeling_BitmapData(){
work_holder = new FLARWorkHolder(WORK_SIZE);
super();
}
public function getAttachedDestination():IFLARLabelingImage{
return (this._out_image);
}
public function attachDestination(_arg1:IFLARLabelingImage):void{
var _local2:FLARIntSize;
_local2 = _arg1.getSize();
this._out_image = (_arg1 as FLARLabelingImageBitmapData);
this.tmp_img = new BitmapData(_local2.w, _local2.h, false, 0);
this.hSearch = new BitmapData(_local2.w, 1, false, 0);
this.hLineRect = new Rectangle(0, 0, 1, 1);
this._dest_size = _local2;
}
public function labeling1(_arg1:IFLARRaster):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:IFLARLabelingImage;
var _local8:FLARIntSize;
var _local9:int;
var _local10:int;
var _local11:Array;
var _local12:Array;
var _local13:Array;
var _local14:int;
var _local15:int;
var _local16:Array;
var _local17:Array;
var _local18:Array;
var _local19:Array;
var _local20:Array;
var _local21:int;
var _local22:FLARLabelingLabelStack;
var _local23:FLARLabelingLabel;
var _local24:Array;
_local7 = this._out_image;
_local8 = _arg1.getSize();
this._dest_size.isEqualSizeO(_local8);
_local9 = _local8.w;
_local10 = _local8.h;
_local11 = (_local7.getBufferReader().getBuffer() as Array);
_local7.reset(true);
_local12 = _local7.getIndexArray();
_local14 = 0;
_local16 = (_arg1.getBufferReader().getBuffer() as Array);
_local18 = this.work_holder.work2;
_local5 = 1;
while (_local5 < (_local10 - 1)) {
_local17 = _local16[_local5];
_local19 = _local11[_local5];
_local20 = _local11[(_local5 - 1)];
_local4 = 1;
while (_local4 < (_local9 - 1)) {
if (_local17[_local4] == 0){
if (_local20[_local4] > 0){
_local15 = _local20[_local4];
_local13 = _local18[(_local15 - 1)];
var _local25 = _local13;
var _local26:int;
var _local27 = (_local25[_local26] + 1);
_local25[_local26] = _local27;
_local13[1] = (_local13[1] + _local4);
_local13[2] = (_local13[2] + _local5);
_local13[6] = _local5;
} else {
if (_local20[(_local4 + 1)] > 0){
if (_local20[(_local4 - 1)] > 0){
_local2 = _local12[(_local20[(_local4 + 1)] - 1)];
_local3 = _local12[(_local20[(_local4 - 1)] - 1)];
if (_local2 > _local3){
_local15 = _local3;
_local6 = 0;
while (_local6 < _local14) {
if (_local12[_local6] == _local2){
_local12[_local6] = _local3;
};
_local6++;
};
} else {
if (_local2 < _local3){
_local15 = _local2;
_local6 = 0;
while (_local6 < _local14) {
if (_local12[_local6] == _local3){
_local12[_local6] = _local2;
};
_local6++;
};
} else {
_local15 = _local2;
};
};
_local13 = _local18[(_local15 - 1)];
_local25 = _local13;
_local26 = 0;
_local27 = (_local25[_local26] + 1);
_local25[_local26] = _local27;
_local13[1] = (_local13[1] + _local4);
_local13[2] = (_local13[2] + _local5);
_local13[6] = _local5;
} else {
if (_local19[(_local4 - 1)] > 0){
_local2 = _local12[(_local20[(_local4 + 1)] - 1)];
_local3 = _local12[(_local19[(_local4 - 1)] - 1)];
if (_local2 > _local3){
_local15 = _local3;
_local6 = 0;
while (_local6 < _local14) {
if (_local12[_local6] == _local2){
_local12[_local6] = _local3;
};
_local6++;
};
} else {
if (_local2 < _local3){
_local15 = _local2;
_local6 = 0;
while (_local6 < _local14) {
if (_local12[_local6] == _local3){
_local12[_local6] = _local2;
};
_local6++;
};
} else {
_local15 = _local2;
};
};
_local13 = _local18[(_local15 - 1)];
_local25 = _local13;
_local26 = 0;
_local27 = (_local25[_local26] + 1);
_local25[_local26] = _local27;
_local13[1] = (_local13[1] + _local4);
_local13[2] = (_local13[2] + _local5);
} else {
_local15 = _local20[(_local4 + 1)];
_local13 = _local18[(_local15 - 1)];
_local25 = _local13;
_local26 = 0;
_local27 = (_local25[_local26] + 1);
_local25[_local26] = _local27;
_local13[1] = (_local13[1] + _local4);
_local13[2] = (_local13[2] + _local5);
if (_local13[3] > _local4){
_local13[3] = _local4;
};
_local13[6] = _local5;
};
};
} else {
if (_local20[(_local4 - 1)] > 0){
_local15 = _local20[(_local4 - 1)];
_local13 = _local18[(_local15 - 1)];
_local25 = _local13;
_local26 = 0;
_local27 = (_local25[_local26] + 1);
_local25[_local26] = _local27;
_local13[1] = (_local13[1] + _local4);
_local13[2] = (_local13[2] + _local5);
if (_local13[4] < _local4){
_local13[4] = _local4;
};
_local13[6] = _local5;
} else {
if (_local19[(_local4 - 1)] > 0){
_local15 = _local19[(_local4 - 1)];
_local13 = _local18[(_local15 - 1)];
_local25 = _local13;
_local26 = 0;
_local27 = (_local25[_local26] + 1);
_local25[_local26] = _local27;
_local13[1] = (_local13[1] + _local4);
_local13[2] = (_local13[2] + _local5);
if (_local13[4] < _local4){
_local13[4] = _local4;
};
} else {
this.work_holder.reserv(_local14);
_local14++;
_local12[(_local14 - 1)] = _local14;
_local15 = _local14;
_local13 = _local18[(_local14 - 1)];
_local13[0] = 1;
_local13[1] = _local4;
_local13[2] = _local5;
_local13[3] = _local4;
_local13[4] = _local4;
_local13[5] = _local5;
_local13[6] = _local5;
};
};
};
};
_local19[_local4] = _local15;
} else {
_local19[_local4] = 0;
};
_local4++;
};
_local5++;
};
_local21 = 1;
_local4 = 0;
while (_local4 < _local14) {
_local12[_local4] = ((_local12[_local4])==(_local4 + 1)) ? var _temp1 = _local21;
_local21 = (_local21 + 1);
_temp1 : _local12[(_local12[_local4] - 1)];
_local4++;
};
--_local21;
if (_local21 == 0){
_local7.getLabelStack().clear();
return;
};
_local22 = _local7.getLabelStack();
_local22.reserv(_local21);
_local24 = _local22.getArray();
_local4 = 0;
while (_local4 < _local21) {
_local23 = _local24[_local4];
_local23.id = (_local4 + 1);
_local23.area = 0;
_local23.pos_x = (_local23.pos_y = 0);
_local23.clip_l = _local9;
_local23.clip_t = _local10;
_local23.clip_r = (_local23.clip_b = 0);
_local4++;
};
_local4 = 0;
while (_local4 < _local14) {
_local23 = _local24[(_local12[_local4] - 1)];
_local13 = _local18[_local4];
_local23.area = (_local23.area + _local13[0]);
_local23.pos_x = (_local23.pos_x + _local13[1]);
_local23.pos_y = (_local23.pos_y + _local13[2]);
if (_local23.clip_l > _local13[3]){
_local23.clip_l = _local13[3];
};
if (_local23.clip_r < _local13[4]){
_local23.clip_r = _local13[4];
};
if (_local23.clip_t > _local13[5]){
_local23.clip_t = _local13[5];
};
if (_local23.clip_b < _local13[6]){
_local23.clip_b = _local13[6];
};
_local4++;
};
_local4 = 0;
while (_local4 < _local21) {
_local23 = _local24[_local4];
_local24[_local4].pos_x = (_local23.pos_x / _local23.area);
_local23.pos_y = (_local23.pos_y / _local23.area);
_local4++;
};
}
public function labeling(_arg1:IFLARRaster):void{
var _local2:BitmapData;
var _local3:Rectangle;
var _local4:Rectangle;
var _local5:Rectangle;
var _local6:Rectangle;
var _local7:int;
var _local8:FLARLabelingLabelStack;
var _local9:Array;
var _local10:FLARLabelingLabel;
_local2 = this._out_image.bitmapData;
_local2.fillRect(_local2.rect, 0);
_local3 = _local2.rect.clone();
_local3.inflate(-1, -1);
_local2.copyPixels(FLARRaster_BitmapData(_arg1).bitmapData, _local3, ONE_POINT);
_local4 = _local2.getColorBoundsRect(0xFFFFFF, 0xFFFFFF, true);
hLineRect.y = 0;
hLineRect.width = _local2.width;
_local7 = 0;
_local8 = this._out_image.getLabelStack();
_local8.clear();
_local9 = _local8.getArray();
while (!(_local4.isEmpty())) {
hLineRect.y = _local4.top;
hSearch.copyPixels(_local2, hLineRect, ZERO_POINT);
_local5 = hSearch.getColorBoundsRect(0xFFFFFF, 0xFFFFFF, true);
_local10 = (_local8.prePush() as FLARLabelingLabel);
++_local7;
_local2.floodFill(_local5.x, hLineRect.y, _local7);
_local6 = _local2.getColorBoundsRect(0xFFFFFF, _local7, true);
_local10.id = _local7;
_local10.area = (_local6.width * _local6.height);
_local10.clip_l = _local6.left;
_local10.clip_r = (_local6.right - 1);
_local10.clip_t = _local6.top;
_local10.clip_b = (_local6.bottom - 1);
_local10.pos_x = (((_local6.left + _local6.right) - 1) * 0.5);
_local10.pos_y = (((_local6.top + _local6.bottom) - 1) * 0.5);
_local4 = _local2.getColorBoundsRect(0xFFFFFF, 0xFFFFFF, true);
};
}
}
}//package org.libspark.flartoolkit.core.labeling
import org.libspark.flartoolkit.utils.*;
import org.libspark.flartoolkit.*;
class FLARWorkHolder {
public var work2:Array;
private var allocate_size:int;
private static const ARRAY_APPEND_STEP:int = 0x0100;
private function FLARWorkHolder(_arg1:int){
this.work2 = ArrayUtil.createJaggedArray(_arg1, 0);
this.allocate_size = 0;
}
public function reserv(_arg1:int):void{
var _local2:int;
var _local3:int;
if (this.allocate_size > _arg1){
return;
};
if (_arg1 >= this.work2.length){
throw (new FLARException());
};
_local2 = (_arg1 + ARRAY_APPEND_STEP);
if (_local2 >= this.work2.length){
_local2 = this.work2.length;
};
_local3 = this.allocate_size;
while (_local3 < _local2) {
this.work2[_local3] = new Array(7);
_local3++;
};
this.allocate_size = _local2;
}
}
Section 82
//FLARLabelingImageBitmapData (org.libspark.flartoolkit.core.labeling.FLARLabelingImageBitmapData)
package org.libspark.flartoolkit.core.labeling {
import flash.display.*;
import org.libspark.flartoolkit.core.types.*;
import org.libspark.flartoolkit.core.rasterreader.*;
import org.libspark.flartoolkit.core.raster.*;
import org.libspark.flartoolkit.*;
public class FLARLabelingImageBitmapData extends FLARRaster_BasicClass implements IFLARLabelingImage {
protected const _getContour_xdir:Array;
protected const _getContour_ydir:Array;
protected var _labeled:BitmapData;
protected var _is_index_table_enable:Boolean;
private var _buffer_reader:IFLARBufferReader;
protected var _label_list:FLARLabelingLabelStack;
private static const MAX_LABELS:int = 0x0400;
public function FLARLabelingImageBitmapData(_arg1:int, _arg2:int){
_getContour_xdir = [0, 1, 1, 1, 0, -1, -1, -1];
_getContour_ydir = [-1, -1, 0, 1, 1, 1, 0, -1];
super(new FLARIntSize(_arg1, _arg2));
this._labeled = new BitmapData(_arg1, _arg2, false, 0);
this._label_list = new FLARLabelingLabelStack(MAX_LABELS);
this._is_index_table_enable = false;
}
public function reset(_arg1:Boolean):void{
this._label_list.clear();
this._is_index_table_enable = _arg1;
}
override public function getBufferReader():IFLARBufferReader{
return (this._buffer_reader);
}
public function getIndexArray():Array{
return (null);
}
protected function getTopClipTangentX(_arg1:FLARLabelingLabel):int{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local3 = _arg1.id;
_local4 = _arg1.clip_r;
_local5 = _arg1.clip_l;
while (_local5 <= _local4) {
_local2 = this._labeled.getPixel(_local5, _arg1.clip_t);
if ((((_local2 > 0)) && ((_local2 == _local3)))){
return (_local5);
};
_local5++;
};
throw (new FLARException());
}
public function getLabelStack():FLARLabelingLabelStack{
return (this._label_list);
}
public function getContour(_arg1:int, _arg2:int, _arg3:Array, _arg4:Array):int{
var _local5:Array;
var _local6:Array;
var _local7:FLARLabelingLabel;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
_local5 = this._getContour_xdir;
_local6 = this._getContour_ydir;
_local7 = (this._label_list.getItem(_arg1) as FLARLabelingLabel);
_local9 = getTopClipTangentX(_local7);
_local10 = _local7.clip_t;
_local11 = 1;
_arg3[0] = _local9;
_arg4[0] = _local10;
_local12 = 5;
_local13 = _arg3[0];
_local14 = _arg4[0];
while (true) {
_local12 = ((_local12 + 5) % 8);
_local8 = 0;
while (_local8 < 8) {
if (this._labeled.getPixel((_local13 + _local5[_local12]), (_local14 + _local6[_local12])) > 0){
break;
};
_local12 = ((_local12 + 1) % 8);
_local8++;
};
if (_local8 == 8){
throw (new FLARException());
};
_local13 = (_local13 + _local5[_local12]);
_local14 = (_local14 + _local6[_local12]);
_arg3[_local11] = _local13;
_arg4[_local11] = _local14;
if ((((_local13 == _local9)) && ((_local14 == _local10)))){
_local11++;
break;
};
_local11++;
if (_local11 == _arg2){
return (_local11);
};
};
return (_local11);
}
public function get bitmapData():BitmapData{
return (this._labeled);
}
}
}//package org.libspark.flartoolkit.core.labeling
Section 83
//FLARLabelingLabel (org.libspark.flartoolkit.core.labeling.FLARLabelingLabel)
package org.libspark.flartoolkit.core.labeling {
public class FLARLabelingLabel {
public var clip_r:int;
public var clip_t:int;
public var area:int;
public var pos_y:Number;
public var clip_b:int;
public var pos_x:Number;
public var id:int;
public var clip_l:int;
public function toString():String{
return (((((((((((((((("{id:" + id) + ",area:") + area) + ",clip_r:") + clip_r) + ",clip_l:") + clip_l) + ",clip_b:") + clip_b) + ",clip_t:") + clip_t) + ",pos_x:") + pos_x) + ",pos_y:") + pos_y));
}
}
}//package org.libspark.flartoolkit.core.labeling
Section 84
//FLARLabelingLabelStack (org.libspark.flartoolkit.core.labeling.FLARLabelingLabelStack)
package org.libspark.flartoolkit.core.labeling {
import org.libspark.flartoolkit.utils.*;
public class FLARLabelingLabelStack extends NyObjectStack {
public function FLARLabelingLabelStack(_arg1:int){
super(FLARLabelingLabel, _arg1);
}
public function sortByArea():void{
var _local1:int;
var _local2:int;
var _local3:Array;
var _local4:int;
var _local5:FLARLabelingLabel;
var _local6:int;
_local1 = this._length;
_local2 = ((_local1 * 13) / 10);
_local3 = this._items;
while (true) {
_local4 = 0;
_local6 = 0;
while ((_local6 + _local2) < _local1) {
if (_local3[(_local6 + _local2)].area > _local3[_local6].area){
_local5 = _local3[(_local6 + _local2)];
_local3[(_local6 + _local2)] = _local3[_local6];
_local3[_local6] = _local5;
_local4++;
};
_local6++;
};
if (_local2 == 1){
if (_local4 == 0){
break;
};
} else {
_local2 = ((_local2 * 10) / 13);
};
};
}
}
}//package org.libspark.flartoolkit.core.labeling
Section 85
//IFLARLabeling (org.libspark.flartoolkit.core.labeling.IFLARLabeling)
package org.libspark.flartoolkit.core.labeling {
import org.libspark.flartoolkit.core.raster.*;
public interface IFLARLabeling {
function getAttachedDestination():IFLARLabelingImage;
function attachDestination(_arg1:IFLARLabelingImage):void;
function labeling(_arg1:IFLARRaster):void;
}
}//package org.libspark.flartoolkit.core.labeling
Section 86
//IFLARLabelingImage (org.libspark.flartoolkit.core.labeling.IFLARLabelingImage)
package org.libspark.flartoolkit.core.labeling {
import org.libspark.flartoolkit.core.raster.*;
public interface IFLARLabelingImage extends IFLARRaster {
function getContour(_arg1:int, _arg2:int, _arg3:Array, _arg4:Array):int;
function getLabelStack():FLARLabelingLabelStack;
function reset(_arg1:Boolean):void;
function getIndexArray():Array;
}
}//package org.libspark.flartoolkit.core.labeling
Section 87
//FLARMatchPatt_Color_WITHOUT_PCA (org.libspark.flartoolkit.core.match.FLARMatchPatt_Color_WITHOUT_PCA)
package org.libspark.flartoolkit.core.match {
import org.libspark.flartoolkit.core.*;
import org.libspark.flartoolkit.core.pickup.*;
import org.libspark.flartoolkit.utils.*;
public class FLARMatchPatt_Color_WITHOUT_PCA implements IFLARMatchPatt {
private var width:int;// = 1
private var input:Array;
private var dir:int;// = 0
private var cf:Number;// = 0
private var height:int;// = 1
private var datapow:Number;
public function FLARMatchPatt_Color_WITHOUT_PCA(){
input = ArrayUtil.createJaggedArray(1, 1, 3);
width = 1;
height = 1;
cf = 0;
dir = 0;
super();
}
public function getConfidence():Number{
return (cf);
}
public function setPatt(_arg1:IFLARColorPatt):Boolean{
var _local2:int;
var _local3:int;
var _local4:Array;
var _local5:Array;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:Array;
var _local12:Array;
var _local13:Array;
var _local14:Array;
reallocInputArray(_arg1.getWidth(), _arg1.getHeight());
_local6 = this.width;
_local7 = this.height;
_local5 = this.input;
_local4 = _arg1.getPatArray();
_local8 = 0;
_local9 = 0;
_local2 = (_local7 - 1);
while (_local2 >= 0) {
_local11 = _local4[_local2];
_local3 = (_local6 - 1);
while (_local3 >= 0) {
_local13 = _local11[_local3];
_local9 = (_local9 + ((((0xFF * 3) - _local13[0]) - _local13[1]) - _local13[2]));
_local3--;
};
_local2--;
};
_local9 = (_local9 / ((_local7 * _local6) * 3));
_local2 = (_local7 - 1);
while (_local2 >= 0) {
_local12 = _local5[_local2];
_local11 = _local4[_local2];
_local3 = (_local6 - 1);
while (_local3 >= 0) {
_local13 = _local11[_local3];
_local14 = _local12[_local3];
_local10 = ((0xFF - _local13[0]) - _local9);
_local14[0] = _local10;
_local8 = (_local8 + (_local10 * _local10));
_local10 = ((0xFF - _local13[1]) - _local9);
_local14[1] = _local10;
_local8 = (_local8 + (_local10 * _local10));
_local10 = ((0xFF - _local13[2]) - _local9);
_local14[2] = _local10;
_local8 = (_local8 + (_local10 * _local10));
_local3--;
};
_local2--;
};
datapow = Math.sqrt(_local8);
if (datapow == 0){
return (false);
};
return (true);
}
public function getDirection():int{
return (dir);
}
public function evaluate(_arg1:FLARCode):void{
var _local2:Array;
var _local3:Array;
var _local4:int;
var _local5:Number;
var _local6:Array;
var _local7:Array;
var _local8:Array;
var _local9:Array;
var _local10:Array;
var _local11:Array;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:Number;
var _local18:int;
_local2 = _arg1.getPat();
_local3 = _arg1.getPatPow();
_local4 = -1;
_local5 = 0;
_local12 = this.width;
_local13 = this.height;
_local7 = this.input;
_local18 = 0;
while (_local18 < 4) {
_local14 = 0;
_local6 = _local2[_local18];
_local15 = (_local13 - 1);
while (_local15 >= 0) {
_local9 = _local7[_local15];
_local8 = _local6[_local15];
_local16 = (_local12 - 1);
while (_local16 >= 0) {
_local10 = _local8[_local16];
_local11 = _local9[_local16];
_local14 = (_local14 + (_local11[0] * _local10[0]));
_local14 = (_local14 + (_local11[1] * _local10[1]));
_local14 = (_local14 + (_local11[2] * _local10[2]));
_local16--;
};
_local15--;
};
_local17 = ((_local14 / _local3[_local18]) / datapow);
if (_local17 > _local5){
_local5 = _local17;
_local4 = _local18;
};
_local18++;
};
dir = _local4;
cf = _local5;
}
private function reallocInputArray(_arg1:int, _arg2:int):void{
if ((((this.input.length < _arg2)) || ((this.input[0].length < _arg1)))){
this.input = ArrayUtil.createJaggedArray(_arg2, _arg1, 3);
};
this.height = _arg2;
this.width = _arg1;
}
}
}//package org.libspark.flartoolkit.core.match
Section 88
//IFLARMatchPatt (org.libspark.flartoolkit.core.match.IFLARMatchPatt)
package org.libspark.flartoolkit.core.match {
import org.libspark.flartoolkit.core.*;
import org.libspark.flartoolkit.core.pickup.*;
public interface IFLARMatchPatt {
function getConfidence():Number;
function setPatt(_arg1:IFLARColorPatt):Boolean;
function getDirection():int;
function evaluate(_arg1:FLARCode):void;
}
}//package org.libspark.flartoolkit.core.match
Section 89
//FLARCameraDistortionFactor (org.libspark.flartoolkit.core.param.FLARCameraDistortionFactor)
package org.libspark.flartoolkit.core.param {
import org.libspark.flartoolkit.core.types.*;
import org.libspark.flartoolkit.utils.*;
public final class FLARCameraDistortionFactor {
private var _f0:Number;
private var _f1:Number;
private var _f2:Number;
private var _f3:Number;
private static const PD_LOOP:int = 3;
public function ideal2ObservBatch(_arg1:Array, _arg2:Array, _arg3:int):void{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:int;
_local6 = this._f0;
_local7 = this._f1;
_local8 = this._f3;
_local9 = (this._f2 / 100000000);
_local11 = 0;
while (_local11 < _arg3) {
_local4 = ((_arg1[_local11].x - _local6) * _local8);
_local5 = ((_arg1[_local11].y - _local7) * _local8);
if ((((_local4 == 0)) && ((_local5 == 0)))){
_arg2[_local11].x = _local6;
_arg2[_local11].y = _local7;
} else {
_local10 = (1 - (_local9 * ((_local4 * _local4) + (_local5 * _local5))));
_arg2[_local11].x = ((_local4 * _local10) + _local6);
_arg2[_local11].y = ((_local5 * _local10) + _local7);
};
_local11++;
};
}
public function ideal2Observ(_arg1:FLARDoublePoint2d, _arg2:FLARDoublePoint2d):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = ((_arg1.x - this._f0) * this._f3);
_local4 = ((_arg1.y - this._f1) * this._f3);
if ((((_local3 == 0)) && ((_local4 == 0)))){
_arg2.x = this._f0;
_arg2.y = this._f1;
} else {
_local5 = (1 - ((this._f2 / 100000000) * ((_local3 * _local3) + (_local4 * _local4))));
_arg2.x = ((_local3 * _local5) + this._f0);
_arg2.y = ((_local4 * _local5) + this._f1);
};
}
public function observ2IdealBatch(_arg1:Array, _arg2:Array, _arg3:int, _arg4:int, _arg5:Array):void{
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:int;
var _local18:int;
_local13 = this._f0;
_local14 = this._f1;
_local15 = this._f3;
_local16 = (this._f2 / 100000000);
_local17 = 0;
while (_local17 < _arg4) {
_local10 = (_arg1[(_arg3 + _local17)] - _local13);
_local11 = (_arg2[(_arg3 + _local17)] - _local14);
_local6 = ((_local10 * _local10) + (_local11 * _local11));
_local7 = Math.sqrt(_local6);
_local8 = _local7;
_local18 = 1;
while (true) {
if (_local7 != 0){
_local12 = (_local16 * _local6);
_local9 = (_local7 - ((((1 - _local12) * _local7) - _local8) / (1 - (3 * _local12))));
_local10 = ((_local10 * _local9) / _local7);
_local11 = ((_local11 * _local9) / _local7);
} else {
_local10 = 0;
_local11 = 0;
break;
};
if (_local18 == PD_LOOP){
break;
};
_local6 = ((_local10 * _local10) + (_local11 * _local11));
_local7 = Math.sqrt(_local6);
_local18++;
};
_arg5[_local17][0] = ((_local10 / _local15) + _local13);
_arg5[_local17][1] = ((_local11 / _local15) + _local14);
_local17++;
};
}
public function setValue(_arg1:Array):void{
this._f0 = _arg1[0];
this._f1 = _arg1[1];
this._f2 = _arg1[2];
this._f3 = _arg1[3];
}
public function observ2Ideal(_arg1:Number, _arg2:Number, _arg3:DoubleValue, _arg4:DoubleValue):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:int;
_local13 = this._f0;
_local14 = this._f1;
_local10 = (_arg1 - _local13);
_local11 = (_arg2 - _local14);
_local7 = (this._f2 / 100000000);
_local5 = ((_local10 * _local10) + (_local11 * _local11));
_local6 = Math.sqrt(_local5);
_local8 = _local6;
_local15 = 1;
while (true) {
if (_local6 != 0){
_local12 = (_local7 * _local5);
_local9 = (_local6 - ((((1 - _local12) * _local6) - _local8) / (1 - (3 * _local12))));
_local10 = ((_local10 * _local9) / _local6);
_local11 = ((_local11 * _local9) / _local6);
} else {
_local10 = 0;
_local11 = 0;
break;
};
if (_local15 == PD_LOOP){
break;
};
_local5 = ((_local10 * _local10) + (_local11 * _local11));
_local6 = Math.sqrt(_local5);
_local15++;
};
_arg3.value = ((_local10 / this._f3) + _local13);
_arg4.value = ((_local11 / this._f3) + _local14);
}
public function changeScale(_arg1:Number):void{
this._f0 = (this._f0 * _arg1);
this._f1 = (this._f1 * _arg1);
this._f2 = (this._f2 / (_arg1 * _arg1));
}
public function getValue(_arg1:Array):void{
_arg1[0] = this._f0;
_arg1[1] = this._f1;
_arg1[2] = this._f2;
_arg1[3] = this._f3;
}
}
}//package org.libspark.flartoolkit.core.param
Section 90
//FLARParam (org.libspark.flartoolkit.core.param.FLARParam)
package org.libspark.flartoolkit.core.param {
import flash.utils.*;
import org.libspark.flartoolkit.core.types.*;
public class FLARParam {
private var _dist:FLARCameraDistortionFactor;
private var _projection_matrix:FLARPerspectiveProjectionMatrix;
protected var _screen_size:FLARIntSize;
public function FLARParam(){
_screen_size = new FLARIntSize();
_dist = new FLARCameraDistortionFactor();
_projection_matrix = new FLARPerspectiveProjectionMatrix();
super();
}
public function getDistortionFactor():FLARCameraDistortionFactor{
return (this._dist);
}
public function getScreenSize():FLARIntSize{
return (this._screen_size);
}
public function loadARParam(_arg1:ByteArray):void{
var _local2:Array;
var _local3:int;
_local2 = new Array(12);
_arg1.endian = Endian.BIG_ENDIAN;
this._screen_size.w = _arg1.readInt();
this._screen_size.h = _arg1.readInt();
_local3 = 0;
while (_local3 < 12) {
_local2[_local3] = _arg1.readDouble();
_local3++;
};
this._projection_matrix.setValue(_local2);
_local3 = 0;
while (_local3 < 4) {
_local2[_local3] = _arg1.readDouble();
_local3++;
};
this._dist.setValue(_local2);
}
public function getPerspectiveProjectionMatrix():FLARPerspectiveProjectionMatrix{
return (this._projection_matrix);
}
public function changeScreenSize(_arg1:int, _arg2:int):void{
var _local3:Number;
_local3 = (Number(_arg1) / this._screen_size.w);
this._dist.changeScale(_local3);
this._projection_matrix.changeScale(_local3);
this._screen_size.w = _arg1;
this._screen_size.h = _arg2;
}
}
}//package org.libspark.flartoolkit.core.param
Section 91
//FLARPerspectiveProjectionMatrix (org.libspark.flartoolkit.core.param.FLARPerspectiveProjectionMatrix)
package org.libspark.flartoolkit.core.param {
import org.libspark.flartoolkit.core.*;
import org.libspark.flartoolkit.core.types.matrix.*;
public final class FLARPerspectiveProjectionMatrix extends FLARDoubleMatrix34 {
public function decompMat(_arg1:FLARMat, _arg2:FLARMat):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Array;
var _local19:Array;
var _local20:int;
var _local21:int;
if (this.m23 >= 0){
_local6 = this.m00;
_local7 = this.m01;
_local8 = this.m02;
_local9 = this.m03;
_local10 = this.m10;
_local11 = this.m11;
_local12 = this.m12;
_local13 = this.m13;
_local14 = this.m20;
_local15 = this.m21;
_local16 = this.m22;
_local17 = this.m23;
} else {
_local6 = -(this.m00);
_local7 = -(this.m01);
_local8 = -(this.m02);
_local9 = -(this.m03);
_local10 = -(this.m10);
_local11 = -(this.m11);
_local12 = -(this.m12);
_local13 = -(this.m13);
_local14 = -(this.m20);
_local15 = -(this.m21);
_local16 = -(this.m22);
_local17 = -(this.m23);
};
_local18 = _arg1.getArray();
_local19 = _arg2.getArray();
_local20 = 0;
while (_local20 < 3) {
_local21 = 0;
while (_local21 < 4) {
_local18[_local20][_local21] = 0;
_local21++;
};
_local20++;
};
_local18[2][2] = norm(_local14, _local15, _local16);
_local19[2][0] = (_local14 / _local18[2][2]);
_local19[2][1] = (_local15 / _local18[2][2]);
_local19[2][2] = (_local16 / _local18[2][2]);
_local19[2][3] = (_local17 / _local18[2][2]);
_local18[1][2] = dot(_local19[2][0], _local19[2][1], _local19[2][2], _local10, _local11, _local12);
_local3 = (_local10 - (_local18[1][2] * _local19[2][0]));
_local4 = (_local11 - (_local18[1][2] * _local19[2][1]));
_local5 = (_local12 - (_local18[1][2] * _local19[2][2]));
_local18[1][1] = norm(_local3, _local4, _local5);
_local19[1][0] = (_local3 / _local18[1][1]);
_local19[1][1] = (_local4 / _local18[1][1]);
_local19[1][2] = (_local5 / _local18[1][1]);
_local18[0][2] = dot(_local19[2][0], _local19[2][1], _local19[2][2], _local6, _local7, _local8);
_local18[0][1] = dot(_local19[1][0], _local19[1][1], _local19[1][2], _local6, _local7, _local8);
_local3 = ((_local6 - (_local18[0][1] * _local19[1][0])) - (_local18[0][2] * _local19[2][0]));
_local4 = ((_local7 - (_local18[0][1] * _local19[1][1])) - (_local18[0][2] * _local19[2][1]));
_local5 = ((_local8 - (_local18[0][1] * _local19[1][2])) - (_local18[0][2] * _local19[2][2]));
_local18[0][0] = norm(_local3, _local4, _local5);
_local19[0][0] = (_local3 / _local18[0][0]);
_local19[0][1] = (_local4 / _local18[0][0]);
_local19[0][2] = (_local5 / _local18[0][0]);
_local19[1][3] = ((_local13 - (_local18[1][2] * _local19[2][3])) / _local18[1][1]);
_local19[0][3] = (((_local9 - (_local18[0][1] * _local19[1][3])) - (_local18[0][2] * _local19[2][3])) / _local18[0][0]);
_local20 = 0;
while (_local20 < 3) {
_local21 = 0;
while (_local21 < 3) {
_local18[_local20][_local21] = (_local18[_local20][_local21] / _local18[2][2]);
_local21++;
};
_local20++;
};
}
public function changeScale(_arg1:Number):void{
this.m00 = (this.m00 * _arg1);
this.m10 = (this.m10 * _arg1);
this.m01 = (this.m01 * _arg1);
this.m11 = (this.m11 * _arg1);
this.m02 = (this.m02 * _arg1);
this.m12 = (this.m12 * _arg1);
this.m03 = (this.m03 * _arg1);
this.m13 = (this.m13 * _arg1);
}
private static function dot(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Number{
return ((((_arg1 * _arg4) + (_arg2 * _arg5)) + (_arg3 * _arg6)));
}
private static function norm(_arg1:Number, _arg2:Number, _arg3:Number):Number{
return (Math.sqrt((((_arg1 * _arg1) + (_arg2 * _arg2)) + (_arg3 * _arg3))));
}
}
}//package org.libspark.flartoolkit.core.param
Section 92
//FLARDynamicRatioColorPatt_O3 (org.libspark.flartoolkit.core.pickup.FLARDynamicRatioColorPatt_O3)
package org.libspark.flartoolkit.core.pickup {
import org.libspark.flartoolkit.core.*;
import org.libspark.flartoolkit.core.raster.rgb.*;
import org.libspark.flartoolkit.core.rasterreader.*;
import org.libspark.flartoolkit.utils.*;
import org.libspark.flartoolkit.*;
public class FLARDynamicRatioColorPatt_O3 implements IFLARColorPatt {
private const WK_WORLD_ADD:uint = 10;
private const wk_get_cpara_a:FLARMat;
private const wk_get_cpara_b:FLARMat;
private const wk_pickFromRaster_cpara:FLARMat;
private const WK_WORLD_BASE:uint = 100;
private const wk_pickFromRaster_world:Array;
private var _pickFromRasterDivideX:Number;
private var _pickFromRasterDivideY:Number;
private var _extPatXwStep:Number;
private var _extPatXwBase:Number;
private var _height:int;
private var _width:int;
private var _extPatYwStep:Number;
private var _extPatYwBase:Number;
private var wk_updateExtpat_para00_xw:Array;
private var wk_updateExtpat_para10_xw:Array;
private var wk_updateExtpat_para20_xw:Array;
private var wk_updateExtpat_x_rgb_index:Array;
private var wk_updateExtpat_rgb_buf:Array;
private var wk_updateExtpat_i_rgb_index:Array;
private var extpat:Array;
private var wk_updateExtpat_y_rgb_index:Array;
private var wk_updateExtpat_buffer_size:int;// = 0
private static const AR_PATT_SAMPLE_NUM:int = 64;
public function FLARDynamicRatioColorPatt_O3(_arg1:int, _arg2:int, _arg3:Number=5, _arg4:Number=5){
var _local5:Number;
var _local6:Number;
wk_get_cpara_a = new FLARMat(8, 8);
wk_get_cpara_b = new FLARMat(8, 1);
wk_pickFromRaster_world = [[WK_WORLD_BASE, WK_WORLD_BASE], [(WK_WORLD_BASE + WK_WORLD_ADD), WK_WORLD_BASE], [(WK_WORLD_BASE + WK_WORLD_ADD), (WK_WORLD_BASE + WK_WORLD_ADD)], [WK_WORLD_BASE, (WK_WORLD_BASE + WK_WORLD_ADD)]];
wk_pickFromRaster_cpara = new FLARMat(8, 1);
wk_updateExtpat_buffer_size = 0;
super();
if ((((_arg3 < 0)) || ((_arg3 > WK_WORLD_ADD)))){
throw (new ArgumentError((("Marker width is between 0 and " + WK_WORLD_BASE) + ".")));
};
if ((((_arg4 < 0)) || ((_arg4 > WK_WORLD_ADD)))){
throw (new ArgumentError((("Marker height is between 0 and " + WK_WORLD_BASE) + ".")));
};
_local5 = ((WK_WORLD_ADD - _arg3) / 2);
_local6 = ((WK_WORLD_ADD - _arg4) / 2);
this._extPatXwBase = (WK_WORLD_BASE + _local5);
this._extPatYwBase = (WK_WORLD_BASE + _local6);
this._extPatXwStep = (WK_WORLD_ADD - (_local5 * 2));
this._extPatYwStep = (WK_WORLD_ADD - (_local6 * 2));
this._width = _arg1;
this._height = _arg2;
this._pickFromRasterDivideX = (AR_PATT_SAMPLE_NUM / _arg1);
this._pickFromRasterDivideY = (AR_PATT_SAMPLE_NUM / _arg2);
this.extpat = ArrayUtil.createJaggedArray(_arg2, _arg1, 3);
}
private function updateExtpat(_arg1:IFLARRgbRaster, _arg2:FLARMat, _arg3:int, _arg4:int):void{
var _local5:int;
var _local6:int;
var _local7:Array;
var _local8:int;
var _local9:int;
var _local10:Array;
var _local11:Array;
var _local12:Array;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:int;
var _local27:int;
var _local28:int;
var _local29:int;
var _local30:int;
var _local31:int;
var _local32:Array;
var _local33:Array;
var _local34:Array;
var _local35:Array;
var _local36:Array;
var _local37:Array;
var _local38:Array;
var _local39:Number;
var _local40:int;
var _local41:IFLARRgbPixelReader;
var _local42:int;
_local5 = _arg1.getWidth();
_local6 = _arg1.getHeight();
_local7 = this.extpat;
_local8 = this.width;
_local9 = this.height;
initValue_wk_pickFromRaster_ext_pat2(_local7, _local8, _local9);
_local12 = _arg2.getArray();
_local16 = _local12[((0 * 3) + 0)][0];
_local17 = _local12[((0 * 3) + 1)][0];
_local18 = _local12[((0 * 3) + 2)][0];
_local19 = _local12[((1 * 3) + 0)][0];
_local20 = _local12[((1 * 3) + 1)][0];
_local21 = _local12[((1 * 3) + 2)][0];
_local22 = _local12[((2 * 3) + 0)][0];
_local23 = _local12[((2 * 3) + 1)][0];
_local30 = (_arg3 / _local8);
_local31 = (_arg4 / _local9);
this.reservWorkBuffers(_arg3);
_local32 = this.wk_updateExtpat_para00_xw;
_local33 = this.wk_updateExtpat_para10_xw;
_local34 = this.wk_updateExtpat_para20_xw;
_local35 = this.wk_updateExtpat_x_rgb_index;
_local36 = this.wk_updateExtpat_y_rgb_index;
_local37 = this.wk_updateExtpat_i_rgb_index;
_local38 = this.wk_updateExtpat_rgb_buf;
_local28 = 0;
while (_local28 < _arg3) {
_local39 = (this._extPatXwBase + ((this._extPatXwStep * (_local28 + 0.5)) / _arg3));
_local34[_local28] = (_local22 * _local39);
_local32[_local28] = (_local16 * _local39);
_local33[_local28] = (_local19 * _local39);
_local28++;
};
_local41 = _arg1.getRgbPixelReader();
_local29 = 0;
while (_local29 < _arg4) {
_local25 = (this._extPatYwBase + ((this._extPatYwStep * (_local29 + 0.5)) / _arg4));
_local13 = ((_local23 * _local25) + 1);
_local15 = ((_local20 * _local25) + _local21);
_local14 = ((_local17 * _local25) + _local18);
_local10 = _local7[int((_local29 / _local31))];
_local40 = 0;
_local28 = 0;
while (_local28 < _arg3) {
_local24 = (_local34[_local28] + _local13);
if (_local24 == 0){
throw (new FLARException());
};
_local26 = int(((_local32[_local28] + _local14) / _local24));
_local27 = int(((_local33[_local28] + _local15) / _local24));
if ((((((((_local26 < 0)) || ((_local26 >= _local5)))) || ((_local27 < 0)))) || ((_local27 >= _local6)))){
} else {
_local35[_local40] = _local26;
_local36[_local40] = _local27;
_local37[_local40] = int((_local28 / _local30));
_local40++;
};
_local28++;
};
_local41.getPixelSet(_local35, _local36, _local40, _local38);
_local28 = (_local40 - 1);
while (_local28 >= 0) {
_local11 = _local10[_local37[_local28]];
_local11[0] = (_local11[0] + _local38[((_local28 * 3) + 0)]);
_local11[1] = (_local11[1] + _local38[((_local28 * 3) + 1)]);
_local11[2] = (_local11[2] + _local38[((_local28 * 3) + 2)]);
_local28--;
};
_local29++;
};
_local42 = (_local30 * _local31);
_local29 = (_local9 - 1);
while (_local29 >= 0) {
_local10 = _local7[_local29];
_local28 = (_local8 - 1);
while (_local28 >= 0) {
_local11 = _local10[_local28];
_local11[0] = (_local11[0] / _local42);
_local11[1] = (_local11[1] / _local42);
_local11[2] = (_local11[2] / _local42);
_local28--;
};
_local29--;
};
}
public function getWidth():int{
return (width);
}
public function set width(_arg1:int):void{
this._width = _arg1;
this._pickFromRasterDivideX = (AR_PATT_SAMPLE_NUM / _arg1);
this.extpat = ArrayUtil.createJaggedArray(this._height, this._width, 3);
}
public function get frameHeightByDec():Number{
return ((this._extPatXwBase - WK_WORLD_BASE));
}
private function get_cpara(_arg1:Array, _arg2:FLARMat):Boolean{
var _local3:Array;
var _local4:FLARMat;
var _local5:Array;
var _local6:FLARMat;
var _local7:Array;
var _local8:Array;
var _local9:Array;
var _local10:Array;
var _local11:int;
_local3 = this.wk_pickFromRaster_world;
_local4 = wk_get_cpara_a;
_local5 = _local4.getArray();
_local6 = wk_get_cpara_b;
_local7 = _local6.getArray();
_local11 = 0;
while (_local11 < 4) {
_local8 = _local5[(_local11 * 2)];
_local9 = _local5[((_local11 * 2) + 1)];
_local10 = _local3[_local11];
_local8[0] = _local10[0];
_local8[1] = _local10[1];
_local8[2] = 1;
_local8[3] = 0;
_local8[4] = 0;
_local8[5] = 0;
_local8[6] = (-(_local10[0]) * _arg1[_local11].x);
_local8[7] = (-(_local10[1]) * _arg1[_local11].x);
_local9[0] = 0;
_local9[1] = 0;
_local9[2] = 0;
_local9[3] = _local10[0];
_local9[4] = _local10[1];
_local9[5] = 1;
_local9[6] = (-(_local10[0]) * _arg1[_local11].y);
_local9[7] = (-(_local10[1]) * _arg1[_local11].y);
_local7[((_local11 * 2) + 0)][0] = _arg1[_local11].x;
_local7[((_local11 * 2) + 1)][0] = _arg1[_local11].y;
_local11++;
};
if (!_local4.matrixSelfInv()){
return (false);
};
_arg2.matrixMul(_local4, _local6);
return (true);
}
public function getHeight():int{
return (height);
}
public function set frameWidthByDec(_arg1:Number):void{
this._extPatXwBase = (WK_WORLD_BASE + _arg1);
this._extPatXwStep = (WK_WORLD_ADD - (_arg1 * 2));
}
public function get height():int{
return (_height);
}
public function set frameHeightByDec(_arg1:Number):void{
this._extPatXwBase = (WK_WORLD_BASE + _arg1);
this._extPatYwStep = (WK_WORLD_ADD - (_arg1 * 2));
}
public function pickFromRaster(_arg1:IFLARRgbRaster, _arg2:FLARSquare):Boolean{
var _local3:FLARMat;
var _local4:Array;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
_local3 = this.wk_pickFromRaster_cpara;
_local4 = _arg2.imvertex;
_local9 = (_local4[0].x - _local4[1].x);
_local10 = (_local4[0].y - _local4[1].y);
_local7 = ((_local9 * _local9) + (_local10 * _local10));
_local9 = (_local4[2].x - _local4[3].x);
_local10 = (_local4[2].y - _local4[3].y);
_local8 = ((_local9 * _local9) + (_local10 * _local10));
if (_local8 > _local7){
_local7 = _local8;
};
_local7 = (_local7 / this._pickFromRasterDivideX);
_local5 = this.width;
while ((_local5 * _local5) < _local7) {
_local5 = (_local5 * 2);
};
if (_local5 > AR_PATT_SAMPLE_NUM){
_local5 = AR_PATT_SAMPLE_NUM;
};
_local9 = (_local4[1].x - _local4[2].x);
_local10 = (_local4[1].y - _local4[2].y);
_local7 = ((_local9 * _local9) + (_local10 * _local10));
_local9 = (_local4[3].x - _local4[0].x);
_local10 = (_local4[3].y - _local4[0].y);
_local8 = ((_local9 * _local9) + (_local10 * _local10));
if (_local8 > _local7){
_local7 = _local8;
};
_local6 = this.height;
_local7 = (_local7 / this._pickFromRasterDivideY);
while ((_local6 * _local6) < _local7) {
_local6 = (_local6 * 2);
};
if (_local6 > AR_PATT_SAMPLE_NUM){
_local6 = AR_PATT_SAMPLE_NUM;
};
if (!get_cpara(_local4, _local3)){
return (false);
};
updateExtpat(_arg1, _local3, _local5, _local6);
return (true);
}
public function get width():int{
return (_width);
}
public function set height(_arg1:int):void{
this._height = _arg1;
this._pickFromRasterDivideY = (AR_PATT_SAMPLE_NUM / _arg1);
this.extpat = ArrayUtil.createJaggedArray(this._height, this._width, 3);
}
public function get frameWidthByDec():Number{
return ((this._extPatXwBase - WK_WORLD_BASE));
}
private function reservWorkBuffers(_arg1:int):void{
if (this.wk_updateExtpat_buffer_size < _arg1){
wk_updateExtpat_para00_xw = new Array(_arg1);
wk_updateExtpat_para10_xw = new Array(_arg1);
wk_updateExtpat_para20_xw = new Array(_arg1);
wk_updateExtpat_rgb_buf = new Array((_arg1 * 3));
wk_updateExtpat_x_rgb_index = new Array(_arg1);
wk_updateExtpat_y_rgb_index = new Array(_arg1);
wk_updateExtpat_i_rgb_index = new Array(_arg1);
this.wk_updateExtpat_buffer_size = _arg1;
};
}
public function getPatArray():Array{
return (extpat);
}
private static function initValue_wk_pickFromRaster_ext_pat2(_arg1:Array, _arg2:int, _arg3:int):void{
var _local4:int;
var _local5:int;
var _local6:Array;
var _local7:Array;
_local4 = (_arg3 - 1);
while (_local4 >= 0) {
_local6 = _arg1[_local4];
_local5 = (_arg2 - 1);
while (_local5 >= 0) {
_local7 = _local6[_local5];
_local7[0] = 0;
_local7[1] = 0;
_local7[2] = 0;
_local5--;
};
_local4--;
};
}
}
}//package org.libspark.flartoolkit.core.pickup
Section 93
//IFLARColorPatt (org.libspark.flartoolkit.core.pickup.IFLARColorPatt)
package org.libspark.flartoolkit.core.pickup {
import org.libspark.flartoolkit.core.*;
import org.libspark.flartoolkit.core.raster.rgb.*;
public interface IFLARColorPatt {
function getWidth():int;
function pickFromRaster(_arg1:IFLARRgbRaster, _arg2:FLARSquare):Boolean;
function getPatArray():Array;
function getHeight():int;
}
}//package org.libspark.flartoolkit.core.pickup
Section 94
//FLARRgbRaster_BitmapData (org.libspark.flartoolkit.core.raster.rgb.FLARRgbRaster_BitmapData)
package org.libspark.flartoolkit.core.raster.rgb {
import flash.display.*;
import org.libspark.flartoolkit.core.types.*;
import org.libspark.flartoolkit.core.rasterreader.*;
import org.libspark.flartoolkit.core.raster.*;
public class FLARRgbRaster_BitmapData extends FLARRaster_BasicClass implements IFLARRgbRaster {
private var _buffer_reader:IFLARBufferReader;
private var _rgb_reader:IFLARRgbPixelReader;
private var _bitmapData:BitmapData;
public function FLARRgbRaster_BitmapData(_arg1:BitmapData){
super(new FLARIntSize(_arg1.width, _arg1.height));
this._bitmapData = _arg1;
this._rgb_reader = new FLARBitmapDataReader(this);
}
override public function getBufferReader():IFLARBufferReader{
return (null);
}
public function getRgbPixelReader():IFLARRgbPixelReader{
return (this._rgb_reader);
}
public function get bitmapData():BitmapData{
return (this._bitmapData);
}
}
}//package org.libspark.flartoolkit.core.raster.rgb
Section 95
//IFLARRgbRaster (org.libspark.flartoolkit.core.raster.rgb.IFLARRgbRaster)
package org.libspark.flartoolkit.core.raster.rgb {
import org.libspark.flartoolkit.core.rasterreader.*;
import org.libspark.flartoolkit.core.raster.*;
public interface IFLARRgbRaster extends IFLARRaster {
function getRgbPixelReader():IFLARRgbPixelReader;
}
}//package org.libspark.flartoolkit.core.raster.rgb
Section 96
//FLARRaster_BasicClass (org.libspark.flartoolkit.core.raster.FLARRaster_BasicClass)
package org.libspark.flartoolkit.core.raster {
import org.libspark.flartoolkit.core.types.*;
import org.libspark.flartoolkit.core.rasterreader.*;
public class FLARRaster_BasicClass implements IFLARRaster {
protected var _size:FLARIntSize;
public function FLARRaster_BasicClass(_arg1:FLARIntSize){
this._size = _arg1;
}
public function getHeight():int{
return (this._size.h);
}
public function getSize():FLARIntSize{
return (this._size);
}
public function getBufferReader():IFLARBufferReader{
return (null);
}
public function getWidth():int{
return (this._size.w);
}
}
}//package org.libspark.flartoolkit.core.raster
Section 97
//FLARRaster_BitmapData (org.libspark.flartoolkit.core.raster.FLARRaster_BitmapData)
package org.libspark.flartoolkit.core.raster {
import flash.display.*;
import org.libspark.flartoolkit.core.types.*;
import org.libspark.flartoolkit.core.rasterreader.*;
public class FLARRaster_BitmapData extends FLARRaster_BasicClass implements IFLARRaster {
private var _bitmapData:BitmapData;
public function FLARRaster_BitmapData(_arg1:int, _arg2:int){
super(new FLARIntSize(_arg1, _arg2));
this._bitmapData = new BitmapData(_arg1, _arg2, false, 0);
}
override public function getBufferReader():IFLARBufferReader{
return (null);
}
public function get bitmapData():BitmapData{
return (this._bitmapData);
}
}
}//package org.libspark.flartoolkit.core.raster
Section 98
//IFLARRaster (org.libspark.flartoolkit.core.raster.IFLARRaster)
package org.libspark.flartoolkit.core.raster {
import org.libspark.flartoolkit.core.types.*;
import org.libspark.flartoolkit.core.rasterreader.*;
public interface IFLARRaster {
function getWidth():int;
function getSize():FLARIntSize;
function getBufferReader():IFLARBufferReader;
function getHeight():int;
}
}//package org.libspark.flartoolkit.core.raster
Section 99
//FLARRasterFilter_BitmapDataThreshold (org.libspark.flartoolkit.core.rasterfilter.rgb2bin.FLARRasterFilter_BitmapDataThreshold)
package org.libspark.flartoolkit.core.rasterfilter.rgb2bin {
import flash.display.*;
import flash.geom.*;
import org.libspark.flartoolkit.core.raster.rgb.*;
import org.libspark.flartoolkit.core.raster.*;
import flash.filters.*;
public class FLARRasterFilter_BitmapDataThreshold implements IFLARRasterFilter_RgbToBin {
private var _threshold:int;
private var _tmp:BitmapData;
private static const MONO_FILTER:ColorMatrixFilter = new ColorMatrixFilter([0.2989, 0.5866, 0.1145, 0, 0, 0.2989, 0.5866, 0.1145, 0, 0, 0.2989, 0.5866, 0.1145, 0, 0, 0, 0, 0, 1, 0]);
private static const ONE_POINT:Point = new Point(1, 1);
private static const ZERO_POINT:Point = new Point();
public function FLARRasterFilter_BitmapDataThreshold(_arg1:int){
this._threshold = _arg1;
}
public function setThreshold(_arg1:int):void{
this._threshold = _arg1;
}
public function doFilter(_arg1:IFLARRgbRaster, _arg2:IFLARRaster):void{
var _local3:BitmapData;
var _local4:BitmapData;
var _local5:Rectangle;
_local3 = FLARRgbRaster_BitmapData(_arg1).bitmapData;
if (!this._tmp){
this._tmp = new BitmapData(_local3.width, _local3.height, false, 0);
} else {
if (((!((_local3.width == this._tmp.width))) || (!((_local3.height == this._tmp.height))))){
this._tmp.dispose();
this._tmp = new BitmapData(_local3.width, _local3.height, false, 0);
};
};
this._tmp.applyFilter(_local3, _local3.rect, ZERO_POINT, MONO_FILTER);
_local4 = FLARRaster_BitmapData(_arg2).bitmapData;
FLARRaster_BitmapData(_arg2).bitmapData.fillRect(_local4.rect, 0);
_local5 = _local4.rect;
_local5.inflate(-1, -1);
_local4.threshold(this._tmp, _local5, ONE_POINT, "<=", this._threshold, 4294967295, 0xFF);
}
}
}//package org.libspark.flartoolkit.core.rasterfilter.rgb2bin
Section 100
//IFLARRasterFilter_RgbToBin (org.libspark.flartoolkit.core.rasterfilter.rgb2bin.IFLARRasterFilter_RgbToBin)
package org.libspark.flartoolkit.core.rasterfilter.rgb2bin {
import org.libspark.flartoolkit.core.raster.rgb.*;
import org.libspark.flartoolkit.core.raster.*;
public interface IFLARRasterFilter_RgbToBin {
function setThreshold(_arg1:int):void;
function doFilter(_arg1:IFLARRgbRaster, _arg2:IFLARRaster):void;
}
}//package org.libspark.flartoolkit.core.rasterfilter.rgb2bin
Section 101
//FLARBitmapDataReader (org.libspark.flartoolkit.core.rasterreader.FLARBitmapDataReader)
package org.libspark.flartoolkit.core.rasterreader {
import flash.display.*;
import org.libspark.flartoolkit.core.raster.rgb.*;
public class FLARBitmapDataReader implements IFLARRgbPixelReader {
private var _parent:FLARRgbRaster_BitmapData;
public function FLARBitmapDataReader(_arg1:FLARRgbRaster_BitmapData){
this._parent = _arg1;
}
public function getPixel(_arg1:int, _arg2:int, _arg3:Array):void{
var _local4:int;
_local4 = this._parent.bitmapData.getPixel(_arg1, _arg2);
_arg3[0] = ((_local4 >> 16) & 0xFF);
_arg3[1] = ((_local4 >> 8) & 0xFF);
_arg3[2] = (_local4 & 0xFF);
}
public function getPixelSet(_arg1:Array, _arg2:Array, _arg3:int, _arg4:Array):void{
var _local5:BitmapData;
var _local6:int;
var _local7:int;
_local5 = this._parent.bitmapData;
_local7 = 0;
while (_local7 < _arg3) {
_local6 = _local5.getPixel(_arg1[_local7], _arg2[_local7]);
_arg4[((_local7 * 3) + 0)] = ((_local6 >> 16) & 0xFF);
_arg4[((_local7 * 3) + 1)] = ((_local6 >> 8) & 0xFF);
_arg4[((_local7 * 3) + 2)] = (_local6 & 0xFF);
_local7++;
};
}
}
}//package org.libspark.flartoolkit.core.rasterreader
Section 102
//IFLARBufferReader (org.libspark.flartoolkit.core.rasterreader.IFLARBufferReader)
package org.libspark.flartoolkit.core.rasterreader {
public interface IFLARBufferReader {
function getBufferType():int;
function isEqualBufferType(_arg1:int):Boolean;
function getBuffer():Object;
}
}//package org.libspark.flartoolkit.core.rasterreader
Section 103
//IFLARRgbPixelReader (org.libspark.flartoolkit.core.rasterreader.IFLARRgbPixelReader)
package org.libspark.flartoolkit.core.rasterreader {
public interface IFLARRgbPixelReader {
function getPixel(_arg1:int, _arg2:int, _arg3:Array):void;
function getPixelSet(_arg1:Array, _arg2:Array, _arg3:int, _arg4:Array):void;
}
}//package org.libspark.flartoolkit.core.rasterreader
Section 104
//FLARFitVecCalculator (org.libspark.flartoolkit.core.transmat.fitveccalc.FLARFitVecCalculator)
package org.libspark.flartoolkit.core.transmat.fitveccalc {
import org.libspark.flartoolkit.core.param.*;
import org.libspark.flartoolkit.core.*;
import org.libspark.flartoolkit.core.transmat.*;
import org.libspark.flartoolkit.core.types.*;
import org.libspark.flartoolkit.core.transmat.rotmatrix.*;
public class FLARFitVecCalculator {
private const _mat_a:FLARMat;
private const _mat_b:FLARMat;
private const _mat_f:FLARMat;
private const _mat_d:FLARMat;
private const _mat_e:FLARMat;
private const __calculateTransferVec_mat_c:FLARMat;
private const _fitsquare_vertex:Array;
private const __calculateTransfer_point3d:Array;
private var _offset_square:FLARTransOffset;
private var _distortionfactor:FLARCameraDistortionFactor;
private var _projection_mat:FLARPerspectiveProjectionMatrix;
public function FLARFitVecCalculator(_arg1:FLARPerspectiveProjectionMatrix, _arg2:FLARCameraDistortionFactor){
var _local3:Array;
var _local4:Array;
var _local5:int;
var _local6:int;
_mat_b = new FLARMat(3, 8);
_mat_a = new FLARMat(8, 3);
_mat_d = new FLARMat(3, 3);
_fitsquare_vertex = FLARDoublePoint2d.createArray(4);
_mat_e = new FLARMat(3, 1);
_mat_f = new FLARMat(3, 1);
__calculateTransferVec_mat_c = new FLARMat(8, 1);
__calculateTransfer_point3d = FLARDoublePoint3d.createArray(4);
super();
_local3 = this._mat_a.getArray();
_local4 = this._mat_b.getArray();
_local5 = 0;
while (_local5 < 4) {
_local6 = (_local5 * 2);
_local3[_local6][0] = (_local4[0][_local6] = _arg1.m00);
_local3[_local6][1] = (_local4[1][_local6] = _arg1.m01);
_local3[(_local6 + 1)][0] = (_local4[0][(_local6 + 1)] = 0);
_local3[(_local6 + 1)][1] = (_local4[1][(_local6 + 1)] = _arg1.m11);
_local5++;
};
this._projection_mat = _arg1;
this._distortionfactor = _arg2;
}
public function setOffsetSquare(_arg1:FLARTransOffset):void{
this._offset_square = _arg1;
}
public function getFitSquare():Array{
return (this._fitsquare_vertex);
}
public function getOffsetVertex():FLARTransOffset{
return (this._offset_square);
}
public function setFittedSquare(_arg1:Array):void{
var _local2:Array;
var _local3:Number;
var _local4:Number;
var _local5:FLARMat;
var _local6:FLARMat;
var _local7:FLARMat;
var _local8:Array;
var _local9:Array;
var _local10:int;
var _local11:int;
_local2 = _fitsquare_vertex;
this._distortionfactor.ideal2ObservBatch(_arg1, _local2, 4);
_local3 = this._projection_mat.m02;
_local4 = this._projection_mat.m12;
_local5 = _mat_d;
_local6 = this._mat_a;
_local7 = this._mat_b;
_local8 = _local6.getArray();
_local9 = _local7.getArray();
_local10 = 0;
while (_local10 < 4) {
_local11 = (_local10 * 2);
_local8[_local11][2] = (_local9[2][_local11] = (_local3 - _local2[_local10].x));
_local8[(_local11 + 1)][2] = (_local9[2][(_local11 + 1)] = (_local4 - _local2[_local10].y));
_local10++;
};
_local5.matrixMul(_local7, _local6);
_local5.matrixSelfInv();
}
public function calculateTransfer(_arg1:FLARRotMatrix, _arg2:FLARDoublePoint3d):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Array;
var _local9:Array;
var _local10:Array;
var _local11:FLARMat;
var _local12:Array;
var _local13:Array;
var _local14:int;
var _local15:int;
var _local16:FLARDoublePoint3d;
_local3 = this._projection_mat.m00;
_local4 = this._projection_mat.m01;
_local5 = this._projection_mat.m02;
_local6 = this._projection_mat.m11;
_local7 = this._projection_mat.m12;
_local8 = this.__calculateTransfer_point3d;
_local9 = this._offset_square.vertex;
_local10 = this._fitsquare_vertex;
_local11 = this.__calculateTransferVec_mat_c;
_local12 = this._mat_f.getArray();
_local13 = _local11.getArray();
_arg1.getPoint3dBatch(_local9, _local8, 4);
_local14 = 0;
while (_local14 < 4) {
_local15 = (_local14 + _local14);
_local16 = _local8[_local14];
_local13[_local15][0] = ((((_local16.z * _local10[_local14].x) - (_local3 * _local16.x)) - (_local4 * _local16.y)) - (_local5 * _local16.z));
_local13[(_local15 + 1)][0] = (((_local16.z * _local10[_local14].y) - (_local6 * _local16.y)) - (_local7 * _local16.z));
_local14++;
};
this._mat_e.matrixMul(this._mat_b, _local11);
this._mat_f.matrixMul(this._mat_d, this._mat_e);
_arg2.x = _local12[0][0];
_arg2.y = _local12[1][0];
_arg2.z = _local12[2][0];
}
}
}//package org.libspark.flartoolkit.core.transmat.fitveccalc
Section 105
//FLARRotTransOptimize (org.libspark.flartoolkit.core.transmat.optimize.FLARRotTransOptimize)
package org.libspark.flartoolkit.core.transmat.optimize {
import org.libspark.flartoolkit.core.param.*;
import org.libspark.flartoolkit.core.types.*;
import org.libspark.flartoolkit.utils.*;
import org.libspark.flartoolkit.core.transmat.rotmatrix.*;
import org.libspark.flartoolkit.core.transmat.fitveccalc.*;
public class FLARRotTransOptimize implements IFLARRotTransOptimize {
private const __modifyMatrix_double1D:Array;
private const __modifyMatrix_angle:FLARDoublePoint3d;
private var _projection_mat_ref:FLARPerspectiveProjectionMatrix;
private static const AR_GET_TRANS_MAT_MAX_FIT_ERROR:Number = 1;
private static const AR_GET_TRANS_MAT_MAX_LOOP_COUNT:int = 5;
public function FLARRotTransOptimize(_arg1:FLARPerspectiveProjectionMatrix){
__modifyMatrix_double1D = ArrayUtil.createJaggedArray(8, 3);
__modifyMatrix_angle = new FLARDoublePoint3d();
super();
this._projection_mat_ref = _arg1;
}
public function optimize(_arg1:FLARRotMatrix, _arg2:FLARDoublePoint3d, _arg3:FLARFitVecCalculator):Number{
var _local4:Array;
var _local5:Array;
var _local6:Number;
var _local7:int;
_local4 = _arg3.getFitSquare();
_local5 = _arg3.getOffsetVertex().vertex;
_local6 = -1;
_local7 = 0;
while (true) {
_local6 = modifyMatrix(_arg1, _arg2, _local5, _local4);
_arg3.calculateTransfer(_arg1, _arg2);
_local6 = modifyMatrix(_arg1, _arg2, _local5, _local4);
if ((((_local6 < AR_GET_TRANS_MAT_MAX_FIT_ERROR)) || ((_local7 == (AR_GET_TRANS_MAT_MAX_LOOP_COUNT - 1))))){
break;
};
_arg3.calculateTransfer(_arg1, _arg2);
_local7++;
};
return (_local6);
}
private function modifyMatrix(_arg1:FLARRotMatrix, _arg2:FLARDoublePoint3d, _arg3:Array, _arg4:Array):Number{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:int;
var _local18:int;
var _local19:int;
var _local20:int;
var _local21:int;
var _local22:int;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:Number;
var _local40:Number;
var _local41:Number;
var _local42:Number;
var _local43:Number;
var _local44:Number;
var _local45:Number;
var _local46:Number;
var _local47:Number;
var _local48:Number;
var _local49:Number;
var _local50:Number;
var _local51:Number;
var _local52:Number;
var _local53:Number;
var _local54:Number;
var _local55:Number;
var _local56:Number;
var _local57:Number;
var _local58:Number;
var _local59:Number;
var _local60:Number;
var _local61:Number;
var _local62:Number;
var _local63:Number;
var _local64:Number;
var _local65:FLARDoublePoint3d;
var _local66:Number;
var _local67:Number;
var _local68:Number;
var _local69:Number;
var _local70:Number;
var _local71:Number;
var _local72:Number;
var _local73:Number;
var _local74:FLARDoublePoint2d;
var _local75:FLARPerspectiveProjectionMatrix;
var _local76:Number;
var _local77:Number;
var _local78:Number;
var _local79:Number;
var _local80:Number;
var _local81:Number;
var _local82:Number;
var _local83:Number;
var _local84:Number;
var _local85:Number;
var _local86:Number;
var _local87:Number;
var _local88:Number;
var _local89:Number;
var _local90:Number;
var _local91:Number;
var _local92:Number;
var _local93:Number;
var _local94:Number;
var _local95:Number;
var _local96:Number;
var _local97:Number;
var _local98:Number;
var _local99:Array;
var _local100:FLARDoublePoint3d;
var _local101:Array;
var _local102:Array;
var _local103:Array;
var _local104:Array;
var _local105:Array;
var _local106:Array;
var _local107:Array;
var _local108:Number;
var _local109:Number;
var _local110:Number;
var _local111:Number;
var _local112:int;
var _local113:int;
_local9 = 0;
_local10 = 0;
_local11 = 0;
_local16 = 0;
_local20 = 0;
_local21 = 0;
_local22 = 0;
_local5 = ((10 * Math.PI) / 180);
_local65 = _arg3[0];
_local53 = _local65.x;
_local54 = _local65.y;
_local55 = _local65.z;
_local65 = _arg3[1];
_local56 = _local65.x;
_local57 = _local65.y;
_local58 = _local65.z;
_local65 = _arg3[2];
_local59 = _local65.x;
_local60 = _local65.y;
_local61 = _local65.z;
_local65 = _arg3[3];
_local62 = _local65.x;
_local63 = _local65.y;
_local64 = _local65.z;
_local74 = _arg4[0];
_local66 = _local74.x;
_local67 = _local74.y;
_local74 = _arg4[1];
_local68 = _local74.x;
_local69 = _local74.y;
_local74 = _arg4[2];
_local70 = _local74.x;
_local71 = _local74.y;
_local74 = _arg4[3];
_local72 = _local74.x;
_local73 = _local74.y;
_local75 = this._projection_mat_ref;
_local76 = _local75.m00;
_local77 = _local75.m01;
_local78 = _local75.m02;
_local79 = _local75.m10;
_local80 = _local75.m11;
_local81 = _local75.m12;
_local82 = _local75.m20;
_local83 = _local75.m21;
_local84 = _local75.m22;
_local32 = ((((_local76 * _arg2.x) + (_local77 * _arg2.y)) + (_local78 * _arg2.z)) + _local75.m03);
_local36 = ((((_local79 * _arg2.x) + (_local80 * _arg2.y)) + (_local81 * _arg2.z)) + _local75.m13);
_local40 = ((((_local82 * _arg2.x) + (_local83 * _arg2.y)) + (_local84 * _arg2.z)) + _local75.m23);
_local99 = this.__modifyMatrix_double1D;
_local100 = this.__modifyMatrix_angle;
_local101 = _local99[1];
_local102 = _local99[2];
_local103 = _local99[3];
_local104 = _local99[4];
_local105 = _local99[5];
_local106 = _local99[6];
_local107 = _local99[7];
_arg1.getAngle(_local100);
_local6 = _local100.x;
_local7 = _local100.y;
_local8 = _local100.z;
_local112 = 0;
while (_local112 < 10) {
_local16 = 1000000000;
_local113 = 0;
while (_local113 < 3) {
_local109 = (_local5 * (_local113 - 1));
_local108 = (_local6 + _local109);
_local101[_local113] = _local108;
_local108 = (_local7 + _local109);
_local104[_local113] = _local108;
_local102[_local113] = Math.sin(_local108);
_local103[_local113] = Math.cos(_local108);
_local108 = (_local8 + _local109);
_local107[_local113] = _local108;
_local105[_local113] = Math.sin(_local108);
_local106[_local113] = Math.cos(_local108);
_local113++;
};
_local17 = 0;
while (_local17 < 3) {
_local89 = Math.sin(_local101[_local17]);
_local88 = Math.cos(_local101[_local17]);
_local85 = (Math.cos(_local101[_local17]) * _local88);
_local86 = (_local89 * _local89);
_local87 = (_local89 * _local88);
_local18 = 0;
while (_local18 < 3) {
_local110 = _local102[_local18];
_local111 = _local103[_local18];
_local90 = (_local85 * _local111);
_local91 = (_local87 * _local111);
_local92 = (_local86 * _local111);
_local93 = (_local88 * _local110);
_local94 = (_local89 * _local110);
_local31 = (((_local76 * _local93) + (_local77 * _local94)) + (_local78 * _local111));
_local35 = (((_local79 * _local93) + (_local80 * _local94)) + (_local81 * _local111));
_local39 = (((_local82 * _local93) + (_local83 * _local94)) + (_local84 * _local111));
_local41 = ((_local31 * _local55) + _local32);
_local42 = ((_local31 * _local58) + _local32);
_local43 = ((_local31 * _local61) + _local32);
_local44 = ((_local31 * _local64) + _local32);
_local49 = ((_local35 * _local55) + _local36);
_local50 = ((_local35 * _local58) + _local36);
_local51 = ((_local35 * _local61) + _local36);
_local52 = ((_local35 * _local64) + _local36);
_local45 = ((_local39 * _local55) + _local40);
_local46 = ((_local39 * _local58) + _local40);
_local47 = ((_local39 * _local61) + _local40);
_local48 = ((_local39 * _local64) + _local40);
_local19 = 0;
while (_local19 < 3) {
_local110 = _local105[_local19];
_local111 = _local106[_local19];
_local95 = (_local87 * _local110);
_local98 = (_local87 * _local111);
_local96 = (_local91 * _local110);
_local97 = (_local91 * _local111);
_local23 = ((((_local90 * _local111) + (_local86 * _local111)) + _local96) - _local95);
_local25 = (((_local97 - _local98) + (_local92 * _local110)) + (_local85 * _local110));
_local27 = ((-(_local93) * _local111) - (_local94 * _local110));
_local29 = (((_local76 * _local23) + (_local77 * _local25)) + (_local78 * _local27));
_local33 = (((_local79 * _local23) + (_local80 * _local25)) + (_local81 * _local27));
_local37 = (((_local82 * _local23) + (_local83 * _local25)) + (_local84 * _local27));
_local24 = ((((-(_local90) * _local110) - (_local86 * _local110)) + _local97) - _local98);
_local26 = (((-(_local96) + _local95) + (_local92 * _local111)) + (_local85 * _local111));
_local28 = ((_local93 * _local110) - (_local94 * _local111));
_local30 = (((_local76 * _local24) + (_local77 * _local26)) + (_local78 * _local28));
_local34 = (((_local79 * _local24) + (_local80 * _local26)) + (_local81 * _local28));
_local38 = (((_local82 * _local24) + (_local83 * _local26)) + (_local84 * _local28));
_local15 = 0;
_local12 = (((_local37 * _local53) + (_local38 * _local54)) + _local45);
_local13 = (_local66 - ((((_local29 * _local53) + (_local30 * _local54)) + _local41) / _local12));
_local14 = (_local67 - ((((_local33 * _local53) + (_local34 * _local54)) + _local49) / _local12));
_local15 = (_local15 + ((_local13 * _local13) + (_local14 * _local14)));
_local12 = (((_local37 * _local56) + (_local38 * _local57)) + _local46);
_local13 = (_local68 - ((((_local29 * _local56) + (_local30 * _local57)) + _local42) / _local12));
_local14 = (_local69 - ((((_local33 * _local56) + (_local34 * _local57)) + _local50) / _local12));
_local15 = (_local15 + ((_local13 * _local13) + (_local14 * _local14)));
_local12 = (((_local37 * _local59) + (_local38 * _local60)) + _local47);
_local13 = (_local70 - ((((_local29 * _local59) + (_local30 * _local60)) + _local43) / _local12));
_local14 = (_local71 - ((((_local33 * _local59) + (_local34 * _local60)) + _local51) / _local12));
_local15 = (_local15 + ((_local13 * _local13) + (_local14 * _local14)));
_local12 = (((_local37 * _local62) + (_local38 * _local63)) + _local48);
_local13 = (_local72 - ((((_local29 * _local62) + (_local30 * _local63)) + _local44) / _local12));
_local14 = (_local73 - ((((_local33 * _local62) + (_local34 * _local63)) + _local52) / _local12));
_local15 = (_local15 + ((_local13 * _local13) + (_local14 * _local14)));
if (_local15 < _local16){
_local16 = _local15;
_local9 = _local101[_local17];
_local10 = _local104[_local18];
_local11 = _local107[_local19];
_local20 = (_local17 - 1);
_local21 = (_local18 - 1);
_local22 = (_local19 - 1);
};
_local19++;
};
_local18++;
};
_local17++;
};
if ((((((_local20 == 0)) && ((_local21 == 0)))) && ((_local22 == 0)))){
_local5 = (_local5 * 0.5);
};
_local6 = _local9;
_local7 = _local10;
_local8 = _local11;
_local112++;
};
_arg1.setAngle(_local9, _local10, _local11);
return ((_local16 / 4));
}
}
}//package org.libspark.flartoolkit.core.transmat.optimize
Section 106
//IFLARRotTransOptimize (org.libspark.flartoolkit.core.transmat.optimize.IFLARRotTransOptimize)
package org.libspark.flartoolkit.core.transmat.optimize {
import org.libspark.flartoolkit.core.types.*;
import org.libspark.flartoolkit.core.transmat.rotmatrix.*;
import org.libspark.flartoolkit.core.transmat.fitveccalc.*;
public interface IFLARRotTransOptimize {
function optimize(_arg1:FLARRotMatrix, _arg2:FLARDoublePoint3d, _arg3:FLARFitVecCalculator):Number;
}
}//package org.libspark.flartoolkit.core.transmat.optimize
Section 107
//FLARRotMatrix (org.libspark.flartoolkit.core.transmat.rotmatrix.FLARRotMatrix)
package org.libspark.flartoolkit.core.transmat.rotmatrix {
import org.libspark.flartoolkit.core.param.*;
import org.libspark.flartoolkit.core.transmat.*;
import org.libspark.flartoolkit.core.types.*;
import org.libspark.flartoolkit.core.types.matrix.*;
public class FLARRotMatrix extends FLARDoubleMatrix33 {
private var __initRot_vec1:FLARRotVector;
private var __initRot_vec2:FLARRotVector;
public function FLARRotMatrix(_arg1:FLARPerspectiveProjectionMatrix){
this.__initRot_vec1 = new FLARRotVector(_arg1);
this.__initRot_vec2 = new FLARRotVector(_arg1);
}
public function setAngle(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
_local4 = Math.sin(_arg1);
_local5 = Math.cos(_arg1);
_local6 = Math.sin(_arg2);
_local7 = Math.cos(_arg2);
_local8 = Math.sin(_arg3);
_local9 = Math.cos(_arg3);
_local10 = (_local5 * _local5);
_local11 = (_local4 * _local4);
_local12 = (_local4 * _local5);
_local13 = (_local4 * _local6);
_local14 = (_local5 * _local6);
_local15 = (_local12 * _local7);
this.m00 = (((((_local10 * _local7) * _local9) + (_local11 * _local9)) + (_local15 * _local8)) - (_local12 * _local8));
this.m01 = (((((-(_local10) * _local7) * _local8) - (_local11 * _local8)) + (_local15 * _local9)) - (_local12 * _local9));
this.m02 = _local14;
this.m10 = ((((_local15 * _local9) - (_local12 * _local9)) + ((_local11 * _local7) * _local8)) + (_local10 * _local8));
this.m11 = ((((-(_local15) * _local8) + (_local12 * _local8)) + ((_local11 * _local7) * _local9)) + (_local10 * _local9));
this.m12 = _local13;
this.m20 = ((-(_local14) * _local9) - (_local13 * _local8));
this.m21 = ((_local14 * _local8) - (_local13 * _local9));
this.m22 = _local7;
}
public function initRotBySquare(_arg1:Array, _arg2:Array):void{
var _local3:FLARRotVector;
var _local4:FLARRotVector;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local3 = this.__initRot_vec1;
_local4 = this.__initRot_vec2;
_local3.exteriorProductFromLinear(_arg1[0], _arg1[2]);
_local3.checkVectorByVertex(_arg2[0], _arg2[1]);
_local4.exteriorProductFromLinear(_arg1[1], _arg1[3]);
_local4.checkVectorByVertex(_arg2[3], _arg2[0]);
FLARRotVector.checkRotation(_local3, _local4);
this.m00 = _local3.v1;
this.m10 = _local3.v2;
this.m20 = _local3.v3;
this.m01 = _local4.v1;
this.m11 = _local4.v2;
this.m21 = _local4.v3;
_local5 = ((_local3.v2 * _local4.v3) - (_local3.v3 * _local4.v2));
_local6 = ((_local3.v3 * _local4.v1) - (_local3.v1 * _local4.v3));
_local7 = ((_local3.v1 * _local4.v2) - (_local3.v2 * _local4.v1));
_local8 = Math.sqrt((((_local5 * _local5) + (_local6 * _local6)) + (_local7 * _local7)));
this.m02 = (_local5 / _local8);
this.m12 = (_local6 / _local8);
this.m22 = (_local7 / _local8);
}
public function getAngle(_arg1:FLARDoublePoint3d):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
if (this.m22 > 1){
this.m22 = 1;
} else {
if (this.m22 < -1){
this.m22 = -1;
};
};
_local8 = this.m22;
_local3 = Math.acos(_local8);
_local7 = Math.sin(_local3);
_local11 = this.m02;
_local12 = this.m12;
if ((((_local3 >= 1E-6)) || ((_local3 <= -1E-6)))){
_local6 = (_local11 / _local7);
_local5 = (_local12 / _local7);
if (_local6 > 1){
_local6 = 1;
_local5 = 0;
};
if (_local6 < -1){
_local6 = -1;
_local5 = 0;
};
if (_local5 > 1){
_local5 = 1;
_local6 = 0;
};
if (_local5 < -1){
_local5 = -1;
_local6 = 0;
};
_local2 = Math.acos(_local6);
if (_local5 < 0){
_local2 = -(_local2);
};
_local13 = ((_local11 * _local11) + (_local12 * _local12));
_local9 = (((this.m21 * _local11) - (this.m20 * _local12)) / _local13);
_local10 = (-(((_local11 * this.m20) + (_local12 * this.m21))) / _local13);
if (_local10 > 1){
_local10 = 1;
_local9 = 0;
};
if (_local10 < -1){
_local10 = -1;
_local9 = 0;
};
if (_local9 > 1){
_local9 = 1;
_local10 = 0;
};
if (_local9 < -1){
_local9 = -1;
_local10 = 0;
};
_local4 = Math.acos(_local10);
if (_local9 < 0){
_local4 = -(_local4);
};
} else {
_local3 = 0;
_local2 = _local3;
_local8 = 1;
_local6 = _local8;
_local7 = 0;
_local5 = _local7;
_local10 = this.m00;
_local9 = this.m01;
if (_local10 > 1){
_local10 = 1;
_local9 = 0;
};
if (_local10 < -1){
_local10 = -1;
_local9 = 0;
};
if (_local9 > 1){
_local9 = 1;
_local10 = 0;
};
if (_local9 < -1){
_local9 = -1;
_local10 = 0;
};
_local4 = Math.acos(_local10);
if (_local9 < 0){
_local4 = -(_local4);
};
};
_arg1.x = _local2;
_arg1.y = _local3;
_arg1.z = _local4;
}
public function getPoint3dBatch(_arg1:Array, _arg2:Array, _arg3:int):void{
var _local4:int;
var _local5:FLARDoublePoint3d;
var _local6:FLARDoublePoint3d;
var _local7:Number;
var _local8:Number;
var _local9:Number;
_local4 = (_arg3 - 1);
while (_local4 >= 0) {
_local5 = _arg2[_local4];
_local6 = _arg1[_local4];
_local7 = _local6.x;
_local8 = _local6.y;
_local9 = _local6.z;
_local5.x = (((this.m00 * _local7) + (this.m01 * _local8)) + (this.m02 * _local9));
_local5.y = (((this.m10 * _local7) + (this.m11 * _local8)) + (this.m12 * _local9));
_local5.z = (((this.m20 * _local7) + (this.m21 * _local8)) + (this.m22 * _local9));
_local4--;
};
}
public function getPoint3d(_arg1:FLARDoublePoint3d, _arg2:FLARDoublePoint3d):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local3 = _arg1.x;
_local4 = _arg1.y;
_local5 = _arg1.z;
_arg2.x = (((this.m00 * _local3) + (this.m01 * _local4)) + (this.m02 * _local5));
_arg2.y = (((this.m10 * _local3) + (this.m11 * _local4)) + (this.m12 * _local5));
_arg2.z = (((this.m20 * _local3) + (this.m21 * _local4)) + (this.m22 * _local5));
}
public function initRotByPrevResult(_arg1:FLARTransMatResult):void{
this.m00 = _arg1.m00;
this.m01 = _arg1.m01;
this.m02 = _arg1.m02;
this.m10 = _arg1.m10;
this.m11 = _arg1.m11;
this.m12 = _arg1.m12;
this.m20 = _arg1.m20;
this.m21 = _arg1.m21;
this.m22 = _arg1.m22;
}
}
}//package org.libspark.flartoolkit.core.transmat.rotmatrix
Section 108
//FLARRotVector (org.libspark.flartoolkit.core.transmat.rotmatrix.FLARRotVector)
package org.libspark.flartoolkit.core.transmat.rotmatrix {
import org.libspark.flartoolkit.core.param.*;
import org.libspark.flartoolkit.core.*;
import org.libspark.flartoolkit.core.types.*;
import org.libspark.flartoolkit.*;
public class FLARRotVector {
private var _projection_mat_ref:FLARPerspectiveProjectionMatrix;
private var _inv_cpara_array_ref:Array;
public var v1:Number;
public var v2:Number;
public var v3:Number;
public function FLARRotVector(_arg1:FLARPerspectiveProjectionMatrix){
var _local2:FLARMat;
var _local3:Array;
super();
_local2 = new FLARMat(3, 3);
_local3 = _local2.getArray();
_local3[0][0] = _arg1.m00;
_local3[0][1] = _arg1.m01;
_local3[0][2] = _arg1.m02;
_local3[1][0] = _arg1.m10;
_local3[1][1] = _arg1.m11;
_local3[1][2] = _arg1.m12;
_local3[2][0] = _arg1.m20;
_local3[2][1] = _arg1.m21;
_local3[2][2] = _arg1.m22;
_local2.matrixSelfInv();
this._projection_mat_ref = _arg1;
this._inv_cpara_array_ref = _local2.getArray();
}
public function exteriorProductFromLinear(_arg1:FLARLinear, _arg2:FLARLinear):void{
var _local3:FLARPerspectiveProjectionMatrix;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local3 = this._projection_mat_ref;
_local4 = ((_arg1.run * _arg2.rise) - (_arg2.run * _arg1.rise));
_local5 = ((_arg1.rise * _arg2.intercept) - (_arg2.rise * _arg1.intercept));
_local6 = ((_arg1.intercept * _arg2.run) - (_arg2.intercept * _arg1.run));
_local7 = (((_local4 * ((_local3.m01 * _local3.m12) - (_local3.m02 * _local3.m11))) + (_local5 * _local3.m11)) - (_local6 * _local3.m01));
_local8 = (((-(_local4) * _local3.m00) * _local3.m12) + (_local6 * _local3.m00));
_local9 = ((_local4 * _local3.m00) * _local3.m11);
_local10 = Math.sqrt((((_local7 * _local7) + (_local8 * _local8)) + (_local9 * _local9)));
this.v1 = (_local7 / _local10);
this.v2 = (_local8 / _local10);
this.v3 = (_local9 / _local10);
}
public function checkVectorByVertex(_arg1:FLARDoublePoint2d, _arg2:FLARDoublePoint2d):void{
var _local3:Number;
var _local4:Array;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:FLARPerspectiveProjectionMatrix;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
_local4 = this._inv_cpara_array_ref;
_local5 = ((((_local4[0][0] * _arg1.x) * 10) + ((_local4[0][1] * _arg1.y) * 10)) + (_local4[0][2] * 10));
_local6 = ((((_local4[1][0] * _arg1.x) * 10) + ((_local4[1][1] * _arg1.y) * 10)) + (_local4[1][2] * 10));
_local7 = ((((_local4[2][0] * _arg1.x) * 10) + ((_local4[2][1] * _arg1.y) * 10)) + (_local4[2][2] * 10));
_local8 = (_local5 + this.v1);
_local9 = (_local6 + this.v2);
_local10 = (_local7 + this.v3);
_local11 = this._projection_mat_ref;
_local3 = (((_local11.m20 * _local5) + (_local11.m21 * _local6)) + (_local11.m22 * _local7));
if (_local3 == 0){
throw (new FLARException());
};
_local12 = ((((_local11.m00 * _local5) + (_local11.m01 * _local6)) + (_local11.m02 * _local7)) / _local3);
_local13 = ((((_local11.m10 * _local5) + (_local11.m11 * _local6)) + (_local11.m12 * _local7)) / _local3);
_local3 = (((_local11.m20 * _local8) + (_local11.m21 * _local9)) + (_local11.m22 * _local10));
if (_local3 == 0){
throw (new FLARException());
};
_local14 = ((((_local11.m00 * _local8) + (_local11.m01 * _local9)) + (_local11.m02 * _local10)) / _local3);
_local15 = ((((_local11.m10 * _local8) + (_local11.m11 * _local9)) + (_local11.m12 * _local10)) / _local3);
_local16 = (((_arg2.x - _arg1.x) * (_local14 - _local12)) + ((_arg2.y - _arg1.y) * (_local15 - _local13)));
if (_local16 < 0){
this.v1 = -(this.v1);
this.v2 = -(this.v2);
this.v3 = -(this.v3);
};
}
public static function checkRotation(_arg1:FLARRotVector, _arg2:FLARRotVector):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:Number;
_local5 = _arg1.v1;
_local6 = _arg1.v2;
_local7 = _arg1.v3;
_local8 = _arg2.v1;
_local9 = _arg2.v2;
_local10 = _arg2.v3;
_local11 = ((_local6 * _local10) - (_local7 * _local9));
_local12 = ((_local7 * _local8) - (_local5 * _local10));
_local13 = ((_local5 * _local9) - (_local6 * _local8));
_local3 = Math.sqrt((((_local11 * _local11) + (_local12 * _local12)) + (_local13 * _local13)));
if (_local3 == 0){
throw (new FLARException());
};
_local11 = (_local11 / _local3);
_local12 = (_local12 / _local3);
_local13 = (_local13 / _local3);
_local14 = (((_local5 * _local8) + (_local6 * _local9)) + (_local7 * _local10));
if (_local14 < 0){
_local14 = -(_local14);
};
_local15 = ((Math.sqrt((_local14 + 1)) + Math.sqrt((1 - _local14))) * 0.5);
if (((_local12 * _local5) - (_local6 * _local11)) != 0){
_local4 = 0;
} else {
if (((_local13 * _local5) - (_local7 * _local11)) != 0){
_local3 = _local6;
_local6 = _local7;
_local7 = _local3;
_local3 = _local12;
_local12 = _local13;
_local13 = _local3;
_local4 = 1;
} else {
_local3 = _local5;
_local5 = _local7;
_local7 = _local3;
_local3 = _local11;
_local11 = _local13;
_local13 = _local3;
_local4 = 2;
};
};
if (((_local12 * _local5) - (_local6 * _local11)) == 0){
throw (new FLARException());
};
_local16 = (((_local6 * _local13) - (_local12 * _local7)) / ((_local12 * _local5) - (_local6 * _local11)));
_local17 = ((_local12 * _local15) / ((_local12 * _local5) - (_local6 * _local11)));
_local18 = (((_local5 * _local13) - (_local11 * _local7)) / ((_local11 * _local6) - (_local5 * _local12)));
_local19 = ((_local11 * _local15) / ((_local11 * _local6) - (_local5 * _local12)));
_local20 = (((_local16 * _local16) + (_local18 * _local18)) + 1);
_local21 = ((_local16 * _local17) + (_local18 * _local19));
_local22 = (((_local17 * _local17) + (_local19 * _local19)) - 1);
_local23 = ((_local21 * _local21) - (_local20 * _local22));
if (_local23 < 0){
throw (new FLARException());
};
_local26 = ((-(_local21) + Math.sqrt(_local23)) / _local20);
_local24 = ((_local16 * _local26) + _local17);
_local25 = ((_local18 * _local26) + _local19);
_local29 = ((-(_local21) - Math.sqrt(_local23)) / _local20);
_local27 = ((_local16 * _local29) + _local17);
_local28 = ((_local18 * _local29) + _local19);
if (_local4 == 1){
_local3 = _local25;
_local25 = _local26;
_local26 = _local3;
_local3 = _local28;
_local28 = _local29;
_local29 = _local3;
_local3 = _local6;
_local6 = _local7;
_local7 = _local3;
_local3 = _local12;
_local12 = _local13;
_local13 = _local3;
_local4 = 0;
};
if (_local4 == 2){
_local3 = _local24;
_local24 = _local26;
_local26 = _local3;
_local3 = _local27;
_local27 = _local29;
_local29 = _local3;
_local3 = _local5;
_local5 = _local7;
_local7 = _local3;
_local3 = _local11;
_local11 = _local13;
_local13 = _local3;
_local4 = 0;
};
if (((_local12 * _local8) - (_local9 * _local11)) != 0){
_local4 = 0;
} else {
if (((_local13 * _local8) - (_local10 * _local11)) != 0){
_local3 = _local9;
_local9 = _local10;
_local10 = _local3;
_local3 = _local12;
_local12 = _local13;
_local13 = _local3;
_local4 = 1;
} else {
_local3 = _local8;
_local8 = _local10;
_local10 = _local3;
_local3 = _local11;
_local11 = _local13;
_local13 = _local3;
_local4 = 2;
};
};
if (((_local12 * _local8) - (_local9 * _local11)) == 0){
throw (new FLARException());
};
_local16 = (((_local9 * _local13) - (_local12 * _local10)) / ((_local12 * _local8) - (_local9 * _local11)));
_local17 = ((_local12 * _local15) / ((_local12 * _local8) - (_local9 * _local11)));
_local18 = (((_local8 * _local13) - (_local11 * _local10)) / ((_local11 * _local9) - (_local8 * _local12)));
_local19 = ((_local11 * _local15) / ((_local11 * _local9) - (_local8 * _local12)));
_local20 = (((_local16 * _local16) + (_local18 * _local18)) + 1);
_local21 = ((_local16 * _local17) + (_local18 * _local19));
_local22 = (((_local17 * _local17) + (_local19 * _local19)) - 1);
_local23 = ((_local21 * _local21) - (_local20 * _local22));
if (_local23 < 0){
throw (new FLARException());
};
_local32 = ((-(_local21) + Math.sqrt(_local23)) / _local20);
_local30 = ((_local16 * _local32) + _local17);
_local31 = ((_local18 * _local32) + _local19);
_local35 = ((-(_local21) - Math.sqrt(_local23)) / _local20);
_local33 = ((_local16 * _local35) + _local17);
_local34 = ((_local18 * _local35) + _local19);
if (_local4 == 1){
_local3 = _local31;
_local31 = _local32;
_local32 = _local3;
_local3 = _local34;
_local34 = _local35;
_local35 = _local3;
_local3 = _local9;
_local9 = _local10;
_local10 = _local3;
_local3 = _local12;
_local12 = _local13;
_local13 = _local3;
_local4 = 0;
};
if (_local4 == 2){
_local3 = _local30;
_local30 = _local32;
_local32 = _local3;
_local3 = _local33;
_local33 = _local35;
_local35 = _local3;
_local3 = _local8;
_local8 = _local10;
_local10 = _local3;
_local3 = _local11;
_local11 = _local13;
_local13 = _local3;
_local4 = 0;
};
_local36 = (((_local24 * _local30) + (_local25 * _local31)) + (_local26 * _local32));
if (_local36 < 0){
_local36 = -(_local36);
};
_local37 = (((_local24 * _local33) + (_local25 * _local34)) + (_local26 * _local35));
if (_local37 < 0){
_local37 = -(_local37);
};
_local38 = (((_local27 * _local30) + (_local28 * _local31)) + (_local29 * _local32));
if (_local38 < 0){
_local38 = -(_local38);
};
_local39 = (((_local27 * _local33) + (_local28 * _local34)) + (_local29 * _local35));
if (_local39 < 0){
_local39 = -(_local39);
};
if (_local36 < _local37){
if (_local36 < _local38){
if (_local36 < _local39){
_arg1.v1 = _local24;
_arg1.v2 = _local25;
_arg1.v3 = _local26;
_arg2.v1 = _local30;
_arg2.v2 = _local31;
_arg2.v3 = _local32;
} else {
_arg1.v1 = _local27;
_arg1.v2 = _local28;
_arg1.v3 = _local29;
_arg2.v1 = _local33;
_arg2.v2 = _local34;
_arg2.v3 = _local35;
};
} else {
if (_local38 < _local39){
_arg1.v1 = _local27;
_arg1.v2 = _local28;
_arg1.v3 = _local29;
_arg2.v1 = _local30;
_arg2.v2 = _local31;
_arg2.v3 = _local32;
} else {
_arg1.v1 = _local27;
_arg1.v2 = _local28;
_arg1.v3 = _local29;
_arg2.v1 = _local33;
_arg2.v2 = _local34;
_arg2.v3 = _local35;
};
};
} else {
if (_local37 < _local38){
if (_local37 < _local39){
_arg1.v1 = _local24;
_arg1.v2 = _local25;
_arg1.v3 = _local26;
_arg2.v1 = _local33;
_arg2.v2 = _local34;
_arg2.v3 = _local35;
} else {
_arg1.v1 = _local27;
_arg1.v2 = _local28;
_arg1.v3 = _local29;
_arg2.v1 = _local33;
_arg2.v2 = _local34;
_arg2.v3 = _local35;
};
} else {
if (_local38 < _local39){
_arg1.v1 = _local27;
_arg1.v2 = _local28;
_arg1.v3 = _local29;
_arg2.v1 = _local30;
_arg2.v2 = _local31;
_arg2.v3 = _local32;
} else {
_arg1.v1 = _local27;
_arg1.v2 = _local28;
_arg1.v3 = _local29;
_arg2.v1 = _local33;
_arg2.v2 = _local34;
_arg2.v3 = _local35;
};
};
};
}
}
}//package org.libspark.flartoolkit.core.transmat.rotmatrix
Section 109
//FLARTransMat (org.libspark.flartoolkit.core.transmat.FLARTransMat)
package org.libspark.flartoolkit.core.transmat {
import org.libspark.flartoolkit.core.param.*;
import org.libspark.flartoolkit.core.*;
import org.libspark.flartoolkit.core.types.*;
import org.libspark.flartoolkit.core.transmat.rotmatrix.*;
import org.libspark.flartoolkit.core.transmat.fitveccalc.*;
import org.libspark.flartoolkit.core.transmat.optimize.*;
public class FLARTransMat implements IFLARTransMat {
private const __transMat_linear_ref:Array;
private const __transMat_trans:FLARDoublePoint3d;
private const _offset:FLARTransOffset;
private const _center:FLARDoublePoint2d;
private const __transMat_sqvertex_ref:Array;
private var _rotmatrix:FLARRotMatrix;
private var _calculator:FLARFitVecCalculator;
private var _mat_optimize:FLARRotTransOptimize;
private static const AR_GET_TRANS_CONT_MAT_MAX_FIT_ERROR:Number = 1;
public function FLARTransMat(_arg1:FLARParam){
var _local2:FLARCameraDistortionFactor;
var _local3:FLARPerspectiveProjectionMatrix;
_center = new FLARDoublePoint2d(0, 0);
_offset = new FLARTransOffset();
__transMat_sqvertex_ref = new Array(4);
__transMat_linear_ref = new Array(4);
__transMat_trans = new FLARDoublePoint3d();
super();
_local2 = _arg1.getDistortionFactor();
_local3 = _arg1.getPerspectiveProjectionMatrix();
this._calculator = new FLARFitVecCalculator(_local3, _local2);
this._rotmatrix = new FLARRotMatrix(_local3);
this._mat_optimize = new FLARRotTransOptimize(_local3);
}
public function setCenter(_arg1:Number, _arg2:Number):void{
this._center.x = _arg1;
this._center.y = _arg2;
}
private function initVertexOrder(_arg1:FLARSquare, _arg2:int, _arg3:Array, _arg4:Array):void{
_arg3[0] = _arg1.sqvertex[((4 - _arg2) % 4)];
_arg3[1] = _arg1.sqvertex[((5 - _arg2) % 4)];
_arg3[2] = _arg1.sqvertex[((6 - _arg2) % 4)];
_arg3[3] = _arg1.sqvertex[((7 - _arg2) % 4)];
_arg4[0] = _arg1.line[((4 - _arg2) % 4)];
_arg4[1] = _arg1.line[((5 - _arg2) % 4)];
_arg4[2] = _arg1.line[((6 - _arg2) % 4)];
_arg4[3] = _arg1.line[((7 - _arg2) % 4)];
}
public function transMat(_arg1:FLARSquare, _arg2:int, _arg3:Number, _arg4:FLARTransMatResult):void{
var _local5:Array;
var _local6:Array;
var _local7:FLARDoublePoint3d;
_local5 = __transMat_sqvertex_ref;
_local6 = __transMat_linear_ref;
_local7 = this.__transMat_trans;
initVertexOrder(_arg1, _arg2, _local5, _local6);
this._offset.setSquare(_arg3, this._center);
this._rotmatrix.initRotBySquare(_local6, _local5);
this._calculator.setOffsetSquare(this._offset);
this._calculator.setFittedSquare(_local5);
this._calculator.calculateTransfer(this._rotmatrix, _local7);
this._mat_optimize.optimize(this._rotmatrix, _local7, this._calculator);
_arg4.updateMatrixValue(this._rotmatrix, this._offset.point, _local7);
}
public function transMatContinue(_arg1:FLARSquare, _arg2:int, _arg3:Number, _arg4:FLARTransMatResult):void{
var _local5:Array;
var _local6:Array;
var _local7:FLARDoublePoint3d;
var _local8:Number;
var _local9:Number;
_local5 = __transMat_sqvertex_ref;
_local6 = __transMat_linear_ref;
_local7 = this.__transMat_trans;
if (!_arg4.hasValue()){
this.transMat(_arg1, _arg2, _arg3, _arg4);
return;
};
initVertexOrder(_arg1, _arg2, _local5, _local6);
this._offset.setSquare(_arg3, this._center);
this._rotmatrix.initRotByPrevResult(_arg4);
this._calculator.setOffsetSquare(this._offset);
this._calculator.setFittedSquare(_local5);
this._calculator.calculateTransfer(this._rotmatrix, _local7);
_local8 = this._mat_optimize.optimize(this._rotmatrix, _local7, this._calculator);
_arg4.updateMatrixValue(this._rotmatrix, this._offset.point, _local7);
if (_local8 > AR_GET_TRANS_CONT_MAT_MAX_FIT_ERROR){
this._rotmatrix.initRotBySquare(_local6, _local5);
this._calculator.calculateTransfer(this._rotmatrix, _local7);
_local9 = this._mat_optimize.optimize(this._rotmatrix, _local7, this._calculator);
if (_local9 < _local8){
_arg4.updateMatrixValue(this._rotmatrix, this._offset.point, _local7);
};
};
}
}
}//package org.libspark.flartoolkit.core.transmat
Section 110
//FLARTransMatResult (org.libspark.flartoolkit.core.transmat.FLARTransMatResult)
package org.libspark.flartoolkit.core.transmat {
import org.libspark.flartoolkit.core.types.*;
import org.libspark.flartoolkit.core.transmat.rotmatrix.*;
import org.libspark.flartoolkit.core.types.matrix.*;
public class FLARTransMatResult extends FLARDoubleMatrix34 {
private var has_value:Boolean;// = false
public function FLARTransMatResult(){
has_value = false;
super();
}
public function hasValue():Boolean{
return (this.has_value);
}
public function updateMatrixValue(_arg1:FLARRotMatrix, _arg2:FLARDoublePoint3d, _arg3:FLARDoublePoint3d):void{
this.m00 = _arg1.m00;
this.m01 = _arg1.m01;
this.m02 = _arg1.m02;
this.m03 = ((((_arg1.m00 * _arg2.x) + (_arg1.m01 * _arg2.y)) + (_arg1.m02 * _arg2.z)) + _arg3.x);
this.m10 = _arg1.m10;
this.m11 = _arg1.m11;
this.m12 = _arg1.m12;
this.m13 = ((((_arg1.m10 * _arg2.x) + (_arg1.m11 * _arg2.y)) + (_arg1.m12 * _arg2.z)) + _arg3.y);
this.m20 = _arg1.m20;
this.m21 = _arg1.m21;
this.m22 = _arg1.m22;
this.m23 = ((((_arg1.m20 * _arg2.x) + (_arg1.m21 * _arg2.y)) + (_arg1.m22 * _arg2.z)) + _arg3.z);
this.has_value = true;
}
}
}//package org.libspark.flartoolkit.core.transmat
Section 111
//FLARTransOffset (org.libspark.flartoolkit.core.transmat.FLARTransOffset)
package org.libspark.flartoolkit.core.transmat {
import org.libspark.flartoolkit.core.types.*;
public final class FLARTransOffset {
public var point:FLARDoublePoint3d;
public var vertex:Array;
public function FLARTransOffset(){
vertex = FLARDoublePoint3d.createArray(4);
point = new FLARDoublePoint3d();
super();
}
public function setSquare(_arg1:Number, _arg2:FLARDoublePoint2d):void{
var _local3:Number;
var _local4:FLARDoublePoint3d;
_local3 = (_arg1 / 2);
_local4 = this.vertex[0];
_local4.x = -(_local3);
_local4.y = _local3;
_local4.z = 0;
_local4 = this.vertex[1];
_local4.x = _local3;
_local4.y = _local3;
_local4.z = 0;
_local4 = this.vertex[2];
_local4.x = _local3;
_local4.y = -(_local3);
_local4.z = 0;
_local4 = this.vertex[3];
_local4.x = -(_local3);
_local4.y = -(_local3);
_local4.z = 0;
this.point.x = -(_arg2.x);
this.point.y = -(_arg2.y);
this.point.z = 0;
}
}
}//package org.libspark.flartoolkit.core.transmat
Section 112
//IFLARTransMat (org.libspark.flartoolkit.core.transmat.IFLARTransMat)
package org.libspark.flartoolkit.core.transmat {
import org.libspark.flartoolkit.core.*;
public interface IFLARTransMat {
function setCenter(_arg1:Number, _arg2:Number):void;
function transMat(_arg1:FLARSquare, _arg2:int, _arg3:Number, _arg4:FLARTransMatResult):void;
function transMatContinue(_arg1:FLARSquare, _arg2:int, _arg3:Number, _arg4:FLARTransMatResult):void;
}
}//package org.libspark.flartoolkit.core.transmat
Section 113
//FLARDoubleMatrix33 (org.libspark.flartoolkit.core.types.matrix.FLARDoubleMatrix33)
package org.libspark.flartoolkit.core.types.matrix {
public class FLARDoubleMatrix33 implements IFLARDoubleMatrix {
public var m10:Number;
public var m11:Number;
public var m12:Number;
public var m20:Number;
public var m21:Number;
public var m22:Number;
public var m01:Number;
public var m00:Number;
public var m02:Number;
public function getValue(_arg1:Array):void{
_arg1[0] = this.m00;
_arg1[1] = this.m01;
_arg1[2] = this.m02;
_arg1[3] = this.m10;
_arg1[4] = this.m11;
_arg1[5] = this.m12;
_arg1[6] = this.m20;
_arg1[7] = this.m21;
_arg1[8] = this.m22;
}
public function setValue(_arg1:Array):void{
this.m00 = _arg1[0];
this.m01 = _arg1[1];
this.m02 = _arg1[2];
this.m10 = _arg1[3];
this.m11 = _arg1[4];
this.m12 = _arg1[5];
this.m20 = _arg1[6];
this.m21 = _arg1[7];
this.m22 = _arg1[8];
}
}
}//package org.libspark.flartoolkit.core.types.matrix
Section 114
//FLARDoubleMatrix34 (org.libspark.flartoolkit.core.types.matrix.FLARDoubleMatrix34)
package org.libspark.flartoolkit.core.types.matrix {
import flash.utils.*;
public class FLARDoubleMatrix34 implements IFLARDoubleMatrix {
public var m10:Number;
public var m11:Number;
public var m12:Number;
public var m13:Number;
public var m20:Number;
public var m21:Number;
public var m22:Number;
public var m01:Number;
public var m02:Number;
public var m03:Number;
public var m00:Number;
public var m23:Number;
public function toString():String{
return (((((((((((((((((((((((((((((("[" + getQualifiedClassName(this)) + "\n") + "\t") + (int((this.m00 * 1000)) / 1000)) + ",\t") + (int((this.m01 * 1000)) / 1000)) + ",\t") + (int((this.m02 * 1000)) / 1000)) + ",\t") + (int((this.m03 * 1000)) / 1000)) + ",\n") + "\t") + (int((this.m10 * 1000)) / 1000)) + ",\t") + (int((this.m11 * 1000)) / 1000)) + ",\t") + (int((this.m12 * 1000)) / 1000)) + ",\t") + (int((this.m13 * 1000)) / 1000)) + ",\n") + "\t") + (int((this.m20 * 1000)) / 1000)) + ",\t") + (int((this.m21 * 1000)) / 1000)) + ",\t") + (int((this.m22 * 1000)) / 1000)) + ",\t") + (int((this.m23 * 1000)) / 1000)) + "\n]"));
}
public function setValue(_arg1:Array):void{
this.m00 = _arg1[0];
this.m01 = _arg1[1];
this.m02 = _arg1[2];
this.m03 = _arg1[3];
this.m10 = _arg1[4];
this.m11 = _arg1[5];
this.m12 = _arg1[6];
this.m13 = _arg1[7];
this.m20 = _arg1[8];
this.m21 = _arg1[9];
this.m22 = _arg1[10];
this.m23 = _arg1[11];
}
public function getValue(_arg1:Array):void{
_arg1[0] = this.m00;
_arg1[1] = this.m01;
_arg1[2] = this.m02;
_arg1[3] = this.m03;
_arg1[4] = this.m10;
_arg1[5] = this.m11;
_arg1[6] = this.m12;
_arg1[7] = this.m13;
_arg1[8] = this.m20;
_arg1[9] = this.m21;
_arg1[10] = this.m22;
_arg1[11] = this.m23;
}
}
}//package org.libspark.flartoolkit.core.types.matrix
Section 115
//IFLARDoubleMatrix (org.libspark.flartoolkit.core.types.matrix.IFLARDoubleMatrix)
package org.libspark.flartoolkit.core.types.matrix {
public interface IFLARDoubleMatrix {
function getValue(_arg1:Array):void;
function setValue(_arg1:Array):void;
}
}//package org.libspark.flartoolkit.core.types.matrix
Section 116
//FLARDoublePoint2d (org.libspark.flartoolkit.core.types.FLARDoublePoint2d)
package org.libspark.flartoolkit.core.types {
public class FLARDoublePoint2d {
public var x:Number;
public var y:Number;
public function FLARDoublePoint2d(_arg1:Number=0, _arg2:Number=0){
this.x = _arg1;
this.y = _arg2;
}
public static function createArray(_arg1:int):Array{
var _local2:Array;
var _local3:int;
_local2 = new Array(_arg1);
_local3 = 0;
while (_local3 < _arg1) {
_local2[_local3] = new (FLARDoublePoint2d);
_local3++;
};
return (_local2);
}
}
}//package org.libspark.flartoolkit.core.types
Section 117
//FLARDoublePoint3d (org.libspark.flartoolkit.core.types.FLARDoublePoint3d)
package org.libspark.flartoolkit.core.types {
public class FLARDoublePoint3d {
public var x:Number;
public var y:Number;
public var z:Number;
public static function createArray(_arg1:int):Array{
var _local2:Array;
var _local3:int;
_local2 = new Array(_arg1);
_local3 = 0;
while (_local3 < _arg1) {
_local2[_local3] = new (FLARDoublePoint3d);
_local3++;
};
return (_local2);
}
}
}//package org.libspark.flartoolkit.core.types
Section 118
//FLARIntPoint (org.libspark.flartoolkit.core.types.FLARIntPoint)
package org.libspark.flartoolkit.core.types {
public class FLARIntPoint {
public var x:int;
public var y:int;
public function toString():String{
return ((((("(" + this.x) + " , ") + this.y) + ")"));
}
}
}//package org.libspark.flartoolkit.core.types
Section 119
//FLARIntSize (org.libspark.flartoolkit.core.types.FLARIntSize)
package org.libspark.flartoolkit.core.types {
public class FLARIntSize {
public var w:int;
public var h:int;
public function FLARIntSize(_arg1:int=0, _arg2:int=0){
this.w = _arg1;
this.h = _arg2;
}
public function isEqualSizeO(_arg1:FLARIntSize):Boolean{
if ((((_arg1.w == this.w)) && ((_arg1.h == this.h)))){
return (true);
};
return (false);
}
public function isEqualSizeII(_arg1:int, _arg2:int):Boolean{
if ((((_arg1 == this.w)) && ((_arg2 == this.h)))){
return (true);
};
return (false);
}
public function toString():String{
return ((((("(width=" + w) + " , height=") + h) + ")"));
}
}
}//package org.libspark.flartoolkit.core.types
Section 120
//FLARLinear (org.libspark.flartoolkit.core.types.FLARLinear)
package org.libspark.flartoolkit.core.types {
public class FLARLinear {
public var rise:Number;
public var intercept:Number;
public var run:Number;
}
}//package org.libspark.flartoolkit.core.types
Section 121
//FLARCode (org.libspark.flartoolkit.core.FLARCode)
package org.libspark.flartoolkit.core {
import org.libspark.flartoolkit.core.pickup.*;
import org.libspark.flartoolkit.utils.*;
import org.libspark.flartoolkit.*;
public class FLARCode {
private var width:int;
private var patpow:Array;
private var averagePat:int;
private var pat:Array;
private var height:int;
private var patpowBW:Array;
private var _markerPercentHeight:uint;
private var patBW:Array;
private var _markerPercentWidth:uint;
public function FLARCode(_arg1:int, _arg2:int, _arg3:uint=50, _arg4:uint=50){
patpow = new Array(4);
patpowBW = new Array(4);
super();
width = _arg1;
height = _arg2;
if ((((_arg3 > 100)) || ((_arg4 > 100)))){
throw (new ArgumentError((((("illegal marker size[" + _arg3) + " x ") + _arg4) + "]")));
};
this._markerPercentWidth = _arg3;
this._markerPercentHeight = _arg4;
pat = ArrayUtil.createJaggedArray(4, height, width, 3);
patBW = ArrayUtil.createJaggedArray(4, height, width);
}
public function getPatPowBW():Array{
return (patpowBW);
}
public function getPatBW():Array{
return (patBW);
}
public function getWidth():int{
return (width);
}
public function get markerPercentWidth():uint{
return (_markerPercentWidth);
}
public function get averageOfPattern():int{
return (this.averagePat);
}
public function getHeight():int{
return (height);
}
public function set markerPercentHeight(_arg1:uint):void{
_markerPercentHeight = _arg1;
}
public function loadARPatt(_arg1:String):void{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
_local2 = _arg1.match(/\d+/g);
_local4 = 0;
_local3 = 0;
while (_local3 < 4) {
_local5 = 0;
while (_local5 < 3) {
_local6 = 0;
while (_local6 < height) {
_local7 = 0;
while (_local7 < width) {
_local8 = parseInt(_local2.shift());
if (isNaN(_local8)){
throw (new FLARException("syntax error in pattern file."));
};
_local9 = (0xFF - _local8);
switch (_local5){
case 0:
pat[_local3][_local6][_local7][2] = _local9;
break;
case 1:
pat[_local3][_local6][_local7][1] = _local9;
break;
case 2:
pat[_local3][_local6][_local7][0] = _local9;
break;
};
if (_local5 == 0){
patBW[_local3][_local6][_local7] = _local9;
} else {
patBW[_local3][_local6][_local7] = (patBW[_local3][_local6][_local7] + _local9);
};
if (_local5 == 2){
patBW[_local3][_local6][_local7] = (patBW[_local3][_local6][_local7] / 3);
};
_local4 = (_local4 + _local9);
_local7++;
};
_local6++;
};
_local5++;
};
_local4 = (_local4 / ((height * width) * 3));
this.averagePat = _local4;
_local10 = 0;
_local11 = 0;
while (_local11 < height) {
_local6 = 0;
while (_local6 < width) {
_local5 = 0;
while (_local5 < 3) {
pat[_local3][_local11][_local6][_local5] = (pat[_local3][_local11][_local6][_local5] - _local4);
_local10 = (_local10 + (pat[_local3][_local11][_local6][_local5] * pat[_local3][_local11][_local6][_local5]));
_local5++;
};
_local6++;
};
_local11++;
};
patpow[_local3] = Math.sqrt(_local10);
if (patpow[_local3] == 0){
patpow[_local3] = 1E-7;
};
_local10 = 0;
_local11 = 0;
while (_local11 < height) {
_local6 = 0;
while (_local6 < width) {
patBW[_local3][_local11][_local6] = (patBW[_local3][_local11][_local6] - _local4);
_local10 = (_local10 + (patBW[_local3][_local11][_local6] * patBW[_local3][_local11][_local6]));
_local6++;
};
_local11++;
};
patpowBW[_local3] = Math.sqrt(_local10);
if (patpowBW[_local3] == 0){
patpowBW[_local3] = 1E-7;
};
_local3++;
};
}
public function getPatPow():Array{
return (patpow);
}
public function toString():String{
return (this.generatePatFileString(this.pat));
}
public function getPat():Array{
return (pat);
}
public function get markerPercentHeight():uint{
return (_markerPercentHeight);
}
private function generatePatFileString(_arg1:Array):String{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:String;
var _local7:int;
var _local8:int;
_local6 = "";
_local7 = this.getWidth();
_local8 = this.getHeight();
_local5 = 0;
while (_local5 < _arg1.length) {
_local4 = 2;
while (_local4 >= 0) {
_local3 = 0;
while (_local3 < _local8) {
_local2 = 0;
while (_local2 < _local7) {
_local6 = (_local6 + String((" " + int((((0xFF - _arg1[_local5][_local3][_local2][_local4]) - this.averagePat) & 0xFF)))).substr(-4));
_local2++;
};
_local6 = (_local6 + "\n");
_local3++;
};
_local4--;
};
_local6 = (_local6 + "\n");
_local5++;
};
return (_local6);
}
public function fromPattern(_arg1:IFLARColorPatt):void{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
_local2 = _arg1.getPatArray();
_local3 = 0;
_local4 = 0;
_local5 = 0;
if (((!((this.height == _local2.length))) || (!((this.width == _local2[0].length))))){
trace(this.height, _local2.length, this.width, _local2[0].length);
throw (new ArgumentError("パターンの幅・高さが、Codeの幅・高さと異なっています"));
};
if (this.height != this.width){
throw (new ArgumentError("正方形のインスタンスのみ有効です。"));
};
_local6 = 0;
while (_local6 < this.height) {
_local7 = 0;
while (_local7 < this.width) {
patBW[0][((this.height - 1) - _local6)][((this.width - 1) - _local7)] = 0;
patBW[1][_local7][((this.width - 1) - _local6)] = 0;
patBW[2][_local6][_local7] = 0;
patBW[3][((this.height - 1) - _local7)][_local6] = 0;
_local8 = 0;
while (_local8 < 3) {
_local9 = (0xFF - int(_local2[_local6][_local7][_local8]));
pat[0][((this.height - 1) - _local6)][((this.width - 1) - _local7)][_local8] = _local9;
pat[1][_local7][((this.width - 1) - _local6)][_local8] = _local9;
pat[2][_local6][_local7][_local8] = _local9;
pat[3][((this.height - 1) - _local7)][_local6][_local8] = _local9;
patBW[0][((this.height - 1) - _local6)][((this.width - 1) - _local7)] = (patBW[0][((this.height - 1) - _local6)][((this.width - 1) - _local7)] + _local9);
patBW[1][_local7][((this.width - 1) - _local6)] = (patBW[1][_local7][((this.width - 1) - _local6)] + _local9);
patBW[2][_local6][_local7] = (patBW[2][_local6][_local7] + _local9);
patBW[3][((this.height - 1) - _local7)][_local6] = (patBW[3][((this.height - 1) - _local7)][_local6] + _local9);
_local3 = (_local3 + _local9);
_local8++;
};
patBW[0][((this.height - 1) - _local6)][((this.width - 1) - _local7)] = (patBW[0][((this.height - 1) - _local6)][((this.width - 1) - _local7)] / 3);
patBW[1][_local7][((this.width - 1) - _local6)] = (patBW[1][_local7][((this.width - 1) - _local6)] / 3);
patBW[2][_local6][_local7] = (patBW[2][_local6][_local7] / 3);
patBW[3][((this.height - 1) - _local7)][_local6] = (patBW[3][((this.height - 1) - _local7)][_local6] / 3);
_local7++;
};
_local6++;
};
_local3 = (_local3 / ((this.width * this.height) * 3));
this.averagePat = _local3;
_local6 = 0;
while (_local6 < this.height) {
_local7 = 0;
while (_local7 < this.width) {
patBW[0][((this.height - 1) - _local6)][((this.width - 1) - _local7)] = (patBW[0][((this.height - 1) - _local6)][((this.width - 1) - _local7)] - _local3);
patBW[1][_local7][((this.width - 1) - _local6)] = (patBW[1][_local7][((this.width - 1) - _local6)] - _local3);
patBW[2][_local6][_local7] = (patBW[2][_local6][_local7] - _local3);
patBW[3][((this.height - 1) - _local7)][_local6] = (patBW[3][((this.height - 1) - _local7)][_local6] - _local3);
_local5 = (_local5 + (patBW[2][_local6][_local7] * patBW[2][_local6][_local7]));
_local8 = 0;
while (_local8 < 3) {
pat[0][((this.height - 1) - _local6)][((this.width - 1) - _local7)][_local8] = (pat[0][((this.height - 1) - _local6)][((this.width - 1) - _local7)][_local8] - _local3);
pat[1][_local7][((this.width - 1) - _local6)][_local8] = (pat[1][_local7][((this.width - 1) - _local6)][_local8] - _local3);
pat[2][_local6][_local7][_local8] = (pat[2][_local6][_local7][_local8] - _local3);
pat[3][((this.height - 1) - _local7)][_local6][_local8] = (pat[3][((this.height - 1) - _local7)][_local6][_local8] - _local3);
_local4 = (_local4 + (pat[2][_local6][_local7][_local8] * pat[2][_local6][_local7][_local8]));
_local8++;
};
_local7++;
};
_local6++;
};
patpow[0] = (patpow[1] = (patpow[2] = (patpow[3] = ((_local4 == 0)) ? 1E-7 : Math.sqrt(_local4))));
patpowBW[0] = (patpowBW[1] = (patpowBW[2] = (patpowBW[3] = ((_local5 == 0)) ? 1E-7 : Math.sqrt(_local5))));
}
}
}//package org.libspark.flartoolkit.core
Section 122
//FLARMat (org.libspark.flartoolkit.core.FLARMat)
package org.libspark.flartoolkit.core {
import org.libspark.flartoolkit.utils.*;
import org.libspark.flartoolkit.*;
public class FLARMat {
private const wk_PCA_QRM_ev:FLARVec;
private const wk_vecTridiagonalize_vec:FLARVec;
private const wk_vecTridiagonalize_vec2:FLARVec;
private var row:int;
private var clm:int;
private var wk_PCA_PCA_u:FLARMat;// = null
private var wk_work_matrixPCA:FLARMat;// = null
private var wk_nos_matrixSelfInv:Array;
protected var m:Array;
private static const PCA_MAX_ITER:int = 100;
private static const PCA_VZERO:Number = 1E-16;
private static const PCA_EPS:Number = 1E-6;
public function FLARMat(_arg1:int, _arg2:int){
wk_nos_matrixSelfInv = new Array(50);
wk_PCA_QRM_ev = new FLARVec(1);
wk_PCA_PCA_u = null;
wk_work_matrixPCA = null;
wk_vecTridiagonalize_vec = new FLARVec(0);
wk_vecTridiagonalize_vec2 = new FLARVec(0);
super();
m = ArrayUtil.createJaggedArray(_arg1, _arg2);
clm = _arg2;
row = _arg1;
}
public function matrixMul(_arg1:FLARMat, _arg2:FLARMat):void{
var _local3:Number;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:Array;
var _local8:Array;
var _local9:Array;
if (((((!((_arg1.clm == _arg2.row))) || (!((this.row == _arg1.row))))) || (!((this.clm == _arg2.clm))))){
throw (new FLARException());
};
_local7 = _arg1.m;
_local8 = _arg2.m;
_local9 = this.m;
_local4 = 0;
while (_local4 < this.row) {
_local5 = 0;
while (_local5 < this.clm) {
_local3 = 0;
_local6 = 0;
while (_local6 < _arg1.clm) {
_local3 = (_local3 + (_local7[_local4][_local6] * _local8[_local6][_local5]));
_local6++;
};
_local9[_local4][_local5] = _local3;
_local5++;
};
_local4++;
};
}
public function matrixSelfInv():Boolean{
var _local1:Array;
var _local2:int;
var _local3:int;
var _local4:Array;
var _local5:Array;
var _local6:Array;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:Array;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:int;
var _local15:int;
_local1 = this.m;
_local2 = this.row;
_local3 = (_local2 - 1);
_local10 = wk_nos_matrixSelfInv;
switch (_local2){
case 0:
throw (new FLARException());
case 1:
_local1[0][0] = (1 / _local1[0][0]);
return (true);
};
_local14 = 0;
while (_local14 < _local2) {
_local10[_local14] = _local14;
_local14++;
};
_local8 = 0;
_local14 = 0;
while (_local14 < _local2) {
_local4 = _local1[_local14];
_local11 = 0;
_local15 = _local14;
while (_local15 < _local2) {
_local12 = Math.abs(_local1[_local15][0]);
if (_local11 < _local12){
_local11 = _local12;
_local8 = _local15;
};
_local15++;
};
if (_local11 == 0){
return (false);
};
_local9 = _local10[_local8];
_local10[_local8] = _local10[_local14];
_local10[_local14] = _local9;
_local5 = _local1[_local8];
_local7 = 0;
while (_local7 < _local2) {
_local13 = _local5[_local7];
_local5[_local7] = _local4[_local7];
_local4[_local7] = _local13;
_local7++;
};
_local13 = _local4[0];
_local7 = 0;
while (_local7 < _local3) {
_local4[_local7] = (_local4[(_local7 + 1)] / _local13);
_local7++;
};
_local4[_local7] = (1 / _local13);
_local15 = 0;
while (_local15 < _local2) {
if (_local15 != _local14){
_local6 = _local1[_local15];
_local13 = _local6[0];
_local7 = 0;
while (_local7 < _local3) {
_local6[_local7] = (_local6[(_local7 + 1)] - (_local13 * _local4[_local7]));
_local7++;
};
_local6[_local7] = (-(_local13) * _local4[_local7]);
};
_local15++;
};
_local14++;
};
_local14 = 0;
while (_local14 < _local2) {
_local7 = _local14;
while (_local7 < _local2) {
if (_local10[_local7] == _local14){
break;
};
_local7++;
};
_local10[_local7] = _local10[_local14];
_local15 = 0;
while (_local15 < _local2) {
_local6 = _local1[_local15];
_local13 = _local6[_local7];
_local6[_local7] = _local6[_local14];
_local6[_local14] = _local13;
_local15++;
};
_local14++;
};
return (true);
}
public function zeroClear():void{
var _local1:int;
var _local2:int;
_local1 = (row - 1);
while (_local1 >= 0) {
_local2 = (clm - 1);
while (_local2 >= 0) {
m[_local1][_local2] = 0;
_local2--;
};
_local1--;
};
}
public function matrixDisp():int{
FLARException.trap("未チェックのパス");
return (0);
}
public function matrixPCA(_arg1:FLARMat, _arg2:FLARVec, _arg3:FLARVec):void{
var _local4:Number;
var _local5:Number;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:FLARMat;
var _local10:int;
var _local11:int;
var _local12:Array;
var _local13:int;
_local6 = this.row;
_local7 = this.clm;
_local8 = ((_local6)<_local7) ? _local6 : _local7;
if ((((_local6 < 2)) || ((_local7 < 2)))){
throw (new FLARException());
};
if (((!((_arg1.clm == _local7))) || (!((_arg1.row == _local8))))){
throw (new FLARException());
};
if (_arg2.getClm() != _local8){
throw (new FLARException());
};
if (_arg3.getClm() != _local7){
throw (new FLARException());
};
if (this.wk_work_matrixPCA == null){
_local9 = this.matrixAllocDup();
this.wk_work_matrixPCA = _local9;
} else {
_local9 = this.wk_work_matrixPCA;
_local9.matrixDup(this);
};
_local4 = Math.sqrt(_local6);
_local9.PCA_EX(_arg3);
PCA_CENTER(_local9, _arg3);
_local10 = 0;
while (_local10 < _local6) {
_local11 = 0;
while (_local11 < _local7) {
_local9.m[_local10][_local11] = (_local9.m[_local10][_local11] / _local4);
_local11++;
};
_local10++;
};
_local9.PCA_PCA(_arg1, _arg2);
_local5 = 0;
_local12 = _arg2.getArray();
_local13 = _arg2.getClm();
_local10 = 0;
while (_local10 < _local13) {
_local5 = (_local5 + _local12[_local10]);
_local10++;
};
_local10 = 0;
while (_local10 < _local13) {
_local12[_local10] = (_local12[_local10] / _local5);
_local10++;
};
}
public function matrixAllocInv():FLARMat{
var _local1:FLARMat;
FLARException.trap("未チェックのパス");
_local1 = matrixAllocDup();
FLARException.trap("未チェックのパス");
_local1.matrixSelfInv();
return (_local1);
}
public function realloc(_arg1:int, _arg2:int):void{
if ((((_arg1 <= this.m.length)) && ((_arg2 <= this.m[0].length)))){
} else {
m = ArrayUtil.createJaggedArray(_arg1, _arg2);
};
this.clm = _arg2;
this.row = _arg1;
}
public function getArray():Array{
return (m);
}
private function PCA_EX(_arg1:FLARVec):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Array;
var _local7:Array;
var _local8:Number;
_local2 = this.row;
_local3 = this.clm;
_local6 = this.m;
if ((((_local2 <= 0)) || ((_local3 <= 0)))){
throw (new FLARException());
};
if (_arg1.getClm() != _local3){
throw (new FLARException());
};
_local7 = _arg1.getArray();
_local5 = 0;
while (_local5 < _local3) {
_local8 = 0;
_local4 = 0;
while (_local4 < _local2) {
_local8 = (_local8 + _local6[_local4][_local5]);
_local4++;
};
_local7[_local5] = (_local8 / _local2);
_local5++;
};
}
public function getClm():int{
return (clm);
}
private function vecTridiagonalize(_arg1:FLARVec, _arg2:FLARVec, _arg3:int):void{
var _local4:FLARVec;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:int;
var _local10:Array;
var _local11:Array;
var _local12:Array;
var _local13:int;
var _local14:int;
var _local15:int;
var _local16:FLARVec;
_local4 = wk_vecTridiagonalize_vec;
if (this.clm != this.row){
throw (new FLARException());
};
if (this.clm != _arg1.getClm()){
throw (new FLARException());
};
if (this.clm != _arg2.getClm()){
throw (new FLARException());
};
_local9 = this.getClm();
_local10 = _arg1.getArray();
_local11 = _arg2.getArray();
_local13 = 0;
while (_local13 < (_local9 - 2)) {
_local12 = this.m[_local13];
_local4.setNewArray(_local12, clm);
FLARException.trap("未チェックパス");
_local10[_local13] = _local12[_local13];
FLARException.trap("未チェックパス");
_local11[(_local13 + _arg3)] = _local4.vecHousehold((_local13 + 1));
if (_local11[(_local13 + _arg3)] == 0){
} else {
_local14 = (_local13 + 1);
while (_local14 < _local9) {
_local5 = 0;
_local15 = (_local13 + 1);
while (_local15 < _local14) {
FLARException.trap("未チェックのパス");
_local5 = (_local5 + (this.m[_local15][_local14] * _local12[_local15]));
_local15++;
};
_local15 = _local14;
while (_local15 < _local9) {
FLARException.trap("未チェックのパス");
_local5 = (_local5 + (this.m[_local14][_local15] * _local12[_local15]));
_local15++;
};
FLARException.trap("未チェックのパス");
_local10[_local14] = _local5;
_local14++;
};
_local12 = this.m[_local13];
_local4.setNewArray(_local12, clm);
FLARException.trap("未チェックパス");
_local6 = (_local4.vecInnerproduct(_arg1, (_local13 + 1)) / 2);
_local14 = (_local9 - 1);
while (_local14 > _local13) {
FLARException.trap("未チェックパス");
_local7 = _local12[_local14];
_local10[_local14] = (_local10[_local14] - (_local6 * _local7));
_local8 = _local10[_local14];
_local15 = _local14;
while (_local15 < _local9) {
FLARException.trap("未チェックパス");
this.m[_local14][_local15] = (this.m[_local14][_local15] - (_local7 * (_local10[_local15] + (_local8 * _local12[_local15]))));
_local15++;
};
_local14--;
};
};
_local13++;
};
if (_local9 >= 2){
_local10[(_local9 - 2)] = this.m[(_local9 - 2)][(_local9 - 2)];
_local11[((_local9 - 2) + _arg3)] = this.m[(_local9 - 2)][(_local9 - 1)];
};
if (_local9 >= 1){
_local10[(_local9 - 1)] = this.m[(_local9 - 1)][(_local9 - 1)];
};
_local16 = this.wk_vecTridiagonalize_vec2;
_local13 = (_local9 - 1);
while (_local13 >= 0) {
_local12 = this.m[_local13];
_local4.setNewArray(_local12, clm);
if (_local13 < (_local9 - 2)){
_local14 = (_local13 + 1);
while (_local14 < _local9) {
_local16.setNewArray(this.m[_local14], clm);
_local6 = _local4.vecInnerproduct(_local16, (_local13 + 1));
_local15 = (_local13 + 1);
while (_local15 < _local9) {
FLARException.trap("未チェックパス");
this.m[_local14][_local15] = (this.m[_local14][_local15] - (_local6 * _local12[_local15]));
_local15++;
};
_local14++;
};
};
_local14 = 0;
while (_local14 < _local9) {
_local12[_local14] = 0;
_local14++;
};
_local12[_local13] = 1;
_local13--;
};
}
public function matrixAllocDup():FLARMat{
var _local1:FLARMat;
var _local2:int;
var _local3:int;
var _local4:Array;
var _local5:Array;
_local1 = new FLARMat(this.row, this.clm);
_local4 = _local1.m;
_local5 = this.m;
_local2 = (this.row - 1);
while (_local2 >= 0) {
_local3 = (this.clm - 1);
while (_local3 >= 0) {
_local4[_local2][_local3] = _local5[_local2][_local3];
_local3--;
};
_local2--;
};
return (_local1);
}
public function getRow():int{
return (row);
}
private function PCA_PCA(_arg1:FLARMat, _arg2:FLARVec):void{
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Array;
var _local7:FLARMat;
var _local8:Array;
var _local9:Array;
var _local10:int;
var _local11:int;
_local6 = _arg2.getArray();
_local3 = this.row;
_local4 = this.clm;
_local5 = ((_local4)<_local3) ? _local4 : _local3;
if ((((_local3 < 2)) || ((_local4 < 2)))){
throw (new FLARException());
};
if (_arg1.clm != this.clm){
throw (new FLARException());
};
if (_arg1.row != _local5){
throw (new FLARException());
};
if (_arg2.getClm() != _local5){
throw (new FLARException());
};
if (this.wk_PCA_PCA_u == null){
_local7 = new FLARMat(_local5, _local5);
this.wk_PCA_PCA_u = _local7;
} else {
_local7 = this.wk_PCA_PCA_u;
_local7.realloc(_local5, _local5);
};
if (_local3 < _local4){
FLARException.trap("未チェックのパス");
PCA_x_by_xt(this, _local7);
} else {
PCA_xt_by_x(this, _local7);
};
_local7.PCA_QRM(_arg2);
if (_local3 < _local4){
FLARException.trap("未チェックのパス");
PCA_EV_create(this, _local7, _arg1, _arg2);
} else {
_local8 = _local7.m;
_local9 = _arg1.m;
_local10 = 0;
while (_local10 < _local5) {
if (_local6[_local10] < PCA_VZERO){
break;
};
_local11 = 0;
while (_local11 < _local5) {
_local9[_local10][_local11] = _local8[_local10][_local11];
_local11++;
};
_local10++;
};
while (_local10 < _local5) {
_local6[_local10] = 0;
_local11 = 0;
while (_local11 < _local5) {
_local9[_local10][_local11] = 0;
_local11++;
};
_local10++;
};
};
}
private function PCA_QRM(_arg1:FLARVec):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:int;
var _local9:int;
var _local10:Array;
var _local11:FLARVec;
var _local12:Array;
var _local13:Array;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:int;
_local10 = _arg1.getArray();
_local8 = this.row;
if (((!((_local8 == this.clm))) || ((_local8 < 2)))){
throw (new FLARException());
};
if (_arg1.getClm() != _local8){
throw (new FLARException());
};
_local11 = this.wk_PCA_QRM_ev;
_local11.realloc(_local8);
_local12 = _local11.getArray();
if (_local11 == null){
throw (new FLARException());
};
_local13 = this.m;
this.vecTridiagonalize(_arg1, _local11, 1);
_local12[0] = 0;
_local14 = (_local8 - 1);
while (_local14 > 0) {
_local15 = _local14;
while ((((_local15 > 0)) && ((Math.abs(_local12[_local15]) > (PCA_EPS * (Math.abs(_local10[(_local15 - 1)]) + Math.abs(_local10[_local15]))))))) {
_local15--;
};
if (_local15 == _local14){
} else {
_local9 = 0;
do {
_local9++;
} while (!(_local9 > PCA_MAX_ITER));
};
_local14--;
};
_local16 = 0;
while (_local16 < (_local8 - 1)) {
_local14 = _local16;
_local3 = _local10[_local14];
_local17 = (_local16 + 1);
while (_local17 < _local8) {
if (_local10[_local17] > _local3){
_local14 = _local17;
_local3 = _local10[_local14];
};
_local17++;
};
_local10[_local14] = _local10[_local16];
_local10[_local16] = _local3;
this.flipRow(_local14, _local16);
_local16++;
};
}
private function flipRow(_arg1:int, _arg2:int):void{
var _local3:int;
var _local4:Number;
var _local5:Array;
var _local6:Array;
_local5 = this.m[_arg1];
_local6 = this.m[_arg2];
_local3 = (clm - 1);
while (_local3 >= 0) {
_local4 = _local5[_local3];
_local5[_local3] = _local6[_local3];
_local6[_local3] = _local4;
_local3--;
};
}
public function matrixDup(_arg1:FLARMat):void{
var _local2:int;
var _local3:int;
var _local4:Array;
var _local5:Array;
this.realloc(_arg1.row, _arg1.clm);
_local4 = _arg1.m;
_local5 = this.m;
_local2 = (this.row - 1);
while (_local2 >= 0) {
_local3 = (this.clm - 1);
while (_local3 >= 0) {
_local5[_local2][_local3] = _local4[_local2][_local3];
_local3--;
};
_local2--;
};
}
public function copyFrom(_arg1:FLARMat):void{
var _local2:int;
var _local3:int;
if (((!((this.row == _arg1.row))) || (!((this.clm == _arg1.clm))))){
throw (new FLARException());
};
_local2 = (this.row - 1);
while (_local2 >= 0) {
_local3 = (this.clm - 1);
while (_local3 >= 0) {
this.m[_local2][_local3] = _arg1.m[_local2][_local3];
_local3--;
};
_local2--;
};
}
public static function arMatrixDet(_arg1:FLARMat):Number{
FLARException.trap("動作未チェック/配列化未チェック");
if (_arg1.row != _arg1.clm){
return (0);
};
return (Det_mdet(_arg1.getArray(), _arg1.row, _arg1.clm));
}
public static function matrixUnit(_arg1:FLARMat):void{
var _local2:int;
var _local3:int;
if (_arg1.row != _arg1.clm){
throw (new FLARException());
};
FLARException.trap("未チェックのパス");
_local2 = 0;
while (_local2 < _arg1.getRow()) {
_local3 = 0;
while (_local3 < _arg1.getClm()) {
if (_local2 == _local3){
_arg1.m[_local2][_local3] = 1;
} else {
_arg1.m[_local2][_local3] = 0;
};
_local3++;
};
_local2++;
};
}
private static function PCA_CENTER(_arg1:FLARMat, _arg2:FLARVec):void{
var _local3:Array;
var _local4:int;
var _local5:int;
var _local6:Array;
var _local7:Array;
var _local8:Number;
var _local9:Number;
var _local10:int;
var _local11:int;
_local4 = _arg1.getRow();
_local5 = _arg1.getClm();
if (_arg2.getClm() != _local5){
throw (new FLARException());
};
_local6 = _arg1.m;
_local3 = _arg2.getArray();
switch (_local5){
case 1:
_local8 = _local3[0];
_local10 = 0;
while (_local10 < _local4) {
_local6[_local10][0] = (_local6[_local10][0] - _local8);
_local10++;
};
break;
case 2:
_local8 = _local3[0];
_local9 = _local3[1];
_local10 = 0;
while (_local10 < _local4) {
_local7 = _local6[_local10];
_local7[0] = (_local7[0] - _local8);
_local7[1] = (_local7[1] - _local9);
_local10++;
};
break;
default:
_local10 = 0;
while (_local10 < _local4) {
_local7 = _local6[_local10];
_local11 = 0;
while (_local11 < _local5) {
_local7[_local11] = (_local7[_local11] - _local3[_local11]);
_local11++;
};
_local10++;
};
break;
};
}
public static function matrixTrans(_arg1:FLARMat, _arg2:FLARMat):void{
var _local3:int;
var _local4:int;
if (((!((_arg1.row == _arg2.clm))) || (!((_arg1.clm == _arg2.row))))){
throw (new FLARException());
};
FLARException.trap("未チェックのパス");
_local3 = 0;
while (_local3 < _arg1.row) {
_local4 = 0;
while (_local4 < _arg1.clm) {
_arg1.m[_local3][_local4] = _arg2.m[_local4][_local3];
_local4++;
};
_local3++;
};
}
private static function PCA_xt_by_x(_arg1:FLARMat, _arg2:FLARMat):void{
var _local3:Array;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:Array;
var _local10:Number;
_local4 = _arg1.row;
_local5 = _arg1.clm;
if (((!((_arg2.row == _local5))) || (!((_arg2.clm == _local5))))){
throw (new FLARException());
};
_local9 = _arg2.m;
_local6 = 0;
while (_local6 < _local5) {
_local8 = 0;
while (_local8 < _local5) {
if (_local8 < _local6){
_local9[_local6][_local8] = _local9[_local8][_local6];
} else {
_local10 = 0;
_local7 = 0;
while (_local7 < _local4) {
_local3 = _arg1.m[_local7];
_local10 = (_local10 + (_local3[_local6] * _local3[_local8]));
_local7++;
};
_local9[_local6][_local8] = _local10;
};
_local8++;
};
_local6++;
};
}
private static function PCA_x_by_xt(_arg1:FLARMat, _arg2:FLARMat):void{
var _local3:int;
var _local4:int;
var _local5:Array;
var _local6:Array;
var _local7:int;
var _local8:int;
var _local9:int;
FLARException.trap("動作未チェック/配列化未チェック");
FLARException.trap("未チェックのパス");
_local3 = _arg1.row;
_local4 = _arg1.clm;
FLARException.trap("未チェックのパス");
if (((!((_arg2.row == _local3))) || (!((_arg2.clm == _local3))))){
throw (new FLARException());
};
_local7 = 0;
while (_local7 < _local3) {
_local8 = 0;
while (_local8 < _local3) {
if (_local8 < _local7){
FLARException.trap("未チェックのパス");
_arg2.m[_local7][_local8] = _arg2.m[_local8][_local7];
} else {
FLARException.trap("未チェックのパス");
_local5 = _arg1.m[_local7];
_local6 = _arg1.m[_local8];
_arg2.m[_local7][_local8] = 0;
_local9 = 0;
while (_local9 < _local4) {
_arg2.m[_local7][_local8] = (_arg2.m[_local7][_local8] + (_local5[_local9] * _local6[_local9]));
_local9++;
};
};
_local8++;
};
_local7++;
};
}
public static function matrixInv(_arg1:FLARMat, _arg2:FLARMat):void{
FLARException.trap("未チェックのパス");
_arg1.matrixDup(_arg2);
FLARException.trap("未チェックのパス");
_arg1.matrixSelfInv();
}
private static function Det_mdet(_arg1:Array, _arg2:int, _arg3:int):Number{
var _local4:Number;
var _local5:Number;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
FLARException.trap("動作未チェック/配列化未チェック");
_local4 = 1;
_local6 = 0;
_local8 = 0;
while (_local8 < (_arg2 - 1)) {
_local7 = _local8;
_local9 = (_local8 + 1);
while (_local9 < _arg2) {
if (Math.abs(_arg1[_local9][_local8]) > Math.abs(_arg1[_local7][_local8])){
_local7 = _local9;
};
_local9++;
};
if (_local7 != _local8){
_local10 = _local8;
while (_local10 < _arg2) {
_local5 = _arg1[_local8][_local10];
_arg1[_local8][_local10] = _arg1[_local7][_local10];
_arg1[_local7][_local10] = _local5;
_local10++;
};
_local6++;
};
_local9 = (_local8 + 1);
while (_local9 < _arg2) {
_local5 = (_arg1[_local9][_local8] / _arg1[_local8][_local8]);
_local10 = (_local8 + 1);
while (_local10 < _arg2) {
_arg1[_local9][_local10] = (_arg1[_local9][_local10] - (_local5 * _arg1[_local8][_local10]));
_local10++;
};
_local9++;
};
_local8++;
};
_local9 = 0;
while (_local9 < _arg2) {
_local4 = _arg1[_local9][_local9];
_local9++;
};
_local9 = 0;
while (_local9 < _local6) {
_local4 = (_local4 * -1);
_local9++;
};
return (_local4);
}
public static function arMatrixPCA2(_arg1:FLARMat, _arg2:FLARMat, _arg3:FLARVec):void{
var _local4:FLARMat;
var _local5:Number;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:Array;
var _local10:int;
FLARException.trap("未チェックのパス");
_local6 = _arg1.row;
_local7 = _arg1.clm;
_local8 = ((_local6)<_local7) ? _local6 : _local7;
if ((((_local6 < 2)) || ((_local7 < 2)))){
throw (new FLARException());
};
if (((!((_arg2.getClm() == _arg1.clm))) || (!((_arg2.row == _local8))))){
throw (new FLARException());
};
if (_arg3.getClm() != _local8){
throw (new FLARException());
};
FLARException.trap("未チェックのパス");
_local4 = _arg1.matrixAllocDup();
FLARException.trap("未チェックパス");
_local4.PCA_PCA(_arg2, _arg3);
_local5 = 0;
_local9 = _arg3.getArray();
_local10 = 0;
while (_local10 < _arg3.getClm()) {
FLARException.trap("未チェックパス");
_local5 = (_local5 + _local9[_local10]);
_local10++;
};
_local10 = 0;
while (_local10 < _arg3.getClm()) {
FLARException.trap("未チェックパス");
_local9[_local10] = (_local9[_local10] / _local5);
_local10++;
};
}
public static function matrixAllocUnit(_arg1:int):FLARMat{
var _local2:FLARMat;
FLARException.trap("未チェックのパス");
_local2 = new FLARMat(_arg1, _arg1);
FLARException.trap("未チェックのパス");
FLARMat.matrixUnit(_local2);
return (_local2);
}
private static function PCA_EV_create(_arg1:FLARMat, _arg2:FLARMat, _arg3:FLARMat, _arg4:FLARVec):void{
var _local5:int;
var _local6:int;
var _local7:Array;
var _local8:Array;
var _local9:Array;
var _local10:Array;
var _local11:Number;
var _local12:Number;
var _local13:int;
var _local14:int;
var _local15:int;
FLARException.trap("未チェックのパス");
_local5 = _arg1.row;
_local6 = _arg1.clm;
if ((((_local5 <= 0)) || ((_local6 <= 0)))){
throw (new FLARException());
};
if (((!((_arg2.row == _local5))) || (!((_arg2.clm == _local5))))){
throw (new FLARException());
};
if (((!((_arg3.row == _local5))) || (!((_arg3.clm == _local6))))){
throw (new FLARException());
};
if (_arg4.getClm() != _local5){
throw (new FLARException());
};
FLARException.trap("未チェックのパス");
_local7 = _arg3.m;
_local8 = _arg1.m;
_local10 = _arg4.getArray();
_local13 = 0;
while (_local13 < _local5) {
FLARException.trap("未チェックのパス");
if (_local10[_local13] < PCA_VZERO){
break;
};
FLARException.trap("未チェックのパス");
_local12 = (1 / Math.sqrt(Math.abs(_local10[_local13])));
_local14 = 0;
while (_local14 < _local6) {
_local11 = 0;
_local9 = _arg2.m[_local13];
_local15 = 0;
while (_local15 < _local5) {
_local11 = (_local11 + (_local9[_local15] + _local8[_local15][_local14]));
_local15++;
};
_local9[_local14] = (_local11 * _local12);
_local14++;
};
_local13++;
};
while (_local13 < _local5) {
FLARException.trap("未チェックのパス");
_local10[_local13] = 0;
_local14 = 0;
while (_local14 < _local6) {
_local7[_local13][_local14] = 0;
_local14++;
};
_local13++;
};
}
public static function matrixAllocMul(_arg1:FLARMat, _arg2:FLARMat):FLARMat{
var _local3:FLARMat;
FLARException.trap("未チェックのパス");
_local3 = new FLARMat(_arg1.row, _arg2.clm);
FLARException.trap("未チェックのパス");
_local3.matrixMul(_arg1, _arg2);
return (_local3);
}
}
}//package org.libspark.flartoolkit.core
Section 123
//FLARSquare (org.libspark.flartoolkit.core.FLARSquare)
package org.libspark.flartoolkit.core {
import org.libspark.flartoolkit.core.types.*;
import org.libspark.flartoolkit.core.labeling.*;
public class FLARSquare {
public var sqvertex:Array;
public var imvertex:Array;
public var label:FLARLabelingLabel;
public var line:Array;
public function FLARSquare(){
var _local1:int;
line = new Array(4);
sqvertex = new Array(4);
imvertex = new Array(4);
super();
_local1 = 0;
while (_local1 < 4) {
this.sqvertex[_local1] = new FLARDoublePoint2d();
this.imvertex[_local1] = new FLARIntPoint();
this.line[_local1] = new FLARLinear();
_local1++;
};
}
}
}//package org.libspark.flartoolkit.core
Section 124
//FLARSquareDetector (org.libspark.flartoolkit.core.FLARSquareDetector)
package org.libspark.flartoolkit.core {
import org.libspark.flartoolkit.core.param.*;
import org.libspark.flartoolkit.core.types.*;
import org.libspark.flartoolkit.core.raster.*;
import org.libspark.flartoolkit.utils.*;
import org.libspark.flartoolkit.core.labeling.*;
public class FLARSquareDetector implements IFLARSquareDetector {
private const __getSquareLine_mean:FLARVec;
private const __getSquareLine_input:FLARMat;
private const __getSquareLine_evec:FLARMat;
private const __getSquareVertex_wv1:FLARVertexCounter;
private const __getSquareVertex_wv2:FLARVertexCounter;
private const __getSquareLine_ev:FLARVec;
private var _height:int;
private var _width:int;
private var _labeling:IFLARLabeling;
private var _limage:IFLARLabelingImage;
private var _max_coord:int;
private var _xcoord:Array;
private var _dist_factor_ref:FLARCameraDistortionFactor;
private var __detectMarker_mkvertex:Array;
private var _ycoord:Array;
private var _overlap_checker:OverlapChecker;
private static const AR_AREA_MAX:int = 100000;
private static const VERTEX_FACTOR:Number = 1;
private static const AR_AREA_MIN:int = 70;
public function FLARSquareDetector(_arg1:FLARCameraDistortionFactor, _arg2:FLARIntSize){
var _local3:int;
_overlap_checker = new OverlapChecker();
__detectMarker_mkvertex = new Array(5);
__getSquareVertex_wv1 = new FLARVertexCounter();
__getSquareVertex_wv2 = new FLARVertexCounter();
__getSquareLine_input = new FLARMat(1, 2);
__getSquareLine_evec = new FLARMat(2, 2);
__getSquareLine_ev = new FLARVec(2);
__getSquareLine_mean = new FLARVec(2);
super();
this._width = _arg2.w;
this._height = _arg2.h;
this._dist_factor_ref = _arg1;
this._labeling = new FLARLabeling_BitmapData();
this._limage = new FLARLabelingImageBitmapData(this._width, this._height);
this._labeling.attachDestination(this._limage);
_local3 = ((this._width + this._height) * 2);
this._max_coord = _local3;
this._xcoord = new Array((_local3 * 2));
this._ycoord = new Array((_local3 * 2));
}
public function detectMarker(_arg1:IFLARRaster, _arg2:FLARSquareStack):void{
var _local3:IFLARLabeling;
var _local4:IFLARLabelingImage;
var _local5:int;
var _local6:FLARLabelingLabelStack;
var _local7:Array;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:Array;
var _local12:Array;
var _local13:int;
var _local14:Array;
var _local15:OverlapChecker;
var _local16:int;
var _local17:int;
var _local18:FLARLabelingLabel;
var _local19:int;
var _local20:FLARSquare;
_local3 = this._labeling;
_local4 = this._limage;
_arg2.clear();
_local3.labeling(_arg1);
_local5 = _local4.getLabelStack().getLength();
if (_local5 < 1){
return;
};
_local6 = _local4.getLabelStack();
_local7 = _local6.getArray();
_local6.sortByArea();
_local8 = 0;
while (_local8 < _local5) {
if (_local7[_local8].area <= AR_AREA_MAX){
break;
};
_local8++;
};
_local9 = this._width;
_local10 = this._height;
_local11 = this._xcoord;
_local12 = this._ycoord;
_local13 = this._max_coord;
_local14 = this.__detectMarker_mkvertex;
_local15 = this._overlap_checker;
_local15.reset(_local5);
while (_local8 < _local5) {
_local18 = _local7[_local8];
_local17 = _local18.area;
if (_local17 < AR_AREA_MIN){
break;
};
if ((((_local18.clip_l == 1)) || ((_local18.clip_r == (_local9 - 2))))){
} else {
if ((((_local18.clip_t == 1)) || ((_local18.clip_b == (_local10 - 2))))){
} else {
if (!_local15.check(_local18)){
} else {
_local16 = _local4.getContour(_local8, _local13, _local11, _local12);
if (_local16 == _local13){
} else {
_local19 = scanVertex(_local11, _local12, _local16);
normalizeCoord(_local11, _local12, _local19, _local16);
_local20 = (_arg2.prePush() as FLARSquare);
if (!getSquareVertex(_local11, _local12, _local19, _local16, _local17, _local14)){
_arg2.pop();
} else {
if (!getSquareLine(_local14, _local11, _local12, _local20)){
_arg2.pop();
} else {
_local15.push(_local18);
_local20.label = _local18;
};
};
};
};
};
};
_local8++;
};
}
private function scanVertex(_arg1:Array, _arg2:Array, _arg3:int):int{
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
_local4 = _arg1[0];
_local5 = _arg2[0];
_local6 = 0;
_local10 = 0;
_local11 = 1;
while (_local11 < _arg3) {
_local8 = (_arg1[_local11] - _local4);
_local9 = (_arg2[_local11] - _local5);
_local7 = ((_local8 * _local8) + (_local9 * _local9));
if (_local7 > _local6){
_local6 = _local7;
_local10 = _local11;
};
_local11++;
};
return (_local10);
}
private function getSquareVertex(_arg1:Array, _arg2:Array, _arg3:int, _arg4:int, _arg5:int, _arg6:Array):Boolean{
var _local7:FLARVertexCounter;
var _local8:FLARVertexCounter;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
var _local16:Number;
var _local17:int;
_local7 = this.__getSquareVertex_wv1;
_local8 = this.__getSquareVertex_wv2;
_local9 = ((_arg3 + _arg4) - 1);
_local10 = _arg1[_arg3];
_local11 = _arg2[_arg3];
_local12 = 0;
_local13 = _arg3;
_local15 = (1 + _arg3);
while (_local15 < _local9) {
_local14 = (((_arg1[_local15] - _local10) * (_arg1[_local15] - _local10)) + ((_arg2[_local15] - _local11) * (_arg2[_local15] - _local11)));
if (_local14 > _local12){
_local12 = _local14;
_local13 = _local15;
};
_local15++;
};
_local16 = (((_arg5 / 0.75) * 0.01) * VERTEX_FACTOR);
_arg6[0] = _arg3;
if (!_local7.getVertex(_arg1, _arg2, _arg3, _local13, _local16)){
return (false);
};
if (!_local8.getVertex(_arg1, _arg2, _local13, _local9, _local16)){
return (false);
};
if ((((_local7.number_of_vertex == 1)) && ((_local8.number_of_vertex == 1)))){
_arg6[1] = _local7.vertex[0];
_arg6[2] = _local13;
_arg6[3] = _local8.vertex[0];
} else {
if ((((_local7.number_of_vertex > 1)) && ((_local8.number_of_vertex == 0)))){
_local17 = (((_local13 - _arg3) / 2) + _arg3);
if (!_local7.getVertex(_arg1, _arg2, _arg3, _local17, _local16)){
return (false);
};
if (!_local8.getVertex(_arg1, _arg2, _local17, _local13, _local16)){
return (false);
};
if ((((_local7.number_of_vertex == 1)) && ((_local8.number_of_vertex == 1)))){
_arg6[1] = _local7.vertex[0];
_arg6[2] = _local8.vertex[0];
_arg6[3] = _local13;
} else {
return (false);
};
} else {
if ((((_local7.number_of_vertex == 0)) && ((_local8.number_of_vertex > 1)))){
_local17 = ((_local13 + _local9) / 2);
if (!_local7.getVertex(_arg1, _arg2, _local13, _local17, _local16)){
return (false);
};
if (!_local8.getVertex(_arg1, _arg2, _local17, _local9, _local16)){
return (false);
};
if ((((_local7.number_of_vertex == 1)) && ((_local8.number_of_vertex == 1)))){
_arg6[1] = _local13;
_arg6[2] = _local7.vertex[0];
_arg6[3] = _local8.vertex[0];
} else {
return (false);
};
} else {
return (false);
};
};
};
_arg6[4] = _local9;
return (true);
}
private function getSquareLine(_arg1:Array, _arg2:Array, _arg3:Array, _arg4:FLARSquare):Boolean{
var _local5:Array;
var _local6:FLARVec;
var _local7:FLARVec;
var _local8:Array;
var _local9:FLARCameraDistortionFactor;
var _local10:FLARMat;
var _local11:FLARMat;
var _local12:Array;
var _local13:int;
var _local14:Number;
var _local15:int;
var _local16:int;
var _local17:int;
var _local18:FLARLinear;
var _local19:Array;
var _local20:Array;
var _local21:FLARLinear;
_local5 = _arg4.line;
_local6 = this.__getSquareLine_ev;
_local7 = this.__getSquareLine_mean;
_local8 = _local7.getArray();
_local9 = this._dist_factor_ref;
_local10 = this.__getSquareLine_input;
_local11 = this.__getSquareLine_evec;
_local12 = _local11.getArray();
_local13 = 0;
while (_local13 < 4) {
_local14 = ((((_arg1[(_local13 + 1)] - _arg1[_local13]) + 1) * 0.05) + 0.5);
_local15 = (_arg1[_local13] + _local14);
_local16 = (_arg1[(_local13 + 1)] - _local14);
_local17 = ((_local16 - _local15) + 1);
if (_local17 < 2){
return (false);
};
_local10.realloc(_local17, 2);
_local9.observ2IdealBatch(_arg2, _arg3, _local15, _local17, _local10.getArray());
_local10.matrixPCA(_local11, _local6, _local7);
_local18 = _local5[_local13];
_local18.run = _local12[0][1];
_local18.rise = -(_local12[0][0]);
_local18.intercept = -(((_local18.run * _local8[0]) + (_local18.rise * _local8[1])));
_local13++;
};
_local19 = _arg4.sqvertex;
_local20 = _arg4.imvertex;
_local13 = 0;
while (_local13 < 4) {
_local18 = _local5[_local13];
_local21 = _local5[((_local13 + 3) % 4)];
_local14 = ((_local21.run * _local18.rise) - (_local18.run * _local21.rise));
if (_local14 == 0){
return (false);
};
_local19[_local13].x = (((_local21.rise * _local18.intercept) - (_local18.rise * _local21.intercept)) / _local14);
_local19[_local13].y = (((_local18.run * _local21.intercept) - (_local21.run * _local18.intercept)) / _local14);
_local20[_local13].x = _arg2[_arg1[_local13]];
_local20[_local13].y = _arg3[_arg1[_local13]];
_local13++;
};
return (true);
}
private function normalizeCoord(_arg1:Array, _arg2:Array, _arg3:int, _arg4:int):void{
ArrayUtil.copy(_arg1, 1, _arg1, _arg4, _arg3);
ArrayUtil.copy(_arg2, 1, _arg2, _arg4, _arg3);
}
}
}//package org.libspark.flartoolkit.core
import org.libspark.flartoolkit.core.labeling.*;
class FLARVertexCounter {
public const vertex:Array;
private var x_coord:Array;
private var y_coord:Array;
public var number_of_vertex:int;
private var thresh:Number;
private function FLARVertexCounter(){
vertex = new Array(10);
super();
}
private function get_vertex(_arg1:int, _arg2:int):Boolean{
var _local3:int;
var _local4:Array;
var _local5:Array;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:int;
var _local11:Number;
_local3 = 0;
_local4 = this.x_coord;
_local5 = this.y_coord;
_local6 = (_local5[_arg2] - _local5[_arg1]);
_local7 = (_local4[_arg1] - _local4[_arg2]);
_local8 = ((_local4[_arg2] * _local5[_arg1]) - (_local5[_arg2] * _local4[_arg1]));
_local9 = 0;
_local10 = (_arg1 + 1);
while (_local10 < _arg2) {
_local11 = (((_local6 * _local4[_local10]) + (_local7 * _local5[_local10])) + _local8);
if (((((_local6 * _local4[_local10]) + (_local7 * _local5[_local10])) + _local8) * _local11) > _local9){
_local9 = (_local11 * _local11);
_local3 = _local10;
};
_local10++;
};
if ((_local9 / ((_local6 * _local6) + (_local7 * _local7))) > thresh){
if (!get_vertex(_arg1, _local3)){
return (false);
};
if (number_of_vertex > 5){
return (false);
};
vertex[number_of_vertex] = _local3;
number_of_vertex++;
if (!get_vertex(_local3, _arg2)){
return (false);
};
};
return (true);
}
public function getVertex(_arg1:Array, _arg2:Array, _arg3:int, _arg4:int, _arg5:Number):Boolean{
this.number_of_vertex = 0;
this.thresh = _arg5;
this.x_coord = _arg1;
this.y_coord = _arg2;
return (get_vertex(_arg3, _arg4));
}
}
class OverlapChecker {
private var _length:int;
private var _labels:Array;
private function OverlapChecker(){
_labels = new Array(32);
super();
}
public function reset(_arg1:int):void{
var _local2:int;
if (_arg1 > this._labels.length){
this._labels = new Array(_arg1);
_local2 = _arg1;
while (_local2--) {
this._labels[_local2] = new FLARLabelingLabel();
};
};
this._length = 0;
}
public function check(_arg1:FLARLabelingLabel):Boolean{
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
_local2 = this._labels;
_local3 = int(_arg1.pos_x);
_local4 = int(_arg1.pos_y);
_local5 = (this._length - 1);
while (_local5 >= 0) {
_local6 = int(_local2[_local5].pos_x);
_local7 = int(_local2[_local5].pos_y);
_local8 = (((_local3 - _local6) * (_local3 - _local6)) + ((_local4 - _local7) * (_local4 - _local7)));
if (_local8 < (_local2[_local5].area / 4)){
return (false);
};
_local5--;
};
return (true);
}
public function push(_arg1:FLARLabelingLabel):void{
this._labels[this._length] = _arg1;
this._length++;
}
}
Section 125
//FLARSquareStack (org.libspark.flartoolkit.core.FLARSquareStack)
package org.libspark.flartoolkit.core {
import org.libspark.flartoolkit.utils.*;
public class FLARSquareStack extends NyObjectStack {
public function FLARSquareStack(_arg1:int){
super(FLARSquare, _arg1);
}
}
}//package org.libspark.flartoolkit.core
Section 126
//FLARVec (org.libspark.flartoolkit.core.FLARVec)
package org.libspark.flartoolkit.core {
import org.libspark.flartoolkit.*;
public class FLARVec {
private var clm:int;
private var v:Array;
public function FLARVec(_arg1:int){
v = new Array(_arg1);
clm = _arg1;
}
public function realloc(_arg1:int):void{
if (_arg1 <= this.v.length){
} else {
v = new Array(_arg1);
};
this.clm = _arg1;
}
public function getArray():Array{
return (v);
}
public function arVecDisp():int{
FLARException.trap("未チェックのパス");
return (0);
}
public function vecHousehold(_arg1:int):Number{
var _local2:Number;
var _local3:Number;
var _local4:int;
FLARException.trap("この関数は動作確認できていません。");
_local2 = Math.sqrt(this.vecInnerproduct(this, _arg1));
if (_local2 != 0){
FLARException.trap("未チェックのパス");
if (this.v[_arg1] < 0){
_local2 = -(_local2);
};
FLARException.trap("未チェックのパス");
this.v[_arg1] = (this.v[_arg1] + _local2);
_local3 = (1 / Math.sqrt((this.v[_arg1] * _local2)));
_local4 = _arg1;
while (_local4 < this.clm) {
FLARException.trap("未チェックのパス");
this.v[_local4] = (this.v[_local4] * _local3);
_local4++;
};
};
return (-(_local2));
}
public function vecInnerproduct(_arg1:FLARVec, _arg2:int):Number{
var _local3:Number;
var _local4:int;
FLARException.trap("この関数は動作確認できていません。");
_local3 = 0;
if (this.clm != _arg1.clm){
throw (new FLARException());
};
_local4 = _arg2;
while (_local4 < this.clm) {
FLARException.trap("未チェックのパス");
_local3 = (_local3 + (this.v[_local4] * _arg1.v[_local4]));
_local4++;
};
return (_local3);
}
public function getClm():int{
return (clm);
}
public function setNewArray(_arg1:Array, _arg2:int):void{
this.v = _arg1;
this.clm = _arg2;
}
}
}//package org.libspark.flartoolkit.core
Section 127
//IFLARSquareDetector (org.libspark.flartoolkit.core.IFLARSquareDetector)
package org.libspark.flartoolkit.core {
import org.libspark.flartoolkit.core.raster.*;
public interface IFLARSquareDetector {
function detectMarker(_arg1:IFLARRaster, _arg2:FLARSquareStack):void;
}
}//package org.libspark.flartoolkit.core
Section 128
//FLARSingleMarkerDetector (org.libspark.flartoolkit.detector.FLARSingleMarkerDetector)
package org.libspark.flartoolkit.detector {
import org.libspark.flartoolkit.core.rasterfilter.rgb2bin.*;
import org.libspark.flartoolkit.core.param.*;
import org.libspark.flartoolkit.core.*;
import org.libspark.flartoolkit.core.raster.rgb.*;
import org.libspark.flartoolkit.core.transmat.*;
import org.libspark.flartoolkit.core.pickup.*;
import org.libspark.flartoolkit.core.types.*;
import org.libspark.flartoolkit.core.raster.*;
import org.libspark.flartoolkit.core.match.*;
import org.libspark.flartoolkit.*;
public class FLARSingleMarkerDetector {
private const _square_list:FLARSquareStack;
private var _square_detect:IFLARSquareDetector;
private var _match_patt:FLARMatchPatt_Color_WITHOUT_PCA;
private var _tobin_filter:IFLARRasterFilter_RgbToBin;
private var _code:FLARCode;
protected var _transmat:IFLARTransMat;
private var _sizeCheckEnabled:Boolean;// = true
private var _bin_raster:IFLARRaster;
private var _is_continue:Boolean;// = false
private var _patt:IFLARColorPatt;
private var _marker_width:Number;
private var _detected_direction:int;
private var _detected_confidence:Number;
private var _detected_square:FLARSquare;
private static const AR_SQUARE_MAX:int = 100;
public function FLARSingleMarkerDetector(_arg1:FLARParam, _arg2:FLARCode, _arg3:Number){
var _local4:FLARIntSize;
var _local5:Number;
var _local6:Number;
_sizeCheckEnabled = true;
_is_continue = false;
_square_list = new FLARSquareStack(AR_SQUARE_MAX);
super();
_local4 = _arg1.getScreenSize();
this._square_detect = new FLARSquareDetector(_arg1.getDistortionFactor(), _local4);
this._transmat = new FLARTransMat(_arg1);
this._code = _arg2;
this._marker_width = _arg3;
_local5 = (this._code.markerPercentWidth / 10);
_local6 = (this._code.markerPercentHeight / 10);
this._patt = new FLARDynamicRatioColorPatt_O3(this._code.getWidth(), this._code.getHeight(), _local5, _local6);
this._match_patt = new FLARMatchPatt_Color_WITHOUT_PCA();
this._bin_raster = new FLARRaster_BitmapData(_local4.w, _local4.h);
this._tobin_filter = new FLARRasterFilter_BitmapDataThreshold(100);
}
public function detectMarkerLite(_arg1:IFLARRgbRaster, _arg2:int):Boolean{
var _local3:FLARSquareStack;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:Number;
var _local8:int;
var _local9:Number;
if (!this._bin_raster.getSize().isEqualSizeO(_arg1.getSize())){
if (this._sizeCheckEnabled){
throw (new FLARException(((("サイズ不一致(" + this._bin_raster.getSize()) + ":") + _arg1.getSize())));
};
this._bin_raster = new FLARRaster_BitmapData(_arg1.getSize().w, _arg1.getSize().h);
};
this._tobin_filter.setThreshold(_arg2);
this._tobin_filter.doFilter(_arg1, this._bin_raster);
this._detected_square = null;
_local3 = this._square_list;
this._square_detect.detectMarker(this._bin_raster, _local3);
_local4 = _local3.getLength();
if (_local4 < 1){
return (false);
};
if (!this._patt.pickFromRaster(_arg1, (_local3.getItem(0) as FLARSquare))){
return (false);
};
if (!this._match_patt.setPatt(this._patt)){
throw (new FLARException());
};
this._match_patt.evaluate(this._code);
_local5 = 0;
_local6 = this._match_patt.getDirection();
_local7 = this._match_patt.getConfidence();
_local8 = 1;
while (_local8 < _local4) {
this._patt.pickFromRaster(_arg1, (_local3.getItem(_local8) as FLARSquare));
this._match_patt.setPatt(this._patt);
this._match_patt.evaluate(this._code);
_local9 = this._match_patt.getConfidence();
if (_local7 > _local9){
} else {
_local5 = _local8;
_local6 = this._match_patt.getDirection();
_local7 = _local9;
};
_local8++;
};
this._detected_square = (_local3.getItem(_local5) as FLARSquare);
this._detected_direction = _local6;
this._detected_confidence = _local7;
return (true);
}
public function get sizeCheckEnabled():Boolean{
return (this._sizeCheckEnabled);
}
public function getSquare():FLARSquare{
return (this._detected_square);
}
public function getTransformMatrix(_arg1:FLARTransMatResult):void{
if (this._is_continue){
this._transmat.transMatContinue(this._detected_square, this._detected_direction, this._marker_width, _arg1);
} else {
this._transmat.transMat(this._detected_square, this._detected_direction, this._marker_width, _arg1);
};
}
public function getConfidence():Number{
return (this._detected_confidence);
}
public function getSquareList():FLARSquareStack{
return (this._square_list);
}
public function getDirection():int{
return (this._detected_direction);
}
public function setContinueMode(_arg1:Boolean):void{
this._is_continue = _arg1;
}
public function set filter(_arg1:IFLARRasterFilter_RgbToBin):void{
if (_arg1 != null){
_tobin_filter = _arg1;
};
}
public function set sizeCheckEnabled(_arg1:Boolean):void{
this._sizeCheckEnabled = _arg1;
}
public function get filter():IFLARRasterFilter_RgbToBin{
return (_tobin_filter);
}
}
}//package org.libspark.flartoolkit.detector
Section 129
//ArrayUtil (org.libspark.flartoolkit.utils.ArrayUtil)
package org.libspark.flartoolkit.utils {
public class ArrayUtil {
public static function copy(_arg1:Array, _arg2:int, _arg3:Array, _arg4:int, _arg5:int):void{
var _local6:int;
_local6 = 0;
while (_local6 < _arg5) {
_arg3[(_arg4 + _local6)] = _arg1[(_arg2 + _local6)];
_local6++;
};
}
public static function create3d(_arg1:int, _arg2:int, _arg3:int):Array{
return (createJaggedArray(_arg1, _arg2, _arg3));
}
public static function create2d(_arg1:int, _arg2:int):Array{
return (createJaggedArray(_arg1, _arg2));
}
public static function createJaggedArray(_arg1:int, ... _args):Array{
var _local3:Array;
_local3 = new Array(_arg1);
while (_arg1--) {
_local3[_arg1] = (_args.length) ? createJaggedArray.apply(null, _args) : 0;
};
return (_local3);
}
}
}//package org.libspark.flartoolkit.utils
Section 130
//DoubleValue (org.libspark.flartoolkit.utils.DoubleValue)
package org.libspark.flartoolkit.utils {
public class DoubleValue {
public var value:Number;
}
}//package org.libspark.flartoolkit.utils
Section 131
//NyObjectStack (org.libspark.flartoolkit.utils.NyObjectStack)
package org.libspark.flartoolkit.utils {
import org.libspark.flartoolkit.*;
public class NyObjectStack {
protected var _items:Array;
protected var _length:int;
private var _dataClass:Class;
private var _allocated_size:int;
private static const ARRAY_APPEND_STEP:int = 64;
public function NyObjectStack(_arg1:Class, _arg2:int){
var _local3:int;
super();
this._dataClass = _arg1;
this._items = new Array(_arg2);
_local3 = _arg2;
while (_local3--) {
this._items[_local3] = new this._dataClass();
};
this._allocated_size = 0;
this._length = 0;
}
public function getArray():Array{
return (this._items);
}
public function reserv(_arg1:int):void{
var _local2:int;
if (_arg1 >= this._allocated_size){
if (_arg1 >= this._items.length){
throw (new FLARException());
};
_local2 = (_arg1 + ARRAY_APPEND_STEP);
if (_local2 >= this._items.length){
_local2 = this._items.length;
};
this.onReservRequest(this._allocated_size, _local2, this._items);
this._allocated_size = _local2;
};
this._length = _arg1;
}
public function getItem(_arg1:int):Object{
return (this._items[_arg1]);
}
public function clear():void{
this._length = 0;
}
protected function onReservRequest(_arg1:int, _arg2:int, _arg3:Array):void{
var _local4:int;
_local4 = _arg1;
while (_local4 < _arg2) {
_arg3[_local4] = new this._dataClass();
_local4++;
};
}
public function pop():Object{
if (this._length < 1){
throw (new FLARException());
};
this._length--;
return (this.getItem(this._length));
}
public function getLength():int{
return (this._length);
}
public function prePush():Object{
var _local1:Object;
var _local2:int;
if (this._length >= this._allocated_size){
if (this._length >= this._items.length){
throw (new FLARException());
};
_local2 = (this._length + ARRAY_APPEND_STEP);
if (_local2 >= this._items.length){
_local2 = this._items.length;
};
this.onReservRequest(this._allocated_size, _local2, this._items);
this._allocated_size = _local2;
};
_local1 = this._items[this._length];
this._length++;
return (_local1);
}
}
}//package org.libspark.flartoolkit.utils
Section 132
//FLARException (org.libspark.flartoolkit.FLARException)
package org.libspark.flartoolkit {
public class FLARException extends Error {
public function FLARException(_arg1:String=""){
super(_arg1);
}
public static function notImplement():void{
throw (new FLARException("Not Implement!"));
}
public static function trap(_arg1:String):void{
throw (new FLARException(("トラップ:" + _arg1)));
}
}
}//package org.libspark.flartoolkit
Section 133
//HighScoreItem_65 (Splat_fla.HighScoreItem_65)
package Splat_fla {
import flash.display.*;
import flash.text.*;
public dynamic class HighScoreItem_65 extends MovieClip {
public var rankField:TextField;
public var nameField:TextField;
public var scoreField:TextField;
}
}//package Splat_fla
Section 134
//HighScoreList_64 (Splat_fla.HighScoreList_64)
package Splat_fla {
import flash.display.*;
public dynamic class HighScoreList_64 extends MovieClip {
public var item2:MovieClip;
public var item0:MovieClip;
public var item3:MovieClip;
public var item4:MovieClip;
public var item1:MovieClip;
}
}//package Splat_fla
Section 135
//Meater_40 (Splat_fla.Meater_40)
package Splat_fla {
import flash.display.*;
public dynamic class Meater_40 extends MovieClip {
public var infinityMeater:MovieClip;
public var totalBar:MovieClip;
public var loadedBar:MovieClip;
}
}//package Splat_fla
Section 136
//Multipliercopy_45 (Splat_fla.Multipliercopy_45)
package Splat_fla {
import flash.display.*;
import flash.text.*;
public dynamic class Multipliercopy_45 extends MovieClip {
public var pointAmount:TextField;
}
}//package Splat_fla
Section 137
//Sounds_2 (Splat_fla.Sounds_2)
package Splat_fla {
import flash.display.*;
public dynamic class Sounds_2 extends MovieClip {
public function Sounds_2(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Splat_fla
Section 138
//tttttttttt_9 (Splat_fla.tttttttttt_9)
package Splat_fla {
import flash.display.*;
public dynamic class tttttttttt_9 extends MovieClip {
public function tttttttttt_9(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package Splat_fla
Section 139
//BandAid (BandAid)
package {
import flash.media.*;
public dynamic class BandAid extends Sound {
}
}//package
Section 140
//BonusCutScene (BonusCutScene)
package {
import flash.display.*;
public dynamic class BonusCutScene extends MovieClip {
}
}//package
Section 141
//BonusLevelNozzle (BonusLevelNozzle)
package {
import flash.display.*;
public dynamic class BonusLevelNozzle extends MovieClip {
}
}//package
Section 142
//BonusNozzle (BonusNozzle)
package {
import flash.media.*;
public dynamic class BonusNozzle extends Sound {
}
}//package
Section 143
//Bug (Bug)
package {
import flash.media.*;
public dynamic class Bug extends Sound {
}
}//package
Section 144
//ButtonClick (ButtonClick)
package {
import flash.media.*;
public dynamic class ButtonClick extends Sound {
}
}//package
Section 145
//ButtonRoll (ButtonRoll)
package {
import flash.media.*;
public dynamic class ButtonRoll extends Sound {
}
}//package
Section 146
//Drinking (Drinking)
package {
import flash.media.*;
public dynamic class Drinking extends Sound {
}
}//package
Section 147
//EatBandAid (EatBandAid)
package {
import flash.media.*;
public dynamic class EatBandAid extends Sound {
}
}//package
Section 148
//EatBug (EatBug)
package {
import flash.media.*;
public dynamic class EatBug extends Sound {
}
}//package
Section 149
//EatFly (EatFly)
package {
import flash.media.*;
public dynamic class EatFly extends Sound {
}
}//package
Section 150
//EatMeat (EatMeat)
package {
import flash.media.*;
public dynamic class EatMeat extends Sound {
}
}//package
Section 151
//EatRat (EatRat)
package {
import flash.media.*;
public dynamic class EatRat extends Sound {
}
}//package
Section 152
//EatSpider (EatSpider)
package {
import flash.media.*;
public dynamic class EatSpider extends Sound {
}
}//package
Section 153
//Fly (Fly)
package {
import flash.media.*;
public dynamic class Fly extends Sound {
}
}//package
Section 154
//IntroAnimation (IntroAnimation)
package {
import flash.display.*;
public dynamic class IntroAnimation extends MovieClip {
}
}//package
Section 155
//IntroMusic (IntroMusic)
package {
import flash.media.*;
public dynamic class IntroMusic extends Sound {
}
}//package
Section 156
//Level1Nozzle (Level1Nozzle)
package {
import flash.display.*;
public dynamic class Level1Nozzle extends MovieClip {
}
}//package
Section 157
//Level2Nozzle (Level2Nozzle)
package {
import flash.display.*;
public dynamic class Level2Nozzle extends MovieClip {
}
}//package
Section 158
//Level3Nozzle (Level3Nozzle)
package {
import flash.display.*;
public dynamic class Level3Nozzle extends MovieClip {
}
}//package
Section 159
//Level4Nozzle (Level4Nozzle)
package {
import flash.display.*;
public dynamic class Level4Nozzle extends MovieClip {
}
}//package
Section 160
//LoseAnimation (LoseAnimation)
package {
import flash.display.*;
public dynamic class LoseAnimation extends MovieClip {
}
}//package
Section 161
//LoseMusic (LoseMusic)
package {
import flash.media.*;
public dynamic class LoseMusic extends Sound {
}
}//package
Section 162
//Meat (Meat)
package {
import flash.media.*;
public dynamic class Meat extends Sound {
}
}//package
Section 163
//MusicLevel0 (MusicLevel0)
package {
import flash.media.*;
public dynamic class MusicLevel0 extends Sound {
}
}//package
Section 164
//MusicLevel1 (MusicLevel1)
package {
import flash.media.*;
public dynamic class MusicLevel1 extends Sound {
}
}//package
Section 165
//MusicLevel2 (MusicLevel2)
package {
import flash.media.*;
public dynamic class MusicLevel2 extends Sound {
}
}//package
Section 166
//MusicLevel3 (MusicLevel3)
package {
import flash.media.*;
public dynamic class MusicLevel3 extends Sound {
}
}//package
Section 167
//MusicLevel4 (MusicLevel4)
package {
import flash.media.*;
public dynamic class MusicLevel4 extends Sound {
}
}//package
Section 168
//Nozzle1 (Nozzle1)
package {
import flash.media.*;
public dynamic class Nozzle1 extends Sound {
}
}//package
Section 169
//Nozzle2 (Nozzle2)
package {
import flash.media.*;
public dynamic class Nozzle2 extends Sound {
}
}//package
Section 170
//Nozzle3 (Nozzle3)
package {
import flash.media.*;
public dynamic class Nozzle3 extends Sound {
}
}//package
Section 171
//Nozzle4 (Nozzle4)
package {
import flash.media.*;
public dynamic class Nozzle4 extends Sound {
}
}//package
Section 172
//Panting (Panting)
package {
import flash.media.*;
public dynamic class Panting extends Sound {
}
}//package
Section 173
//PlayBtn (PlayBtn)
package {
import flash.display.*;
public dynamic class PlayBtn extends SimpleButton {
}
}//package
Section 174
//PlayerAvatar (PlayerAvatar)
package {
import flash.display.*;
public dynamic class PlayerAvatar extends MovieClip {
public var hitBox:MovieClip;
public function PlayerAvatar(){
addFrameScript(22, frame23, 33, frame34);
}
function frame23(){
stop();
}
function frame34(){
stop();
}
}
}//package
Section 175
//PreloaderSplat (PreloaderSplat)
package {
import flash.display.*;
public dynamic class PreloaderSplat extends MovieClip {
}
}//package
Section 176
//Puke (Puke)
package {
import flash.media.*;
public dynamic class Puke extends Sound {
}
}//package
Section 177
//Rat (Rat)
package {
import flash.media.*;
public dynamic class Rat extends Sound {
}
}//package
Section 178
//RobotEnter (RobotEnter)
package {
import flash.media.*;
public dynamic class RobotEnter extends Sound {
}
}//package
Section 179
//RobotMusic (RobotMusic)
package {
import flash.media.*;
public dynamic class RobotMusic extends Sound {
}
}//package
Section 180
//RobotShoot (RobotShoot)
package {
import flash.media.*;
public dynamic class RobotShoot extends Sound {
}
}//package
Section 181
//Soother (Soother)
package {
import flash.media.*;
public dynamic class Soother extends Sound {
}
}//package
Section 182
//Spider (Spider)
package {
import flash.media.*;
public dynamic class Spider extends Sound {
}
}//package
Section 183
//StillCheckingFeed (StillCheckingFeed)
package {
import flash.display.*;
public dynamic class StillCheckingFeed extends MovieClip {
}
}//package
Section 184
//Tick (Tick)
package {
import flash.media.*;
public dynamic class Tick extends Sound {
}
}//package
Section 185
//Tummy (Tummy)
package {
import flash.media.*;
public dynamic class Tummy extends Sound {
}
}//package
Section 186
//WinAnimation (WinAnimation)
package {
import flash.display.*;
public dynamic class WinAnimation extends MovieClip {
}
}//package
Section 187
//WinMusic (WinMusic)
package {
import flash.media.*;
public dynamic class WinMusic extends Sound {
}
}//package