Section 1
//AuxFunctions (caurina.transitions.AuxFunctions)
package caurina.transitions {
public class AuxFunctions {
public static function concatObjects(... _args):Object{
var _local2:Object;
var _local3:Object;
var _local4:int;
var _local5:String;
_local2 = {};
_local4 = 0;
while (_local4 < _args.length) {
_local3 = _args[_local4];
for (_local5 in _local3) {
if (_local3[_local5] == null){
delete _local2[_local5];
} else {
_local2[_local5] = _local3[_local5];
};
};
_local4++;
};
return (_local2);
}
public static function numberToG(_arg1:Number):Number{
return (((_arg1 & 0xFF00) >> 8));
}
public static function numberToR(_arg1:Number):Number{
return (((_arg1 & 0xFF0000) >> 16));
}
public static function isInArray(_arg1:String, _arg2:Array):Boolean{
var _local3:uint;
var _local4:uint;
_local3 = _arg2.length;
_local4 = 0;
while (_local4 < _local3) {
if (_arg2[_local4] == _arg1){
return (true);
};
_local4++;
};
return (false);
}
public static function getObjectLength(_arg1:Object):uint{
var _local2:uint;
var _local3:String;
_local2 = 0;
for (_local3 in _arg1) {
_local2++;
};
return (_local2);
}
public static function numberToB(_arg1:Number):Number{
return ((_arg1 & 0xFF));
}
}
}//package caurina.transitions
Section 2
//Equations (caurina.transitions.Equations)
package caurina.transitions {
public class Equations {
public function Equations(){
trace("Equations is a static class and should not be instantiated.");
}
public static function easeOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
if (_arg1 < (1 / 2.75)){
return (((_arg3 * ((7.5625 * _arg1) * _arg1)) + _arg2));
};
if (_arg1 < (2 / 2.75)){
_arg1 = (_arg1 - (1.5 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.75)) + _arg2));
};
if (_arg1 < (2.5 / 2.75)){
_arg1 = (_arg1 - (2.25 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.9375)) + _arg2));
};
_arg1 = (_arg1 - (2.625 / 2.75));
return (((_arg3 * (((7.5625 * _arg1) * _arg1) + 0.984375)) + _arg2));
}
public static function easeInOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number;
var _local7:Number;
var _local8:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
_local6 = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * (0.3 * 1.5)) : _arg5.period;
_local8 = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2));
};
--_arg1;
return ((((((_local8 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) * 0.5) + _arg3) + _arg2));
}
public static function easeInOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * _arg1) * _arg1) + _arg2));
};
--_arg1;
return ((((-(_arg3) / 2) * ((_arg1 * (_arg1 - 2)) - 1)) + _arg2));
}
public static function easeInOutBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (((easeInBounce((_arg1 * 2), 0, _arg3, _arg4) * 0.5) + _arg2));
};
return ((((easeOutBounce(((_arg1 * 2) - _arg4), 0, _arg3, _arg4) * 0.5) + (_arg3 * 0.5)) + _arg2));
}
public static function easeInOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number;
_local6 = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_local6 = (_local6 * 1.525);
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_local6 + 1) * _arg1) - _local6))) + _arg2));
};
_arg1 = (_arg1 - 2);
_local6 = (_local6 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_local6 + 1) * _arg1) + _local6)) + 2)) + _arg2));
}
public static function easeOutInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCubic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInCubic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeOutBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number;
_local6 = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_local6 + 1) * _arg1) + _local6)) + 1)) + _arg2));
}
public static function easeInOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((-(_arg3) / 2) * (Math.cos(((Math.PI * _arg1) / _arg4)) - 1)) + _arg2));
}
public static function easeInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number;
_local6 = (((!(Boolean(_arg5))) || (isNaN(_arg5.overshoot)))) ? 1.70158 : _arg5.overshoot;
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_local6 + 1) * _arg1) - _local6)) + _arg2));
}
public static function easeInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeOutInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuint((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuint(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBounce((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInBounce(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function init():void{
Tweener.registerTransition("easenone", easeNone);
Tweener.registerTransition("linear", easeNone);
Tweener.registerTransition("easeinquad", easeInQuad);
Tweener.registerTransition("easeoutquad", easeOutQuad);
Tweener.registerTransition("easeinoutquad", easeInOutQuad);
Tweener.registerTransition("easeoutinquad", easeOutInQuad);
Tweener.registerTransition("easeincubic", easeInCubic);
Tweener.registerTransition("easeoutcubic", easeOutCubic);
Tweener.registerTransition("easeinoutcubic", easeInOutCubic);
Tweener.registerTransition("easeoutincubic", easeOutInCubic);
Tweener.registerTransition("easeinquart", easeInQuart);
Tweener.registerTransition("easeoutquart", easeOutQuart);
Tweener.registerTransition("easeinoutquart", easeInOutQuart);
Tweener.registerTransition("easeoutinquart", easeOutInQuart);
Tweener.registerTransition("easeinquint", easeInQuint);
Tweener.registerTransition("easeoutquint", easeOutQuint);
Tweener.registerTransition("easeinoutquint", easeInOutQuint);
Tweener.registerTransition("easeoutinquint", easeOutInQuint);
Tweener.registerTransition("easeinsine", easeInSine);
Tweener.registerTransition("easeoutsine", easeOutSine);
Tweener.registerTransition("easeinoutsine", easeInOutSine);
Tweener.registerTransition("easeoutinsine", easeOutInSine);
Tweener.registerTransition("easeincirc", easeInCirc);
Tweener.registerTransition("easeoutcirc", easeOutCirc);
Tweener.registerTransition("easeinoutcirc", easeInOutCirc);
Tweener.registerTransition("easeoutincirc", easeOutInCirc);
Tweener.registerTransition("easeinexpo", easeInExpo);
Tweener.registerTransition("easeoutexpo", easeOutExpo);
Tweener.registerTransition("easeinoutexpo", easeInOutExpo);
Tweener.registerTransition("easeoutinexpo", easeOutInExpo);
Tweener.registerTransition("easeinelastic", easeInElastic);
Tweener.registerTransition("easeoutelastic", easeOutElastic);
Tweener.registerTransition("easeinoutelastic", easeInOutElastic);
Tweener.registerTransition("easeoutinelastic", easeOutInElastic);
Tweener.registerTransition("easeinback", easeInBack);
Tweener.registerTransition("easeoutback", easeOutBack);
Tweener.registerTransition("easeinoutback", easeInOutBack);
Tweener.registerTransition("easeoutinback", easeOutInBack);
Tweener.registerTransition("easeinbounce", easeInBounce);
Tweener.registerTransition("easeoutbounce", easeOutBounce);
Tweener.registerTransition("easeinoutbounce", easeInOutBounce);
Tweener.registerTransition("easeoutinbounce", easeOutInBounce);
}
public static function easeOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg1)==_arg4) ? (_arg2 + _arg3) : (((_arg3 * 1.001) * (-(Math.pow(2, ((-10 * _arg1) / _arg4))) + 1)) + _arg2));
}
public static function easeOutInBack(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutBack((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInBack(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg1)==0) ? _arg2 : (((_arg3 * Math.pow(2, (10 * ((_arg1 / _arg4) - 1)))) + _arg2) - (_arg3 * 0.001)));
}
public static function easeInCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((-(_arg3) / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)) + _arg2));
}
public static function easeInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((_arg3 * _arg1) * _arg1) + _arg2));
}
public static function easeInBounce(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg3 - easeOutBounce((_arg4 - _arg1), 0, _arg3, _arg4)) + _arg2));
}
public static function easeOutInExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutExpo((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInExpo(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((-(_arg3) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 1)) + _arg2));
}
public static function easeInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return ((((-(_arg3) * Math.cos(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg3) + _arg2));
}
public static function easeInOutQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((-(_arg3) / 2) * ((((_arg1 * _arg1) * _arg1) * _arg1) - 2)) + _arg2));
}
public static function easeOutQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
public static function easeOutInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutElastic((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInElastic(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number;
var _local7:Number;
var _local8:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
_local6 = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period;
_local8 = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
--_arg1;
return ((-(((_local8 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6)))) + _arg2));
}
public static function easeOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeOutInQuad(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuad((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuad(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
return (((_arg3 * Math.sin(((_arg1 / _arg4) * (Math.PI / 2)))) + _arg2));
}
public static function easeInOutCubic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * _arg1) + 2)) + _arg2));
}
public static function easeInOutQuint(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):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));
}
public static function easeInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = (_arg1 / _arg4);
return (((-(_arg3) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
}
public static function easeOutInSine(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutSine((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInSine(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeInOutExpo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 == 0){
return (_arg2);
};
if (_arg1 == _arg4){
return ((_arg2 + _arg3));
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return (((((_arg3 / 2) * Math.pow(2, (10 * (_arg1 - 1)))) + _arg2) - (_arg3 * 0.0005)));
};
--_arg1;
return (((((_arg3 / 2) * 1.0005) * (-(Math.pow(2, (-10 * _arg1))) + 2)) + _arg2));
}
public static function easeOutElastic(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
var _local6:Number;
var _local7:Number;
var _local8:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
_local6 = (((!(Boolean(_arg5))) || (isNaN(_arg5.period)))) ? (_arg4 * 0.3) : _arg5.period;
_local8 = (((!(Boolean(_arg5))) || (isNaN(_arg5.amplitude)))) ? 0 : _arg5.amplitude;
if (((!(Boolean(_local8))) || ((_local8 < Math.abs(_arg3))))){
_local8 = _arg3;
_local7 = (_local6 / 4);
} else {
_local7 = ((_local6 / (2 * Math.PI)) * Math.asin((_arg3 / _local8)));
};
return (((((_local8 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * (2 * Math.PI)) / _local6))) + _arg3) + _arg2));
}
public static function easeOutCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2));
}
public static function easeOutInQuart(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutQuart((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInQuart(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
public static function easeOutInCirc(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Object=null):Number{
if (_arg1 < (_arg4 / 2)){
return (easeOutCirc((_arg1 * 2), _arg2, (_arg3 / 2), _arg4, _arg5));
};
return (easeInCirc(((_arg1 * 2) - _arg4), (_arg2 + (_arg3 / 2)), (_arg3 / 2), _arg4, _arg5));
}
}
}//package caurina.transitions
Section 3
//PropertyInfoObj (caurina.transitions.PropertyInfoObj)
package caurina.transitions {
public class PropertyInfoObj {
public var originalValueComplete:Object;
public var modifierParameters:Array;
public var isSpecialProperty:Boolean;
public var hasModifier:Boolean;
public var valueComplete:Number;
public var extra:Object;
public var valueStart:Number;
public var modifierFunction:Function;
public var arrayIndex:Number;
public function PropertyInfoObj(_arg1:Number, _arg2:Number, _arg3:Object, _arg4:Number, _arg5:Object, _arg6:Boolean, _arg7:Function, _arg8:Array){
valueStart = _arg1;
valueComplete = _arg2;
originalValueComplete = _arg3;
arrayIndex = _arg4;
extra = _arg5;
isSpecialProperty = _arg6;
hasModifier = Boolean(_arg7);
modifierFunction = _arg7;
modifierParameters = _arg8;
}
public function toString():String{
var _local1:String;
_local1 = "\n[PropertyInfoObj ";
_local1 = (_local1 + ("valueStart:" + String(valueStart)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("valueComplete:" + String(valueComplete)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("originalValueComplete:" + String(originalValueComplete)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("arrayIndex:" + String(arrayIndex)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("extra:" + String(extra)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("isSpecialProperty:" + String(isSpecialProperty)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("hasModifier:" + String(hasModifier)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierFunction:" + String(modifierFunction)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("modifierParameters:" + String(modifierParameters)));
_local1 = (_local1 + "]\n");
return (_local1);
}
public function clone():PropertyInfoObj{
var _local1:PropertyInfoObj;
_local1 = new PropertyInfoObj(valueStart, valueComplete, originalValueComplete, arrayIndex, extra, isSpecialProperty, modifierFunction, modifierParameters);
return (_local1);
}
}
}//package caurina.transitions
Section 4
//SpecialProperty (caurina.transitions.SpecialProperty)
package caurina.transitions {
public class SpecialProperty {
public var parameters:Array;
public var preProcess:Function;
public var setValue:Function;
public var getValue:Function;
public function SpecialProperty(_arg1:Function, _arg2:Function, _arg3:Array=null, _arg4:Function=null){
getValue = _arg1;
setValue = _arg2;
parameters = _arg3;
preProcess = _arg4;
}
public function toString():String{
var _local1:String;
_local1 = "";
_local1 = (_local1 + "[SpecialProperty ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("setValue:" + String(setValue)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("parameters:" + String(parameters)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("preProcess:" + String(preProcess)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 5
//SpecialPropertyModifier (caurina.transitions.SpecialPropertyModifier)
package caurina.transitions {
public class SpecialPropertyModifier {
public var getValue:Function;
public var modifyValues:Function;
public function SpecialPropertyModifier(_arg1:Function, _arg2:Function){
modifyValues = _arg1;
getValue = _arg2;
}
public function toString():String{
var _local1:String;
_local1 = "";
_local1 = (_local1 + "[SpecialPropertyModifier ");
_local1 = (_local1 + ("modifyValues:" + String(modifyValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("getValue:" + String(getValue)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 6
//SpecialPropertySplitter (caurina.transitions.SpecialPropertySplitter)
package caurina.transitions {
public class SpecialPropertySplitter {
public var parameters:Array;
public var splitValues:Function;
public function SpecialPropertySplitter(_arg1:Function, _arg2:Array){
splitValues = _arg1;
parameters = _arg2;
}
public function toString():String{
var _local1:String;
_local1 = "";
_local1 = (_local1 + "[SpecialPropertySplitter ");
_local1 = (_local1 + ("splitValues:" + String(splitValues)));
_local1 = (_local1 + ", ");
_local1 = (_local1 + ("parameters:" + String(parameters)));
_local1 = (_local1 + "]");
return (_local1);
}
}
}//package caurina.transitions
Section 7
//Tweener (caurina.transitions.Tweener)
package caurina.transitions {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class Tweener {
private static var _timeScale:Number = 1;
private static var _currentTimeFrame:Number;
private static var _specialPropertySplitterList:Object;
private static var _engineExists:Boolean = false;
private static var _specialPropertyModifierList:Object;
private static var _currentTime:Number;
private static var _tweenList:Array;
private static var _specialPropertyList:Object;
private static var _transitionList:Object;
private static var _inited:Boolean = false;
private static var __tweener_controller__:MovieClip;
public function Tweener(){
trace("Tweener is a static class and should not be instantiated.");
}
public static function registerSpecialPropertyModifier(_arg1:String, _arg2:Function, _arg3:Function):void{
var _local4:SpecialPropertyModifier;
if (!_inited){
init();
};
_local4 = new SpecialPropertyModifier(_arg2, _arg3);
_specialPropertyModifierList[_arg1] = _local4;
}
public static function registerSpecialProperty(_arg1:String, _arg2:Function, _arg3:Function, _arg4:Array=null, _arg5:Function=null):void{
var _local6:SpecialProperty;
if (!_inited){
init();
};
_local6 = new SpecialProperty(_arg2, _arg3, _arg4, _arg5);
_specialPropertyList[_arg1] = _local6;
}
public static function init(... _args):void{
_inited = true;
_transitionList = new Object();
Equations.init();
_specialPropertyList = new Object();
_specialPropertyModifierList = new Object();
_specialPropertySplitterList = new Object();
}
private static function updateTweens():Boolean{
var _local1:int;
if (_tweenList.length == 0){
return (false);
};
_local1 = 0;
while (_local1 < _tweenList.length) {
if ((((_tweenList[_local1] == undefined)) || (!(_tweenList[_local1].isPaused)))){
if (!updateTweenByIndex(_local1)){
removeTweenByIndex(_local1);
};
if (_tweenList[_local1] == null){
removeTweenByIndex(_local1, true);
_local1--;
};
};
_local1++;
};
return (true);
}
public static function addCaller(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local3:Number;
var _local4:Array;
var _local5:Object;
var _local6:Number;
var _local7:Number;
var _local8:Function;
var _local9:TweenListObj;
var _local10:Number;
var _local11:String;
if (!Boolean(_arg1)){
return (false);
};
if ((_arg1 is Array)){
_local4 = _arg1.concat();
} else {
_local4 = [_arg1];
};
_local5 = _arg2;
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
_local6 = (isNaN(_local5.time)) ? 0 : _local5.time;
_local7 = (isNaN(_local5.delay)) ? 0 : _local5.delay;
if (typeof(_local5.transition) == "string"){
_local11 = _local5.transition.toLowerCase();
_local8 = _transitionList[_local11];
} else {
_local8 = _local5.transition;
};
if (!Boolean(_local8)){
_local8 = _transitionList["easeoutexpo"];
};
_local3 = 0;
while (_local3 < _local4.length) {
if (_local5.useFrames == true){
_local9 = new TweenListObj(_local4[_local3], (_currentTimeFrame + (_local7 / _timeScale)), (_currentTimeFrame + ((_local7 + _local6) / _timeScale)), true, _local8, _local5.transitionParams);
} else {
_local9 = new TweenListObj(_local4[_local3], (_currentTime + ((_local7 * 1000) / _timeScale)), (_currentTime + (((_local7 * 1000) + (_local6 * 1000)) / _timeScale)), false, _local8, _local5.transitionParams);
};
_local9.properties = null;
_local9.onStart = _local5.onStart;
_local9.onUpdate = _local5.onUpdate;
_local9.onComplete = _local5.onComplete;
_local9.onOverwrite = _local5.onOverwrite;
_local9.onStartParams = _local5.onStartParams;
_local9.onUpdateParams = _local5.onUpdateParams;
_local9.onCompleteParams = _local5.onCompleteParams;
_local9.onOverwriteParams = _local5.onOverwriteParams;
_local9.onStartScope = _local5.onStartScope;
_local9.onUpdateScope = _local5.onUpdateScope;
_local9.onCompleteScope = _local5.onCompleteScope;
_local9.onOverwriteScope = _local5.onOverwriteScope;
_local9.onErrorScope = _local5.onErrorScope;
_local9.isCaller = true;
_local9.count = _local5.count;
_local9.waitFrames = _local5.waitFrames;
_tweenList.push(_local9);
if ((((_local6 == 0)) && ((_local7 == 0)))){
_local10 = (_tweenList.length - 1);
updateTweenByIndex(_local10);
removeTweenByIndex(_local10);
};
_local3++;
};
return (true);
}
public static function pauseAllTweens():Boolean{
var _local1:Boolean;
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local1 = false;
_local2 = 0;
while (_local2 < _tweenList.length) {
pauseTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function removeTweens(_arg1:Object, ... _args):Boolean{
var _local3:Array;
var _local4:uint;
_local3 = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(removeTweenByIndex, _arg1, _local3));
}
public static function splitTweens(_arg1:Number, _arg2:Array):uint{
var _local3:TweenListObj;
var _local4:TweenListObj;
var _local5:uint;
var _local6:String;
var _local7:Boolean;
_local3 = _tweenList[_arg1];
_local4 = _local3.clone(false);
_local5 = 0;
while (_local5 < _arg2.length) {
_local6 = _arg2[_local5];
if (Boolean(_local3.properties[_local6])){
_local3.properties[_local6] = undefined;
delete _local3.properties[_local6];
};
_local5++;
};
for (_local6 in _local4.properties) {
_local7 = false;
_local5 = 0;
while (_local5 < _arg2.length) {
if (_arg2[_local5] == _local6){
_local7 = true;
break;
};
_local5++;
};
if (!_local7){
_local4.properties[_local6] = undefined;
delete _local4.properties[_local6];
};
};
_tweenList.push(_local4);
return ((_tweenList.length - 1));
}
public static function updateFrame():void{
_currentTimeFrame++;
}
public static function resumeTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj;
var _local3:Number;
_local2 = _tweenList[_arg1];
if ((((_local2 == null)) || (!(_local2.isPaused)))){
return (false);
};
_local3 = getCurrentTweeningTime(_local2);
_local2.timeStart = (_local2.timeStart + (_local3 - _local2.timePaused));
_local2.timeComplete = (_local2.timeComplete + (_local3 - _local2.timePaused));
_local2.timePaused = undefined;
_local2.isPaused = false;
return (true);
}
public static function getVersion():String{
return ("AS3 1.31.71");
}
public static function onEnterFrame(_arg1:Event):void{
var _local2:Boolean;
updateTime();
updateFrame();
_local2 = false;
_local2 = updateTweens();
if (!_local2){
stopEngine();
};
}
public static function updateTime():void{
_currentTime = getTimer();
}
private static function updateTweenByIndex(_arg1:Number):Boolean{
var tTweening:TweenListObj;
var isOver:Boolean;
var mustUpdate:Boolean;
var nv:Number;
var t:Number;
var b:Number;
var c:Number;
var d:Number;
var pName:String;
var eventScope:Object;
var tScope:Object;
var cTime:Number;
var tProperty:Object;
var pv:Number;
var i = _arg1;
tTweening = _tweenList[i];
if ((((tTweening == null)) || (!(Boolean(tTweening.scope))))){
return (false);
};
isOver = false;
cTime = getCurrentTweeningTime(tTweening);
if (cTime >= tTweening.timeStart){
tScope = tTweening.scope;
if (tTweening.isCaller){
do {
t = (((tTweening.timeComplete - tTweening.timeStart) / tTweening.count) * (tTweening.timesCalled + 1));
b = tTweening.timeStart;
c = (tTweening.timeComplete - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d);
} while (!(cTime >= nv));
} else {
mustUpdate = (((((tTweening.skipUpdates < 1)) || (!(tTweening.skipUpdates)))) || ((tTweening.updatesSkipped >= tTweening.skipUpdates)));
if (cTime >= tTweening.timeComplete){
isOver = true;
mustUpdate = true;
};
if (!tTweening.hasStarted){
if (Boolean(tTweening.onStart)){
eventScope = (Boolean(tTweening.onStartScope)) ? tTweening.onStartScope : tScope;
try {
tTweening.onStart.apply(eventScope, tTweening.onStartParams);
} catch(e:Error) {
handleError(tTweening, e, "onStart");
};
};
for (pName in tTweening.properties) {
if (tTweening.properties[pName].isSpecialProperty){
if (Boolean(_specialPropertyList[pName].preProcess)){
tTweening.properties[pName].valueComplete = _specialPropertyList[pName].preProcess(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].originalValueComplete, tTweening.properties[pName].extra);
};
pv = _specialPropertyList[pName].getValue(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
pv = tScope[pName];
};
tTweening.properties[pName].valueStart = (isNaN(pv)) ? tTweening.properties[pName].valueComplete : pv;
};
mustUpdate = true;
tTweening.hasStarted = true;
};
if (mustUpdate){
for (pName in tTweening.properties) {
tProperty = tTweening.properties[pName];
if (isOver){
nv = tProperty.valueComplete;
} else {
if (tProperty.hasModifier){
t = (cTime - tTweening.timeStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, 0, 1, d, tTweening.transitionParams);
nv = tProperty.modifierFunction(tProperty.valueStart, tProperty.valueComplete, nv, tProperty.modifierParameters);
} else {
t = (cTime - tTweening.timeStart);
b = tProperty.valueStart;
c = (tProperty.valueComplete - tProperty.valueStart);
d = (tTweening.timeComplete - tTweening.timeStart);
nv = tTweening.transition(t, b, c, d, tTweening.transitionParams);
};
};
if (tTweening.rounded){
nv = Math.round(nv);
};
if (tProperty.isSpecialProperty){
_specialPropertyList[pName].setValue(tScope, nv, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
} else {
tScope[pName] = nv;
};
};
tTweening.updatesSkipped = 0;
if (Boolean(tTweening.onUpdate)){
eventScope = (Boolean(tTweening.onUpdateScope)) ? tTweening.onUpdateScope : tScope;
try {
tTweening.onUpdate.apply(eventScope, tTweening.onUpdateParams);
} catch(e:Error) {
handleError(tTweening, e, "onUpdate");
};
};
} else {
tTweening.updatesSkipped++;
};
};
if (((isOver) && (Boolean(tTweening.onComplete)))){
eventScope = (Boolean(tTweening.onCompleteScope)) ? tTweening.onCompleteScope : tScope;
try {
tTweening.onComplete.apply(eventScope, tTweening.onCompleteParams);
} catch(e:Error) {
handleError(tTweening, e, "onComplete");
};
};
return (!(isOver));
};
return (true);
}
public static function setTimeScale(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (isNaN(_arg1)){
_arg1 = 1;
};
if (_arg1 < 1E-5){
_arg1 = 1E-5;
};
if (_arg1 != _timeScale){
if (_tweenList != null){
_local2 = 0;
while (_local2 < _tweenList.length) {
_local3 = getCurrentTweeningTime(_tweenList[_local2]);
_tweenList[_local2].timeStart = (_local3 - (((_local3 - _tweenList[_local2].timeStart) * _timeScale) / _arg1));
_tweenList[_local2].timeComplete = (_local3 - (((_local3 - _tweenList[_local2].timeComplete) * _timeScale) / _arg1));
if (_tweenList[_local2].timePaused != undefined){
_tweenList[_local2].timePaused = (_local3 - (((_local3 - _tweenList[_local2].timePaused) * _timeScale) / _arg1));
};
_local2++;
};
};
_timeScale = _arg1;
};
}
public static function resumeAllTweens():Boolean{
var _local1:Boolean;
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local1 = false;
_local2 = 0;
while (_local2 < _tweenList.length) {
resumeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
private static function handleError(_arg1:TweenListObj, _arg2:Error, _arg3:String):void{
var eventScope:Object;
var pTweening = _arg1;
var pError = _arg2;
var pCallBackName = _arg3;
if (((Boolean(pTweening.onError)) && ((pTweening.onError is Function)))){
eventScope = (Boolean(pTweening.onErrorScope)) ? pTweening.onErrorScope : pTweening.scope;
try {
pTweening.onError.apply(eventScope, [pTweening.scope, pError]);
} catch(metaError:Error) {
printError(((((String(pTweening.scope) + " raised an error while executing the 'onError' handler. Original error:\n ") + pError.getStackTrace()) + "\nonError error: ") + metaError.getStackTrace()));
};
} else {
if (!Boolean(pTweening.onError)){
printError(((((String(pTweening.scope) + " raised an error while executing the '") + pCallBackName) + "'handler. \n") + pError.getStackTrace()));
};
};
}
private static function startEngine():void{
_engineExists = true;
_tweenList = new Array();
__tweener_controller__ = new MovieClip();
__tweener_controller__.addEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
_currentTimeFrame = 0;
updateTime();
}
public static function removeAllTweens():Boolean{
var _local1:Boolean;
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local1 = false;
_local2 = 0;
while (_local2 < _tweenList.length) {
removeTweenByIndex(_local2);
_local1 = true;
_local2++;
};
return (_local1);
}
public static function addTween(_arg1:Object=null, _arg2:Object=null):Boolean{
var _local3:Number;
var _local4:Number;
var _local5:String;
var _local6:Array;
var _local7:Object;
var _local8:Number;
var _local9:Number;
var _local10:Array;
var _local11:Object;
var _local12:Object;
var _local13:Function;
var _local14:Object;
var _local15:TweenListObj;
var _local16:Number;
var _local17:Array;
var _local18:Array;
var _local19:Array;
var _local20:String;
if (!Boolean(_arg1)){
return (false);
};
if ((_arg1 is Array)){
_local6 = _arg1.concat();
} else {
_local6 = [_arg1];
};
_local7 = TweenListObj.makePropertiesChain(_arg2);
if (!_inited){
init();
};
if (((!(_engineExists)) || (!(Boolean(__tweener_controller__))))){
startEngine();
};
_local8 = (isNaN(_local7.time)) ? 0 : _local7.time;
_local9 = (isNaN(_local7.delay)) ? 0 : _local7.delay;
_local10 = new Array();
_local11 = {time:true, delay:true, useFrames:true, skipUpdates:true, transition:true, transitionParams:true, onStart:true, onUpdate:true, onComplete:true, onOverwrite:true, onError:true, rounded:true, onStartParams:true, onUpdateParams:true, onCompleteParams:true, onOverwriteParams:true, onStartScope:true, onUpdateScope:true, onCompleteScope:true, onOverwriteScope:true, onErrorScope:true};
_local12 = new Object();
for (_local5 in _local7) {
if (!_local11[_local5]){
if (_specialPropertySplitterList[_local5]){
_local17 = _specialPropertySplitterList[_local5].splitValues(_local7[_local5], _specialPropertySplitterList[_local5].parameters);
_local3 = 0;
while (_local3 < _local17.length) {
if (_specialPropertySplitterList[_local17[_local3].name]){
_local18 = _specialPropertySplitterList[_local17[_local3].name].splitValues(_local17[_local3].value, _specialPropertySplitterList[_local17[_local3].name].parameters);
_local4 = 0;
while (_local4 < _local18.length) {
_local10[_local18[_local4].name] = {valueStart:undefined, valueComplete:_local18[_local4].value, arrayIndex:_local18[_local4].arrayIndex, isSpecialProperty:false};
_local4++;
};
} else {
_local10[_local17[_local3].name] = {valueStart:undefined, valueComplete:_local17[_local3].value, arrayIndex:_local17[_local3].arrayIndex, isSpecialProperty:false};
};
_local3++;
};
} else {
if (_specialPropertyModifierList[_local5] != undefined){
_local19 = _specialPropertyModifierList[_local5].modifyValues(_local7[_local5]);
_local3 = 0;
while (_local3 < _local19.length) {
_local12[_local19[_local3].name] = {modifierParameters:_local19[_local3].parameters, modifierFunction:_specialPropertyModifierList[_local5].getValue};
_local3++;
};
} else {
_local10[_local5] = {valueStart:undefined, valueComplete:_local7[_local5]};
};
};
};
};
for (_local5 in _local10) {
if (_specialPropertyList[_local5] != undefined){
_local10[_local5].isSpecialProperty = true;
} else {
if (_local6[0][_local5] == undefined){
printError((((("The property '" + _local5) + "' doesn't seem to be a normal object property of ") + String(_local6[0])) + " or a registered special property."));
};
};
};
for (_local5 in _local12) {
if (_local10[_local5] != undefined){
_local10[_local5].modifierParameters = _local12[_local5].modifierParameters;
_local10[_local5].modifierFunction = _local12[_local5].modifierFunction;
};
};
if (typeof(_local7.transition) == "string"){
_local20 = _local7.transition.toLowerCase();
_local13 = _transitionList[_local20];
} else {
_local13 = _local7.transition;
};
if (!Boolean(_local13)){
_local13 = _transitionList["easeoutexpo"];
};
_local3 = 0;
while (_local3 < _local6.length) {
_local14 = new Object();
for (_local5 in _local10) {
_local14[_local5] = new PropertyInfoObj(_local10[_local5].valueStart, _local10[_local5].valueComplete, _local10[_local5].valueComplete, _local10[_local5].arrayIndex, {}, _local10[_local5].isSpecialProperty, _local10[_local5].modifierFunction, _local10[_local5].modifierParameters);
};
if (_local7.useFrames == true){
_local15 = new TweenListObj(_local6[_local3], (_currentTimeFrame + (_local9 / _timeScale)), (_currentTimeFrame + ((_local9 + _local8) / _timeScale)), true, _local13, _local7.transitionParams);
} else {
_local15 = new TweenListObj(_local6[_local3], (_currentTime + ((_local9 * 1000) / _timeScale)), (_currentTime + (((_local9 * 1000) + (_local8 * 1000)) / _timeScale)), false, _local13, _local7.transitionParams);
};
_local15.properties = _local14;
_local15.onStart = _local7.onStart;
_local15.onUpdate = _local7.onUpdate;
_local15.onComplete = _local7.onComplete;
_local15.onOverwrite = _local7.onOverwrite;
_local15.onError = _local7.onError;
_local15.onStartParams = _local7.onStartParams;
_local15.onUpdateParams = _local7.onUpdateParams;
_local15.onCompleteParams = _local7.onCompleteParams;
_local15.onOverwriteParams = _local7.onOverwriteParams;
_local15.onStartScope = _local7.onStartScope;
_local15.onUpdateScope = _local7.onUpdateScope;
_local15.onCompleteScope = _local7.onCompleteScope;
_local15.onOverwriteScope = _local7.onOverwriteScope;
_local15.onErrorScope = _local7.onErrorScope;
_local15.rounded = _local7.rounded;
_local15.skipUpdates = _local7.skipUpdates;
removeTweensByTime(_local15.scope, _local15.properties, _local15.timeStart, _local15.timeComplete);
_tweenList.push(_local15);
if ((((_local8 == 0)) && ((_local9 == 0)))){
_local16 = (_tweenList.length - 1);
updateTweenByIndex(_local16);
removeTweenByIndex(_local16);
};
_local3++;
};
return (true);
}
public static function registerTransition(_arg1:String, _arg2:Function):void{
if (!_inited){
init();
};
_transitionList[_arg1] = _arg2;
}
public static function printError(_arg1:String):void{
trace(("## [Tweener] Error: " + _arg1));
}
private static function affectTweens(_arg1:Function, _arg2:Object, _arg3:Array):Boolean{
var _local4:Boolean;
var _local5:uint;
var _local6:Array;
var _local7:uint;
var _local8:uint;
var _local9:uint;
_local4 = false;
if (!Boolean(_tweenList)){
return (false);
};
_local5 = 0;
while (_local5 < _tweenList.length) {
if (((_tweenList[_local5]) && ((_tweenList[_local5].scope == _arg2)))){
if (_arg3.length == 0){
_arg1(_local5);
_local4 = true;
} else {
_local6 = new Array();
_local7 = 0;
while (_local7 < _arg3.length) {
if (Boolean(_tweenList[_local5].properties[_arg3[_local7]])){
_local6.push(_arg3[_local7]);
};
_local7++;
};
if (_local6.length > 0){
_local8 = AuxFunctions.getObjectLength(_tweenList[_local5].properties);
if (_local8 == _local6.length){
_arg1(_local5);
_local4 = true;
} else {
_local9 = splitTweens(_local5, _local6);
_arg1(_local9);
_local4 = true;
};
};
};
};
_local5++;
};
return (_local4);
}
public static function getTweens(_arg1:Object):Array{
var _local2:uint;
var _local3:String;
var _local4:Array;
if (!Boolean(_tweenList)){
return ([]);
};
_local4 = new Array();
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
for (_local3 in _tweenList[_local2].properties) {
_local4.push(_local3);
};
};
_local2++;
};
return (_local4);
}
public static function isTweening(_arg1:Object):Boolean{
var _local2:uint;
if (!Boolean(_tweenList)){
return (false);
};
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
return (true);
};
_local2++;
};
return (false);
}
public static function pauseTweenByIndex(_arg1:Number):Boolean{
var _local2:TweenListObj;
_local2 = _tweenList[_arg1];
if ((((_local2 == null)) || (_local2.isPaused))){
return (false);
};
_local2.timePaused = getCurrentTweeningTime(_local2);
_local2.isPaused = true;
return (true);
}
public static function getCurrentTweeningTime(_arg1:Object):Number{
return ((_arg1.useFrames) ? _currentTimeFrame : _currentTime);
}
public static function getTweenCount(_arg1:Object):Number{
var _local2:uint;
var _local3:Number;
if (!Boolean(_tweenList)){
return (0);
};
_local3 = 0;
_local2 = 0;
while (_local2 < _tweenList.length) {
if (((Boolean(_tweenList[_local2])) && ((_tweenList[_local2].scope == _arg1)))){
_local3 = (_local3 + AuxFunctions.getObjectLength(_tweenList[_local2].properties));
};
_local2++;
};
return (_local3);
}
private static function stopEngine():void{
_engineExists = false;
_tweenList = null;
_currentTime = 0;
_currentTimeFrame = 0;
__tweener_controller__.removeEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
__tweener_controller__ = null;
}
public static function removeTweensByTime(_arg1:Object, _arg2:Object, _arg3:Number, _arg4:Number):Boolean{
var removed:Boolean;
var removedLocally:Boolean;
var i:uint;
var tl:uint;
var pName:String;
var eventScope:Object;
var p_scope = _arg1;
var p_properties = _arg2;
var p_timeStart = _arg3;
var p_timeComplete = _arg4;
removed = false;
tl = _tweenList.length;
i = 0;
while (i < tl) {
if (((Boolean(_tweenList[i])) && ((p_scope == _tweenList[i].scope)))){
if ((((p_timeComplete > _tweenList[i].timeStart)) && ((p_timeStart < _tweenList[i].timeComplete)))){
removedLocally = false;
for (pName in _tweenList[i].properties) {
if (Boolean(p_properties[pName])){
if (Boolean(_tweenList[i].onOverwrite)){
eventScope = (Boolean(_tweenList[i].onOverwriteScope)) ? _tweenList[i].onOverwriteScope : _tweenList[i].scope;
try {
_tweenList[i].onOverwrite.apply(eventScope, _tweenList[i].onOverwriteParams);
} catch(e:Error) {
handleError(_tweenList[i], e, "onOverwrite");
};
};
_tweenList[i].properties[pName] = undefined;
delete _tweenList[i].properties[pName];
removedLocally = true;
removed = true;
};
};
if (removedLocally){
if (AuxFunctions.getObjectLength(_tweenList[i].properties) == 0){
removeTweenByIndex(i);
};
};
};
};
i = (i + 1);
};
return (removed);
}
public static function registerSpecialPropertySplitter(_arg1:String, _arg2:Function, _arg3:Array=null):void{
var _local4:SpecialPropertySplitter;
if (!_inited){
init();
};
_local4 = new SpecialPropertySplitter(_arg2, _arg3);
_specialPropertySplitterList[_arg1] = _local4;
}
public static function removeTweenByIndex(_arg1:Number, _arg2:Boolean=false):Boolean{
_tweenList[_arg1] = null;
if (_arg2){
_tweenList.splice(_arg1, 1);
};
return (true);
}
public static function resumeTweens(_arg1:Object, ... _args):Boolean{
var _local3:Array;
var _local4:uint;
_local3 = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(resumeTweenByIndex, _arg1, _local3));
}
public static function pauseTweens(_arg1:Object, ... _args):Boolean{
var _local3:Array;
var _local4:uint;
_local3 = new Array();
_local4 = 0;
while (_local4 < _args.length) {
if ((((typeof(_args[_local4]) == "string")) && (!(AuxFunctions.isInArray(_args[_local4], _local3))))){
_local3.push(_args[_local4]);
};
_local4++;
};
return (affectTweens(pauseTweenByIndex, _arg1, _local3));
}
}
}//package caurina.transitions
Section 8
//TweenListObj (caurina.transitions.TweenListObj)
package caurina.transitions {
public class TweenListObj {
public var onUpdate:Function;
public var useFrames:Boolean;
public var hasStarted:Boolean;
public var onOverwriteParams:Array;
public var timeStart:Number;
public var count:Number;
public var timeComplete:Number;
public var onStartParams:Array;
public var onUpdateScope:Object;
public var rounded:Boolean;
public var onUpdateParams:Array;
public var properties:Object;
public var onComplete:Function;
public var transitionParams:Object;
public var updatesSkipped:Number;
public var onStart:Function;
public var onOverwriteScope:Object;
public var skipUpdates:Number;
public var onStartScope:Object;
public var scope:Object;
public var transition:Function;
public var timePaused:Number;
public var onCompleteParams:Array;
public var timesCalled:Number;
public var isCaller:Boolean;
public var onError:Function;
public var onErrorScope:Object;
public var onOverwrite:Function;
public var isPaused:Boolean;
public var waitFrames:Boolean;
public var onCompleteScope:Object;
public function TweenListObj(_arg1:Object, _arg2:Number, _arg3:Number, _arg4:Boolean, _arg5:Function, _arg6:Object){
scope = _arg1;
timeStart = _arg2;
timeComplete = _arg3;
useFrames = _arg4;
transition = _arg5;
transitionParams = _arg6;
properties = new Object();
isPaused = false;
timePaused = undefined;
isCaller = false;
updatesSkipped = 0;
timesCalled = 0;
skipUpdates = 0;
hasStarted = false;
}
public function clone(_arg1:Boolean):TweenListObj{
var _local2:TweenListObj;
var _local3:String;
_local2 = new TweenListObj(scope, timeStart, timeComplete, useFrames, transition, transitionParams);
_local2.properties = new Array();
for (_local3 in properties) {
_local2.properties[_local3] = properties[_local3].clone();
};
_local2.skipUpdates = skipUpdates;
_local2.updatesSkipped = updatesSkipped;
if (!_arg1){
_local2.onStart = onStart;
_local2.onUpdate = onUpdate;
_local2.onComplete = onComplete;
_local2.onOverwrite = onOverwrite;
_local2.onError = onError;
_local2.onStartParams = onStartParams;
_local2.onUpdateParams = onUpdateParams;
_local2.onCompleteParams = onCompleteParams;
_local2.onOverwriteParams = onOverwriteParams;
_local2.onStartScope = onStartScope;
_local2.onUpdateScope = onUpdateScope;
_local2.onCompleteScope = onCompleteScope;
_local2.onOverwriteScope = onOverwriteScope;
_local2.onErrorScope = onErrorScope;
};
_local2.rounded = rounded;
_local2.isPaused = isPaused;
_local2.timePaused = timePaused;
_local2.isCaller = isCaller;
_local2.count = count;
_local2.timesCalled = timesCalled;
_local2.waitFrames = waitFrames;
_local2.hasStarted = hasStarted;
return (_local2);
}
public function toString():String{
var _local1:String;
var _local2:Boolean;
var _local3:String;
_local1 = "\n[TweenListObj ";
_local1 = (_local1 + ("scope:" + String(scope)));
_local1 = (_local1 + ", properties:");
_local2 = true;
for (_local3 in properties) {
if (!_local2){
_local1 = (_local1 + ",");
};
_local1 = (_local1 + ("[name:" + properties[_local3].name));
_local1 = (_local1 + (",valueStart:" + properties[_local3].valueStart));
_local1 = (_local1 + (",valueComplete:" + properties[_local3].valueComplete));
_local1 = (_local1 + "]");
_local2 = false;
};
_local1 = (_local1 + (", timeStart:" + String(timeStart)));
_local1 = (_local1 + (", timeComplete:" + String(timeComplete)));
_local1 = (_local1 + (", useFrames:" + String(useFrames)));
_local1 = (_local1 + (", transition:" + String(transition)));
_local1 = (_local1 + (", transitionParams:" + String(transitionParams)));
if (skipUpdates){
_local1 = (_local1 + (", skipUpdates:" + String(skipUpdates)));
};
if (updatesSkipped){
_local1 = (_local1 + (", updatesSkipped:" + String(updatesSkipped)));
};
if (Boolean(onStart)){
_local1 = (_local1 + (", onStart:" + String(onStart)));
};
if (Boolean(onUpdate)){
_local1 = (_local1 + (", onUpdate:" + String(onUpdate)));
};
if (Boolean(onComplete)){
_local1 = (_local1 + (", onComplete:" + String(onComplete)));
};
if (Boolean(onOverwrite)){
_local1 = (_local1 + (", onOverwrite:" + String(onOverwrite)));
};
if (Boolean(onError)){
_local1 = (_local1 + (", onError:" + String(onError)));
};
if (onStartParams){
_local1 = (_local1 + (", onStartParams:" + String(onStartParams)));
};
if (onUpdateParams){
_local1 = (_local1 + (", onUpdateParams:" + String(onUpdateParams)));
};
if (onCompleteParams){
_local1 = (_local1 + (", onCompleteParams:" + String(onCompleteParams)));
};
if (onOverwriteParams){
_local1 = (_local1 + (", onOverwriteParams:" + String(onOverwriteParams)));
};
if (onStartScope){
_local1 = (_local1 + (", onStartScope:" + String(onStartScope)));
};
if (onUpdateScope){
_local1 = (_local1 + (", onUpdateScope:" + String(onUpdateScope)));
};
if (onCompleteScope){
_local1 = (_local1 + (", onCompleteScope:" + String(onCompleteScope)));
};
if (onOverwriteScope){
_local1 = (_local1 + (", onOverwriteScope:" + String(onOverwriteScope)));
};
if (onErrorScope){
_local1 = (_local1 + (", onErrorScope:" + String(onErrorScope)));
};
if (rounded){
_local1 = (_local1 + (", rounded:" + String(rounded)));
};
if (isPaused){
_local1 = (_local1 + (", isPaused:" + String(isPaused)));
};
if (timePaused){
_local1 = (_local1 + (", timePaused:" + String(timePaused)));
};
if (isCaller){
_local1 = (_local1 + (", isCaller:" + String(isCaller)));
};
if (count){
_local1 = (_local1 + (", count:" + String(count)));
};
if (timesCalled){
_local1 = (_local1 + (", timesCalled:" + String(timesCalled)));
};
if (waitFrames){
_local1 = (_local1 + (", waitFrames:" + String(waitFrames)));
};
if (hasStarted){
_local1 = (_local1 + (", hasStarted:" + String(hasStarted)));
};
_local1 = (_local1 + "]\n");
return (_local1);
}
public static function makePropertiesChain(_arg1:Object):Object{
var _local2:Object;
var _local3:Object;
var _local4:Object;
var _local5:Object;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local2 = _arg1.base;
if (_local2){
_local3 = {};
if ((_local2 is Array)){
_local4 = [];
_local8 = 0;
while (_local8 < _local2.length) {
_local4.push(_local2[_local8]);
_local8++;
};
} else {
_local4 = [_local2];
};
_local4.push(_arg1);
_local6 = _local4.length;
_local7 = 0;
while (_local7 < _local6) {
if (_local4[_local7]["base"]){
_local5 = AuxFunctions.concatObjects(makePropertiesChain(_local4[_local7]["base"]), _local4[_local7]);
} else {
_local5 = _local4[_local7];
};
_local3 = AuxFunctions.concatObjects(_local3, _local5);
_local7++;
};
if (_local3["base"]){
delete _local3["base"];
};
return (_local3);
//unresolved jump
};
return (_arg1);
}
}
}//package caurina.transitions
Section 9
//CampaignInfo (com.google.analytics.campaign.CampaignInfo)
package com.google.analytics.campaign {
import com.google.analytics.utils.*;
public class CampaignInfo {
private var _new:Boolean;
private var _empty:Boolean;
public function CampaignInfo(_arg1:Boolean=true, _arg2:Boolean=false){
_empty = _arg1;
_new = _arg2;
}
public function isEmpty():Boolean{
return (_empty);
}
public function toURLString():String{
var _local1:Variables;
_local1 = toVariables();
return (_local1.toString());
}
public function toVariables():Variables{
var _local1:Variables;
_local1 = new Variables();
_local1.URIencode = true;
if (((!(isEmpty())) && (isNew()))){
_local1.utmcn = utmcn;
};
if (((!(isEmpty())) && (!(isNew())))){
_local1.utmcr = utmcr;
};
return (_local1);
}
public function isNew():Boolean{
return (_new);
}
public function get utmcn():String{
return ("1");
}
public function get utmcr():String{
return ("1");
}
}
}//package com.google.analytics.campaign
Section 10
//CampaignKey (com.google.analytics.campaign.CampaignKey)
package com.google.analytics.campaign {
public class CampaignKey {
public var UCMD:String;// = "utm_medium"
public var UCID:String;// = "utm_id"
public var UCTR:String;// = "utm_term"
public var UCSR:String;// = "utm_source"
public var UCNO:String;// = "utm_nooverride"
public var UCCN:String;// = "utm_campaign"
public var UGCLID:String;// = "gclid"
public var UCCT:String;// = "utm_content"
}
}//package com.google.analytics.campaign
Section 11
//CampaignManager (com.google.analytics.campaign.CampaignManager)
package com.google.analytics.campaign {
import com.google.analytics.core.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import com.google.analytics.utils.*;
public class CampaignManager {
private var _config:Configuration;
private var _domainHash:Number;
private var _debug:DebugConfiguration;
private var _timeStamp:Number;
private var _referrer:String;
private var _buffer:Buffer;
public static const trackingDelimiter:String = "|";
public function CampaignManager(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:Buffer, _arg4:Number, _arg5:String, _arg6:Number){
_config = _arg1;
_debug = _arg2;
_buffer = _arg3;
_domainHash = _arg4;
_referrer = _arg5;
_timeStamp = _arg6;
}
public function hasNoOverride(_arg1:String):Boolean{
var _local2:CampaignKey;
var _local3:Variables;
var _local4:String;
_local2 = _config.campaignKey;
if (_arg1 == ""){
return (false);
};
_local3 = new Variables(_arg1);
_local4 = "";
if (_local3.hasOwnProperty(_local2.UCNO)){
_local4 = _local3[_local2.UCNO];
switch (_local4){
case "1":
return (true);
case "":
case "0":
default:
return (false);
};
};
return (false);
}
public function getCampaignInformation(_arg1:String, _arg2:Boolean):CampaignInfo{
var _local3:CampaignInfo;
var _local4:CampaignTracker;
var _local5:Boolean;
var _local6:Boolean;
var _local7:int;
var _local8:CampaignTracker;
var _local9:int;
_local3 = new CampaignInfo();
_local5 = false;
_local6 = false;
_local7 = 0;
if (((_config.allowLinker) && (_buffer.isGenuine()))){
if (!_buffer.hasUTMZ()){
return (_local3);
};
};
_local4 = getTrackerFromSearchString(_arg1);
if (isValid(_local4)){
_local6 = hasNoOverride(_arg1);
if (((_local6) && (!(_buffer.hasUTMZ())))){
return (_local3);
};
};
if (!isValid(_local4)){
_local4 = getOrganicCampaign();
if (((!(_buffer.hasUTMZ())) && (isIgnoredKeyword(_local4)))){
return (_local3);
};
};
if (((!(isValid(_local4))) && (_arg2))){
_local4 = getReferrerCampaign();
if (((!(_buffer.hasUTMZ())) && (isIgnoredReferral(_local4)))){
return (_local3);
};
};
if (!isValid(_local4)){
if (((!(_buffer.hasUTMZ())) && (_arg2))){
_local4 = getDirectCampaign();
};
};
if (!isValid(_local4)){
return (_local3);
};
if (((_buffer.hasUTMZ()) && (!(_buffer.utmz.isEmpty())))){
_local8 = new CampaignTracker();
_local8.fromTrackerString(_buffer.utmz.campaignTracking);
_local5 = (_local8.toTrackerString() == _local4.toTrackerString());
_local7 = _buffer.utmz.responseCount;
};
if (((!(_local5)) || (_arg2))){
_local9 = _buffer.utma.sessionCount;
_local7++;
if (_local9 == 0){
_local9 = 1;
};
_buffer.utmz.domainHash = _domainHash;
_buffer.utmz.campaignCreation = _timeStamp;
_buffer.utmz.campaignSessions = _local9;
_buffer.utmz.responseCount = _local7;
_buffer.utmz.campaignTracking = _local4.toTrackerString();
_debug.info(_buffer.utmz.toString(), VisualDebugMode.geek);
_local3 = new CampaignInfo(false, true);
} else {
_local3 = new CampaignInfo(false, false);
};
return (_local3);
}
public function isValid(_arg1:CampaignTracker):Boolean{
if (((_arg1) && (_arg1.isValid()))){
return (true);
};
return (false);
}
public function getTrackerFromSearchString(_arg1:String):CampaignTracker{
var _local2:CampaignTracker;
var _local3:CampaignTracker;
var _local4:CampaignKey;
var _local5:Variables;
_local2 = getOrganicCampaign();
_local3 = new CampaignTracker();
_local4 = _config.campaignKey;
if (_arg1 == ""){
return (_local3);
};
_local5 = new Variables(_arg1);
if (_local5.hasOwnProperty(_local4.UCID)){
_local3.id = _local5[_local4.UCID];
};
if (_local5.hasOwnProperty(_local4.UCSR)){
_local3.source = _local5[_local4.UCSR];
};
if (_local5.hasOwnProperty(_local4.UGCLID)){
_local3.clickId = _local5[_local4.UGCLID];
};
if (_local5.hasOwnProperty(_local4.UCCN)){
_local3.name = _local5[_local4.UCCN];
} else {
_local3.name = "(not set)";
};
if (_local5.hasOwnProperty(_local4.UCMD)){
_local3.medium = _local5[_local4.UCMD];
} else {
_local3.medium = "(not set)";
};
if (_local5.hasOwnProperty(_local4.UCTR)){
_local3.term = _local5[_local4.UCTR];
} else {
if (((_local2) && (!((_local2.term == ""))))){
_local3.term = _local2.term;
};
};
if (_local5.hasOwnProperty(_local4.UCCT)){
_local3.content = _local5[_local4.UCCT];
};
return (_local3);
}
public function getOrganicCampaign():CampaignTracker{
var _local1:CampaignTracker;
var _local2:URL;
var _local3:String;
var _local4:Array;
var _local5:OrganicReferrer;
var _local6:String;
if (((isInvalidReferrer(_referrer)) || (isFromGoogleCSE(_referrer, _config)))){
return (_local1);
};
_local2 = new URL(_referrer);
_local3 = "";
if (_local2.hostName != ""){
if (_local2.hostName.indexOf(".") > -1){
_local4 = _local2.hostName.split(".");
switch (_local4.length){
case 2:
_local3 = _local4[0];
break;
case 3:
_local3 = _local4[1];
break;
};
};
};
if (_config.organic.match(_local3)){
_local5 = _config.organic.getReferrerByName(_local3);
_local6 = _config.organic.getKeywordValue(_local5, _local2.search);
_local1 = new CampaignTracker();
_local1.source = _local5.engine;
_local1.name = "(organic)";
_local1.medium = "organic";
_local1.term = _local6;
};
return (_local1);
}
public function isIgnoredReferral(_arg1:CampaignTracker):Boolean{
if (((_arg1) && ((_arg1.medium == "referral")))){
return (_config.organic.isIgnoredReferral(_arg1.source));
};
return (false);
}
public function getDirectCampaign():CampaignTracker{
var _local1:CampaignTracker;
_local1 = new CampaignTracker();
_local1.source = "(direct)";
_local1.name = "(direct)";
_local1.medium = "(none)";
return (_local1);
}
public function isIgnoredKeyword(_arg1:CampaignTracker):Boolean{
if (((_arg1) && ((_arg1.medium == "organic")))){
return (_config.organic.isIgnoredKeyword(_arg1.term));
};
return (false);
}
public function getReferrerCampaign():CampaignTracker{
var _local1:CampaignTracker;
var _local2:URL;
var _local3:String;
var _local4:String;
if (((isInvalidReferrer(_referrer)) || (isFromGoogleCSE(_referrer, _config)))){
return (_local1);
};
_local2 = new URL(_referrer);
_local3 = _local2.hostName;
_local4 = _local2.path;
if (_local3.indexOf("www.") == 0){
_local3 = _local3.substr(4);
};
_local1 = new CampaignTracker();
_local1.source = _local3;
_local1.name = "(referral)";
_local1.medium = "referral";
_local1.content = _local4;
return (_local1);
}
public static function isInvalidReferrer(_arg1:String):Boolean{
var _local2:URL;
if ((((((_arg1 == "")) || ((_arg1 == "-")))) || ((_arg1 == "0")))){
return (true);
};
if (_arg1.indexOf("://") > -1){
_local2 = new URL(_arg1);
if ((((_local2.protocol == Protocols.file)) || ((_local2.protocol == Protocols.none)))){
return (true);
};
};
return (false);
}
public static function isFromGoogleCSE(_arg1:String, _arg2:Configuration):Boolean{
var _local3:URL;
_local3 = new URL(_arg1);
if (_local3.hostName.indexOf(_arg2.google) > -1){
if (_local3.search.indexOf((_arg2.googleSearchParam + "=")) > -1){
if (_local3.path == ("/" + _arg2.googleCsePath)){
return (true);
};
};
};
return (false);
}
}
}//package com.google.analytics.campaign
Section 12
//CampaignTracker (com.google.analytics.campaign.CampaignTracker)
package com.google.analytics.campaign {
import com.google.analytics.utils.*;
public class CampaignTracker {
public var content:String;
public var source:String;
public var clickId:String;
public var name:String;
public var term:String;
public var medium:String;
public var id:String;
public function CampaignTracker(_arg1:String="", _arg2:String="", _arg3:String="", _arg4:String="", _arg5:String="", _arg6:String="", _arg7:String=""){
this.id = _arg1;
this.source = _arg2;
this.clickId = _arg3;
this.name = _arg4;
this.medium = _arg5;
this.term = _arg6;
this.content = _arg7;
}
public function isValid():Boolean{
if (((((!((id == ""))) || (!((source == ""))))) || (!((clickId == ""))))){
return (true);
};
return (false);
}
public function toTrackerString():String{
var _local1:Array = [];
_addIfNotEmpty(_local1, "utmcsr=", source);
_addIfNotEmpty(_local1, "utmccn=", name);
_addIfNotEmpty(_local1, "utmcmd=", medium);
_addIfNotEmpty(_local1, "utmctr=", term);
_addIfNotEmpty(_local1, "utmcct=", content);
_addIfNotEmpty(_local1, "utmcid=", id);
_addIfNotEmpty(_local1, "utmgclid=", clickId);
return (_local1.join(CampaignManager.trackingDelimiter));
}
private function _addIfNotEmpty(_arg1:Array, _arg2:String, _arg3:String):void{
if (_arg3 != ""){
_arg3 = _arg3.split("+").join("%20");
_arg3 = _arg3.split(" ").join("%20");
_arg1.push((_arg2 + _arg3));
};
}
public function fromTrackerString(_arg1:String):void{
var _local2:String = _arg1.split(CampaignManager.trackingDelimiter).join("&");
var _local3:Variables = new Variables(_local2);
if (_local3.hasOwnProperty("utmcid")){
this.id = _local3["utmcid"];
};
if (_local3.hasOwnProperty("utmcsr")){
this.source = _local3["utmcsr"];
};
if (_local3.hasOwnProperty("utmccn")){
this.name = _local3["utmccn"];
};
if (_local3.hasOwnProperty("utmcmd")){
this.medium = _local3["utmcmd"];
};
if (_local3.hasOwnProperty("utmctr")){
this.term = _local3["utmctr"];
};
if (_local3.hasOwnProperty("utmcct")){
this.content = _local3["utmcct"];
};
if (_local3.hasOwnProperty("utmgclid")){
this.clickId = _local3["utmgclid"];
};
}
}
}//package com.google.analytics.campaign
Section 13
//FlashTracker (com.google.analytics.components.FlashTracker)
package com.google.analytics.components {
import com.google.analytics.core.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import flash.events.*;
import flash.display.*;
import com.google.analytics.utils.*;
import com.google.analytics.external.*;
import com.google.analytics.*;
import flash.utils.*;
import com.google.analytics.events.*;
public class FlashTracker extends Sprite implements AnalyticsTracker {
private var _adSense:AdSenseGlobals;
private var _env:Environment;
protected var _height:Number;// = 18
private var _idleTimer:IdleTimer;
private var _config:Configuration;
private var _mode:String;// = "AS3"
private var _dom:HTMLDOM;
private var _ready:Boolean;// = false
protected var _width:Number;// = 18
private var _account:String;// = ""
protected var _componentInspectorSetting:Boolean;
private var _visualDebug:Boolean;// = false
public var boundingBox_mc:DisplayObject;
private var _debug:DebugConfiguration;
private var _buffer:Buffer;
private var _display:DisplayObject;
protected var livePreviewHeight:Number;
private var _jsproxy:JavascriptProxy;
protected var isLivePreview:Boolean;
protected var preview:MovieClip;
private var _gifRequest:GIFRequest;
protected var livePreviewWidth:Number;
private var _tracker:GoogleAnalyticsAPI;
public static var version:Version = API.version;
public function FlashTracker(){
_ready = false;
_account = "";
_mode = TrackerMode.AS3;
_visualDebug = false;
_width = 18;
_height = 18;
super();
_tracker = new TrackerCache();
isLivePreview = _checkLivePreview();
_componentInspectorSetting = false;
if (boundingBox_mc){
boundingBox_mc.visible = false;
removeChild(boundingBox_mc);
boundingBox_mc = null;
};
if (isLivePreview){
_createLivePreview();
};
addEventListener(Event.ENTER_FRAME, _factory);
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
return (_tracker.trackEvent(_arg1, _arg2, _arg3, _arg4));
}
public function trackTrans():void{
_tracker.trackTrans();
}
private function _createLivePreview():void{
var _local1:Graphics;
var _local2:Class;
preview = new MovieClip();
_local1 = preview.graphics;
_local1.beginFill(0xFFFFFF);
_local1.moveTo(0, 0);
_local1.lineTo(0, _width);
_local1.lineTo(_width, _height);
_local1.lineTo(_height, 0);
_local1.lineTo(0, 0);
_local1.endFill();
_local2 = (getDefinitionByName("com.google.analytics.components::Icon") as Class);
preview.icon_mc = new (_local2);
preview.icon_mc.name = "icon_mc";
preview.addChild(preview.icon_mc);
addChild(preview);
}
public function trackPageview(_arg1:String=""):void{
_tracker.trackPageview(_arg1);
}
public function get account():String{
return (_account);
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
_tracker.linkByPost(_arg1, _arg2);
}
public function getDetectTitle():Boolean{
return (_tracker.getDetectTitle());
}
public function setCampNameKey(_arg1:String):void{
_tracker.setCampNameKey(_arg1);
}
public function resetSession():void{
_tracker.resetSession();
}
public function set account(_arg1:String):void{
_account = _arg1;
}
public function get debug():DebugConfiguration{
if (!_debug){
_createDebugAndConfig();
};
return (_debug);
}
public function createEventTracker(_arg1:String):EventTracker{
return (_tracker.createEventTracker(_arg1));
}
public function set config(_arg1:Configuration):void{
_config = _arg1;
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object{
return (_tracker.addTrans(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8));
}
public function setLocalServerMode():void{
_tracker.setLocalServerMode();
}
public function getLocalGifPath():String{
return (_tracker.getLocalGifPath());
}
public function clearIgnoredRef():void{
_tracker.clearIgnoredRef();
}
public function isReady():Boolean{
return (_ready);
}
public function set debug(_arg1:DebugConfiguration):void{
_debug = _arg1;
}
public function getVersion():String{
return (_tracker.getVersion());
}
public function setLocalRemoteServerMode():void{
_tracker.setLocalRemoteServerMode();
}
public function setCampNOKey(_arg1:String):void{
_tracker.setCampNOKey(_arg1);
}
public function addIgnoredOrganic(_arg1:String):void{
_tracker.addIgnoredOrganic(_arg1);
}
public function setCookiePath(_arg1:String):void{
_tracker.setCookiePath(_arg1);
}
public function setCampTermKey(_arg1:String):void{
_tracker.setCampTermKey(_arg1);
}
private function _trackerFactory():GoogleAnalyticsAPI{
debug.info(((("GATracker (AS3) v" + version) + "\naccount: ") + account));
_adSense = new AdSenseGlobals(debug);
_dom = new HTMLDOM(debug);
_dom.cacheProperties();
_env = new Environment("", "", "", debug, _dom);
_buffer = new Buffer(config, debug, false);
_gifRequest = new GIFRequest(config, debug, _buffer, _env);
_idleTimer = new IdleTimer(config, debug, _display, _buffer);
_env.url = _display.stage.loaderInfo.url;
return (new Tracker(account, config, debug, _env, _buffer, _gifRequest, _adSense));
}
public function setCampaignTrack(_arg1:Boolean):void{
_tracker.setCampaignTrack(_arg1);
}
public function getServiceMode():ServerOperationMode{
return (_tracker.getServiceMode());
}
public function set componentInspectorSetting(_arg1:Boolean):void{
_componentInspectorSetting = _arg1;
}
public function setSessionTimeout(_arg1:int):void{
_tracker.setSessionTimeout(_arg1);
}
public function setRemoteServerMode():void{
_tracker.setRemoteServerMode();
}
public function get visualDebug():Boolean{
return (_visualDebug);
}
public function addOrganic(_arg1:String, _arg2:String):void{
_tracker.addOrganic(_arg1, _arg2);
}
public function setCookieTimeout(_arg1:int):void{
_tracker.setCookieTimeout(_arg1);
}
public function getClientInfo():Boolean{
return (_tracker.getClientInfo());
}
public function setAllowLinker(_arg1:Boolean):void{
_tracker.setAllowLinker(_arg1);
}
public function setClientInfo(_arg1:Boolean):void{
_tracker.setClientInfo(_arg1);
}
private function _bridgeFactory():GoogleAnalyticsAPI{
debug.info(((("GATracker (Bridge) v" + version) + "\naccount: ") + account));
return (new Bridge(account, _debug, _jsproxy));
}
public function get config():Configuration{
if (!_config){
_createDebugAndConfig();
};
return (_config);
}
public function set mode(_arg1:String):void{
_mode = _arg1;
}
public function setDetectFlash(_arg1:Boolean):void{
_tracker.setDetectFlash(_arg1);
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
_tracker.addItem(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
public function setVar(_arg1:String):void{
_tracker.setVar(_arg1);
}
public function clearIgnoredOrganic():void{
_tracker.clearIgnoredOrganic();
}
public function setDomainName(_arg1:String):void{
_tracker.setDomainName(_arg1);
}
private function _checkLivePreview():Boolean{
if (((!((parent == null))) && ((getQualifiedClassName(parent) == "fl.livepreview::LivePreviewParent")))){
return (true);
};
return (false);
}
public function setCampSourceKey(_arg1:String):void{
_tracker.setCampSourceKey(_arg1);
}
public function setCampContentKey(_arg1:String):void{
_tracker.setCampContentKey(_arg1);
}
public function setSize(_arg1:Number, _arg2:Number):void{
}
public function setAllowAnchor(_arg1:Boolean):void{
_tracker.setAllowAnchor(_arg1);
}
public function setLocalGifPath(_arg1:String):void{
_tracker.setLocalGifPath(_arg1);
}
public function get mode():String{
return (_mode);
}
public function setSampleRate(_arg1:Number):void{
_tracker.setSampleRate(_arg1);
}
public function setAllowHash(_arg1:Boolean):void{
_tracker.setAllowHash(_arg1);
}
public function setDetectTitle(_arg1:Boolean):void{
_tracker.setDetectTitle(_arg1);
}
public function cookiePathCopy(_arg1:String):void{
_tracker.cookiePathCopy(_arg1);
}
private function _factory(_arg1:Event):void{
var _local2:GoogleAnalyticsAPI;
var _local3:TrackerCache;
removeEventListener(Event.ENTER_FRAME, _factory);
if (isLivePreview){
return;
};
_display = this;
_createDebugAndConfig();
if (visualDebug){
debug.layout = new Layout(debug, _display);
debug.active = visualDebug;
};
_jsproxy = new JavascriptProxy(debug);
_local3 = (_tracker as TrackerCache);
switch (mode){
case TrackerMode.BRIDGE:
_local2 = _bridgeFactory();
break;
case TrackerMode.AS3:
default:
_local2 = _trackerFactory();
};
if (!_local3.isEmpty()){
_local3.tracker = _local2;
_local3.flush();
};
_tracker = _local2;
_ready = true;
dispatchEvent(new AnalyticsEvent(AnalyticsEvent.READY, this));
}
public function getDetectFlash():Boolean{
return (_tracker.getDetectFlash());
}
public function clearOrganic():void{
_tracker.clearOrganic();
}
private function _createDebugAndConfig():void{
if (!_debug){
this.debug = new DebugConfiguration();
};
if (!_config){
this.config = new Configuration(debug);
};
}
public function addIgnoredRef(_arg1:String):void{
_tracker.addIgnoredRef(_arg1);
}
public function set visualDebug(_arg1:Boolean):void{
_visualDebug = _arg1;
}
public function setCampMediumKey(_arg1:String):void{
_tracker.setCampMediumKey(_arg1);
}
public function getAccount():String{
return (_tracker.getAccount());
}
public function link(_arg1:String, _arg2:Boolean=false):void{
_tracker.link(_arg1, _arg2);
}
}
var _local1:* = ServerOperationMode;
return (_local1);
}//package com.google.analytics.components
Section 14
//Icon (com.google.analytics.components.Icon)
package com.google.analytics.components {
import flash.display.*;
public dynamic class Icon extends MovieClip {
}
}//package com.google.analytics.components
Section 15
//BrowserInfo (com.google.analytics.core.BrowserInfo)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import com.google.analytics.utils.*;
public class BrowserInfo {
private var _config:Configuration;
private var _info:Environment;
public function BrowserInfo(_arg1:Configuration, _arg2:Environment){
_config = _arg1;
_info = _arg2;
}
public function get utmul():String{
return (_info.language.toLowerCase());
}
public function get utmje():String{
return ("0");
}
public function toURLString():String{
var _local1:Variables;
_local1 = toVariables();
return (_local1.toString());
}
public function get utmsr():String{
return (((_info.screenWidth + "x") + _info.screenHeight));
}
public function get utmcs():String{
return (_info.languageEncoding);
}
public function get utmfl():String{
var _local1:Version;
if (_config.detectFlash){
_local1 = _info.flashVersion;
return (((((_local1.major + ".") + _local1.minor) + " r") + _local1.build));
};
return ("-");
}
public function toVariables():Variables{
var _local1:Variables;
_local1 = new Variables();
_local1.URIencode = true;
_local1.utmcs = utmcs;
_local1.utmsr = utmsr;
_local1.utmsc = utmsc;
_local1.utmul = utmul;
_local1.utmje = utmje;
_local1.utmfl = utmfl;
return (_local1);
}
public function get utmsc():String{
return ((_info.screenColorDepth + "-bit"));
}
}
}//package com.google.analytics.core
Section 16
//Buffer (com.google.analytics.core.Buffer)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import flash.net.*;
import flash.events.*;
import com.google.analytics.data.*;
public dynamic class Buffer {
private var _SO:SharedObject;
private var _OBJ:Object;
private var _utma:UTMA;
private var _utmb:UTMB;
private var _utmc:UTMC;
private var _debug:DebugConfiguration;
private var _utmk:UTMK;
private var _config:Configuration;
private var _utmv:UTMV;
private var _utmz:UTMZ;
private var _volatile:Boolean;
public function Buffer(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:Boolean=false, _arg4:Object=null){
var _local5:Boolean;
var _local6:String;
super();
_config = _arg1;
_debug = _arg2;
UTMB.defaultTimespan = _config.sessionTimeout;
UTMZ.defaultTimespan = _config.conversionTimeout;
if (!_arg3){
_SO = SharedObject.getLocal(_config.cookieName, _config.cookiePath);
_local5 = false;
if (_SO.data.utma){
if (!hasUTMA()){
_createUMTA();
};
_utma.fromSharedObject(_SO.data.utma);
if (_debug.verbose){
_debug.info(("found: " + _utma.toString(true)), VisualDebugMode.geek);
};
if (_utma.isExpired()){
if (_debug.verbose){
_debug.warning("UTMA has expired", VisualDebugMode.advanced);
};
_clearUTMA();
_local5 = true;
};
};
if (_SO.data.utmb){
if (!hasUTMB()){
_createUMTB();
};
_utmb.fromSharedObject(_SO.data.utmb);
if (_debug.verbose){
_debug.info(("found: " + _utmb.toString(true)), VisualDebugMode.geek);
};
if (_utmb.isExpired()){
if (_debug.verbose){
_debug.warning("UTMB has expired", VisualDebugMode.advanced);
};
_clearUTMB();
_local5 = true;
};
};
if (_SO.data.utmc){
delete _SO.data.utmc;
_local5 = true;
};
if (_SO.data.utmk){
if (!hasUTMK()){
_createUMTK();
};
_utmk.fromSharedObject(_SO.data.utmk);
if (_debug.verbose){
_debug.info(("found: " + _utmk.toString()), VisualDebugMode.geek);
};
};
if (_SO.data.utmv){
if (!hasUTMV()){
_createUMTV();
};
_utmv.fromSharedObject(_SO.data.utmv);
if (_debug.verbose){
_debug.info(("found: " + _utmv.toString(true)), VisualDebugMode.geek);
};
if (_utmv.isExpired()){
if (_debug.verbose){
_debug.warning("UTMV has expired", VisualDebugMode.advanced);
};
_clearUTMV();
_local5 = true;
};
};
if (_SO.data.utmz){
if (!hasUTMZ()){
_createUMTZ();
};
_utmz.fromSharedObject(_SO.data.utmz);
if (_debug.verbose){
_debug.info(("found: " + _utmz.toString(true)), VisualDebugMode.geek);
};
if (_utmz.isExpired()){
if (_debug.verbose){
_debug.warning("UTMZ has expired", VisualDebugMode.advanced);
};
_clearUTMZ();
_local5 = true;
};
};
if (_local5){
save();
};
} else {
_OBJ = new Object();
if (_arg4){
for (_local6 in _arg4) {
_OBJ[_local6] = _arg4[_local6];
};
};
};
_volatile = _arg3;
}
public function clearCookies():void{
utma.reset();
utmb.reset();
utmc.reset();
utmz.reset();
utmv.reset();
utmk.reset();
}
public function save():void{
var flushStatus:String;
if (!isVolatile()){
flushStatus = null;
try {
flushStatus = _SO.flush();
} catch(e:Error) {
_debug.warning("Error...Could not write SharedObject to disk");
};
switch (flushStatus){
case SharedObjectFlushStatus.PENDING:
_debug.info("Requesting permission to save object...");
_SO.addEventListener(NetStatusEvent.NET_STATUS, _onFlushStatus);
break;
case SharedObjectFlushStatus.FLUSHED:
_debug.info("Value flushed to disk.");
break;
};
};
}
public function get utmv():UTMV{
if (!hasUTMV()){
_createUMTV();
};
return (_utmv);
}
public function get utmz():UTMZ{
if (!hasUTMZ()){
_createUMTZ();
};
return (_utmz);
}
public function hasUTMA():Boolean{
if (_utma){
return (true);
};
return (false);
}
public function hasUTMB():Boolean{
if (_utmb){
return (true);
};
return (false);
}
public function hasUTMC():Boolean{
if (_utmc){
return (true);
};
return (false);
}
public function isGenuine():Boolean{
if (!hasUTMK()){
return (true);
};
return ((utmk.hash == generateCookiesHash()));
}
public function resetCurrentSession():void{
_clearUTMB();
_clearUTMC();
save();
}
public function hasUTMK():Boolean{
if (_utmk){
return (true);
};
return (false);
}
public function generateCookiesHash():Number{
var _local1 = "";
_local1 = (_local1 + utma.valueOf());
_local1 = (_local1 + utmb.valueOf());
_local1 = (_local1 + utmc.valueOf());
_local1 = (_local1 + utmz.valueOf());
_local1 = (_local1 + utmv.valueOf());
return (Utils.generateHash(_local1));
}
private function _createUMTB():void{
_utmb = new UTMB();
_utmb.proxy = this;
}
private function _createUMTC():void{
_utmc = new UTMC();
}
private function _createUMTA():void{
_utma = new UTMA();
_utma.proxy = this;
}
public function hasUTMV():Boolean{
if (_utmv){
return (true);
};
return (false);
}
private function _createUMTK():void{
_utmk = new UTMK();
_utmk.proxy = this;
}
public function hasUTMZ():Boolean{
if (_utmz){
return (true);
};
return (false);
}
private function _createUMTV():void{
_utmv = new UTMV();
_utmv.proxy = this;
}
private function _onFlushStatus(_arg1:NetStatusEvent):void{
_debug.info("User closed permission dialog...");
switch (_arg1.info.code){
case "SharedObject.Flush.Success":
_debug.info("User granted permission -- value saved.");
break;
case "SharedObject.Flush.Failed":
_debug.info("User denied permission -- value not saved.");
break;
};
_SO.removeEventListener(NetStatusEvent.NET_STATUS, _onFlushStatus);
}
private function _createUMTZ():void{
_utmz = new UTMZ();
_utmz.proxy = this;
}
public function updateUTMA(_arg1:Number):void{
if (_debug.verbose){
_debug.info((("updateUTMA( " + _arg1) + " )"), VisualDebugMode.advanced);
};
if (!utma.isEmpty()){
if (isNaN(utma.sessionCount)){
utma.sessionCount = 1;
} else {
utma.sessionCount = (utma.sessionCount + 1);
};
utma.lastTime = utma.currentTime;
utma.currentTime = _arg1;
};
}
private function _clearUTMA():void{
_utma = null;
if (!isVolatile()){
_SO.data.utma = null;
delete _SO.data.utma;
};
}
private function _clearUTMC():void{
_utmc = null;
}
private function _clearUTMB():void{
_utmb = null;
if (!isVolatile()){
_SO.data.utmb = null;
delete _SO.data.utmb;
};
}
public function update(_arg1:String, _arg2):void{
if (isVolatile()){
_OBJ[_arg1] = _arg2;
} else {
_SO.data[_arg1] = _arg2;
};
}
private function _clearUTMZ():void{
_utmz = null;
if (!isVolatile()){
_SO.data.utmz = null;
delete _SO.data.utmz;
};
}
private function _clearUTMV():void{
_utmv = null;
if (!isVolatile()){
_SO.data.utmv = null;
delete _SO.data.utmv;
};
}
public function isVolatile():Boolean{
return (_volatile);
}
public function get utma():UTMA{
if (!hasUTMA()){
_createUMTA();
};
return (_utma);
}
public function get utmb():UTMB{
if (!hasUTMB()){
_createUMTB();
};
return (_utmb);
}
public function get utmc():UTMC{
if (!hasUTMC()){
_createUMTC();
};
return (_utmc);
}
public function get utmk():UTMK{
if (!hasUTMK()){
_createUMTK();
};
return (_utmk);
}
}
}//package com.google.analytics.core
Section 17
//DocumentInfo (com.google.analytics.core.DocumentInfo)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import com.google.analytics.utils.*;
import com.google.analytics.external.*;
public class DocumentInfo {
private var _config:Configuration;
private var _utmr:String;
private var _adSense:AdSenseGlobals;
private var _info:Environment;
private var _pageURL:String;
public function DocumentInfo(_arg1:Configuration, _arg2:Environment, _arg3:String, _arg4:String=null, _arg5:AdSenseGlobals=null){
_config = _arg1;
_info = _arg2;
_utmr = _arg3;
_pageURL = _arg4;
_adSense = _arg5;
}
public function get utmr():String{
if (!_utmr){
return ("-");
};
return (_utmr);
}
public function toURLString():String{
var _local1:Variables;
_local1 = toVariables();
return (_local1.toString());
}
private function _renderPageURL(_arg1:String=""):String{
var _local2:String;
var _local3:String;
_local2 = _info.locationPath;
_local3 = _info.locationSearch;
if (((!(_arg1)) || ((_arg1 == "")))){
_arg1 = (_local2 + unescape(_local3));
};
return (_arg1);
}
public function get utmp():String{
return (_renderPageURL(_pageURL));
}
private function _generateHitId():Number{
var _local1:Number;
if (((_adSense.hid) && (!((_adSense.hid == ""))))){
_local1 = Number(_adSense.hid);
} else {
_local1 = Math.round((Math.random() * 2147483647));
_adSense.hid = String(_local1);
};
return (_local1);
}
public function get utmhid():String{
return (String(_generateHitId()));
}
public function toVariables():Variables{
var _local1:Variables;
_local1 = new Variables();
_local1.URIencode = true;
if (((_config.detectTitle) && (!((utmdt == ""))))){
_local1.utmdt = utmdt;
};
_local1.utmhid = utmhid;
_local1.utmr = utmr;
_local1.utmp = utmp;
return (_local1);
}
public function get utmdt():String{
return (_info.documentTitle);
}
}
}//package com.google.analytics.core
Section 18
//Domain (com.google.analytics.core.Domain)
package com.google.analytics.core {
import com.google.analytics.debug.*;
public class Domain {
private var _mode:DomainNameMode;
private var _debug:DebugConfiguration;
private var _name:String;
public function Domain(_arg1:DomainNameMode=null, _arg2:String="", _arg3:DebugConfiguration=null){
_debug = _arg3;
if (_arg1 == null){
_arg1 = DomainNameMode.auto;
};
_mode = _arg1;
if (_arg1 == DomainNameMode.custom){
this.name = _arg2;
} else {
_name = _arg2;
};
}
public function get mode():DomainNameMode{
return (_mode);
}
public function set mode(_arg1:DomainNameMode):void{
_mode = _arg1;
if (_mode == DomainNameMode.none){
_name = "";
};
}
public function get name():String{
return (_name);
}
public function set name(_arg1:String):void{
if (((!((_arg1.charAt(0) == "."))) && (_debug))){
_debug.warning(("missing leading period \".\", cookie will only be accessible on " + _arg1), VisualDebugMode.geek);
};
_name = _arg1;
}
}
}//package com.google.analytics.core
Section 19
//DomainNameMode (com.google.analytics.core.DomainNameMode)
package com.google.analytics.core {
public class DomainNameMode {
private var _value:int;
private var _name:String;
public static const custom:DomainNameMode = new DomainNameMode(2, "custom");
;
public static const none:DomainNameMode = new DomainNameMode(0, "none");
;
public static const auto:DomainNameMode = new DomainNameMode(1, "auto");
;
public function DomainNameMode(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.core
Section 20
//EventInfo (com.google.analytics.core.EventInfo)
package com.google.analytics.core {
import com.google.analytics.data.*;
import com.google.analytics.utils.*;
public class EventInfo {
private var _isEventHit:Boolean;
private var _ext10:X10;
private var _x10:X10;
public function EventInfo(_arg1:Boolean, _arg2:X10, _arg3:X10=null){
_isEventHit = _arg1;
_x10 = _arg2;
_ext10 = _arg3;
}
public function toURLString():String{
var _local1:Variables;
_local1 = toVariables();
return (_local1.toString());
}
public function get utmt():String{
return ("event");
}
public function get utme():String{
return (_x10.renderMergedUrlString(_ext10));
}
public function toVariables():Variables{
var _local1:Variables;
_local1 = new Variables();
_local1.URIencode = true;
if (_isEventHit){
_local1.utmt = utmt;
};
_local1.utme = utme;
return (_local1);
}
}
}//package com.google.analytics.core
Section 21
//EventTracker (com.google.analytics.core.EventTracker)
package com.google.analytics.core {
import com.google.analytics.v4.*;
public class EventTracker {
private var _parent:GoogleAnalyticsAPI;
public var name:String;
public function EventTracker(_arg1:String, _arg2:GoogleAnalyticsAPI){
this.name = _arg1;
_parent = _arg2;
}
public function trackEvent(_arg1:String, _arg2:String=null, _arg3:Number=NaN):Boolean{
return (_parent.trackEvent(name, _arg1, _arg2, _arg3));
}
}
}//package com.google.analytics.core
Section 22
//ga_internal (com.google.analytics.core.ga_internal)
package com.google.analytics.core {
public namespace ga_internal;
}//package com.google.analytics.core
Section 23
//GIFRequest (com.google.analytics.core.GIFRequest)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import flash.net.*;
import flash.events.*;
import flash.display.*;
import com.google.analytics.utils.*;
import flash.system.*;
public class GIFRequest {
private var _info:Environment;
private var _count:int;
private var _utmac:String;
private var _alertcount:int;
private var _debug:DebugConfiguration;
private var _lastRequest:URLRequest;
private var _buffer:Buffer;
private var _config:Configuration;
private var _requests:Array;
public function GIFRequest(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:Buffer, _arg4:Environment){
_config = _arg1;
_debug = _arg2;
_buffer = _arg3;
_info = _arg4;
_count = 0;
_alertcount = 0;
_requests = [];
}
public function get utmn():String{
return ((Utils.generate32bitRandom() as String));
}
public function onIOError(_arg1:IOErrorEvent):void{
var _local2:String = _lastRequest.url;
var _local3:String = String((_requests.length - 1));
var _local4 = (("Gif Request #" + _local3) + " failed");
if (_debug.GIFRequests){
if (!_debug.verbose){
if (_local2.indexOf("?") > -1){
_local2 = _local2.split("?")[0];
};
_local2 = _shortenURL(_local2);
};
if (int(_debug.mode) > int(VisualDebugMode.basic)){
_local4 = (_local4 + ((" \"" + _local2) + "\" does not exists or is unreachable"));
};
_debug.failure(_local4);
} else {
_debug.warning(_local4);
};
_removeListeners(_arg1.target);
}
public function send(_arg1:String, _arg2:Variables=null, _arg3:Boolean=false, _arg4:Boolean=false):void{
var _local5:String;
var _local6:URLRequest;
var _local7:URLRequest;
_utmac = _arg1;
if (!_arg2){
_arg2 = new Variables();
};
_arg2.URIencode = false;
_arg2.pre = ["utmwv", "utmn", "utmhn", "utmt", "utme", "utmcs", "utmsr", "utmsc", "utmul", "utmje", "utmfl", "utmdt", "utmhid", "utmr", "utmp"];
_arg2.post = ["utmcc"];
if (_debug.verbose){
_debug.info(((("tracking: " + _buffer.utmb.trackCount) + "/") + _config.trackingLimitPerSession), VisualDebugMode.geek);
};
if ((((_buffer.utmb.trackCount < _config.trackingLimitPerSession)) || (_arg3))){
if (_arg4){
updateToken();
};
if (((((_arg3) || (!(_arg4)))) || ((_buffer.utmb.token >= 1)))){
if (((!(_arg3)) && (_arg4))){
_buffer.utmb.token = (_buffer.utmb.token - 1);
};
_buffer.utmb.trackCount = (_buffer.utmb.trackCount + 1);
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
};
_arg2.utmwv = utmwv;
_arg2.utmn = Utils.generate32bitRandom();
if (_info.domainName != ""){
_arg2.utmhn = _info.domainName;
};
if (_config.sampleRate < 1){
_arg2.utmsp = (_config.sampleRate * 100);
};
if ((((_config.serverMode == ServerOperationMode.local)) || ((_config.serverMode == ServerOperationMode.both)))){
_local5 = _info.locationSWFPath;
if (_local5.lastIndexOf("/") > 0){
_local5 = _local5.substring(0, _local5.lastIndexOf("/"));
};
_local6 = new URLRequest();
if (_config.localGIFpath.indexOf("http") == 0){
_local6.url = _config.localGIFpath;
} else {
_local6.url = (_local5 + _config.localGIFpath);
};
_local6.url = (_local6.url + ("?" + _arg2.toString()));
if (((_debug.active) && (_debug.GIFRequests))){
_debugSend(_local6);
} else {
sendRequest(_local6);
};
};
if ((((_config.serverMode == ServerOperationMode.remote)) || ((_config.serverMode == ServerOperationMode.both)))){
_local7 = new URLRequest();
if (_info.protocol == Protocols.HTTPS){
_local7.url = _config.secureRemoteGIFpath;
} else {
if (_info.protocol == Protocols.HTTP){
_local7.url = _config.remoteGIFpath;
} else {
_local7.url = _config.remoteGIFpath;
};
};
_arg2.utmac = utmac;
_arg2.utmcc = encodeURIComponent(utmcc);
_local7.url = (_local7.url + ("?" + _arg2.toString()));
if (((_debug.active) && (_debug.GIFRequests))){
_debugSend(_local7);
} else {
sendRequest(_local7);
};
};
};
};
}
public function onSecurityError(_arg1:SecurityErrorEvent):void{
if (_debug.GIFRequests){
_debug.failure(_arg1.text);
};
}
public function get utmsp():String{
return (((_config.sampleRate * 100) as String));
}
public function get utmcc():String{
var _local1:Array = [];
if (_buffer.hasUTMA()){
_local1.push((_buffer.utma.toURLString() + ";"));
};
if (_buffer.hasUTMZ()){
_local1.push((_buffer.utmz.toURLString() + ";"));
};
if (_buffer.hasUTMV()){
_local1.push((_buffer.utmv.toURLString() + ";"));
};
return (_local1.join("+"));
}
public function get utmac():String{
return (_utmac);
}
public function get utmwv():String{
return (_config.version);
}
public function sendRequest(_arg1:URLRequest):void{
var request = _arg1;
var loader:Loader = new Loader();
loader.name = String(_count++);
var context:LoaderContext = new LoaderContext(false);
loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
_lastRequest = request;
_requests[loader.name] = new RequestObject(request);
try {
loader.load(request, context);
} catch(e:Error) {
_debug.failure("\"Loader.load()\" could not instanciate Gif Request");
};
}
private function _removeListeners(_arg1:Object):void{
_arg1.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);
_arg1.removeEventListener(Event.COMPLETE, onComplete);
}
public function updateToken():void{
var _local2:Number;
var _local1:Number = new Date().getTime();
_local2 = ((_local1 - _buffer.utmb.lastTime) * (_config.tokenRate / 1000));
if (_debug.verbose){
_debug.info(("tokenDelta: " + _local2), VisualDebugMode.geek);
};
if (_local2 >= 1){
_buffer.utmb.token = Math.min(Math.floor((_buffer.utmb.token + _local2)), _config.bucketCapacity);
_buffer.utmb.lastTime = _local1;
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
};
};
}
public function get utmhn():String{
return (_info.domainName);
}
private function _shortenURL(_arg1:String):String{
var _local2:Array;
if (_arg1.length > 60){
_local2 = _arg1.split("/");
while (_arg1.length > 60) {
_local2.shift();
_arg1 = ("../" + _local2.join("/"));
};
};
return (_arg1);
}
private function _debugSend(_arg1:URLRequest):void{
var _local3:String;
var _local2 = "";
switch (_debug.mode){
case VisualDebugMode.geek:
_local2 = ((("Gif Request #" + _alertcount) + ":\n") + _arg1.url);
break;
case VisualDebugMode.advanced:
_local3 = _arg1.url;
if (_local3.indexOf("?") > -1){
_local3 = _local3.split("?")[0];
};
_local3 = _shortenURL(_local3);
_local2 = (((("Send Gif Request #" + _alertcount) + ":\n") + _local3) + " ?");
break;
case VisualDebugMode.basic:
default:
_local2 = (((("Send " + _config.serverMode.toString()) + " Gif Request #") + _alertcount) + " ?");
};
_debug.alertGifRequest(_local2, _arg1, this);
_alertcount++;
}
public function onComplete(_arg1:Event):void{
var _local2:String = _arg1.target.loader.name;
_requests[_local2].complete();
var _local3 = (("Gif Request #" + _local2) + " sent");
var _local4:String = _requests[_local2].request.url;
if (_debug.GIFRequests){
if (!_debug.verbose){
if (_local4.indexOf("?") > -1){
_local4 = _local4.split("?")[0];
};
_local4 = _shortenURL(_local4);
};
if (int(_debug.mode) > int(VisualDebugMode.basic)){
_local3 = (_local3 + ((" to \"" + _local4) + "\""));
};
_debug.success(_local3);
} else {
_debug.info(_local3);
};
_removeListeners(_arg1.target);
}
}
}//package com.google.analytics.core
Section 24
//IdleTimer (com.google.analytics.core.IdleTimer)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class IdleTimer {
private var _loop:Timer;
private var _stage:Stage;
private var _lastMove:int;
private var _debug:DebugConfiguration;
private var _session:Timer;
private var _inactivity:Number;
private var _buffer:Buffer;
public function IdleTimer(_arg1:Configuration, _arg2:DebugConfiguration, _arg3:DisplayObject, _arg4:Buffer){
var _local5:Number;
var _local6:Number;
var _local7:Number;
super();
_local5 = _arg1.idleLoop;
_local6 = _arg1.idleTimeout;
_local7 = _arg1.sessionTimeout;
_loop = new Timer((_local5 * 1000));
_session = new Timer((_local7 * 1000), 1);
_debug = _arg2;
_stage = _arg3.stage;
_buffer = _arg4;
_lastMove = getTimer();
_inactivity = (_local6 * 1000);
_loop.addEventListener(TimerEvent.TIMER, checkForIdle);
_session.addEventListener(TimerEvent.TIMER_COMPLETE, endSession);
_stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
_debug.info(((((("delay: " + _local5) + "sec , inactivity: ") + _local6) + "sec, sessionTimeout: ") + _local7), VisualDebugMode.geek);
_loop.start();
}
private function onMouseMove(_arg1:MouseEvent):void{
_lastMove = getTimer();
if (_session.running){
_debug.info("session timer reset", VisualDebugMode.geek);
_session.reset();
};
}
public function endSession(_arg1:TimerEvent):void{
_session.removeEventListener(TimerEvent.TIMER_COMPLETE, endSession);
_debug.info("session timer end session", VisualDebugMode.geek);
_session.reset();
_buffer.resetCurrentSession();
_debug.info(_buffer.utmb.toString(), VisualDebugMode.geek);
_debug.info(_buffer.utmc.toString(), VisualDebugMode.geek);
_session.addEventListener(TimerEvent.TIMER_COMPLETE, endSession);
}
public function checkForIdle(_arg1:TimerEvent):void{
var _local2:int;
_local2 = getTimer();
if ((_local2 - _lastMove) >= _inactivity){
if (!_session.running){
_debug.info("session timer start", VisualDebugMode.geek);
_session.start();
};
};
}
}
}//package com.google.analytics.core
Section 25
//Organic (com.google.analytics.core.Organic)
package com.google.analytics.core {
import com.google.analytics.utils.*;
public class Organic {
private var _sourcesCache:Array;
private var _sourcesEngine:Array;
private var _ignoredKeywords:Array;
private var _ignoredReferralsCache:Object;
private var _ignoredReferrals:Array;
private var _ignoredKeywordsCache:Object;
private var _sources:Array;
public static var throwErrors:Boolean = false;
public function Organic(){
_sources = [];
_sourcesCache = [];
_sourcesEngine = [];
_ignoredReferrals = [];
_ignoredReferralsCache = {};
_ignoredKeywords = [];
_ignoredKeywordsCache = {};
}
public function getKeywordValue(_arg1:OrganicReferrer, _arg2:String):String{
var _local3:String;
_local3 = _arg1.keyword;
return (getKeywordValueFromPath(_local3, _arg2));
}
public function isIgnoredKeyword(_arg1:String):Boolean{
if (_ignoredKeywordsCache.hasOwnProperty(_arg1)){
return (true);
};
return (false);
}
public function isIgnoredReferral(_arg1:String):Boolean{
if (_ignoredReferralsCache.hasOwnProperty(_arg1)){
return (true);
};
return (false);
}
public function clear():void{
clearEngines();
clearIgnoredReferrals();
clearIgnoredKeywords();
}
public function get ignoredKeywordsCount():int{
return (_ignoredKeywords.length);
}
public function match(_arg1:String):Boolean{
if (_arg1 == ""){
return (false);
};
_arg1 = _arg1.toLowerCase();
if (_sourcesEngine[_arg1] != undefined){
return (true);
};
return (false);
}
public function get count():int{
return (_sources.length);
}
public function addSource(_arg1:String, _arg2:String):void{
var _local3:OrganicReferrer;
_local3 = new OrganicReferrer(_arg1, _arg2);
if (_sourcesCache[_local3.toString()] == undefined){
_sources.push(_local3);
_sourcesCache[_local3.toString()] = (_sources.length - 1);
if (_sourcesEngine[_local3.engine] == undefined){
_sourcesEngine[_local3.engine] = [(_sources.length - 1)];
} else {
_sourcesEngine[_local3.engine].push((_sources.length - 1));
};
} else {
if (throwErrors){
throw (new Error((_local3.toString() + " already exists, we don't add it.")));
};
};
}
public function clearIgnoredKeywords():void{
_ignoredKeywords = [];
_ignoredKeywordsCache = {};
}
public function clearEngines():void{
_sources = [];
_sourcesCache = [];
_sourcesEngine = [];
}
public function get ignoredReferralsCount():int{
return (_ignoredReferrals.length);
}
public function addIgnoredReferral(_arg1:String):void{
if (_ignoredReferralsCache[_arg1] == undefined){
_ignoredReferrals.push(_arg1);
_ignoredReferralsCache[_arg1] = (_ignoredReferrals.length - 1);
} else {
if (throwErrors){
throw (new Error((("\"" + _arg1) + "\" already exists, we don't add it.")));
};
};
}
public function clearIgnoredReferrals():void{
_ignoredReferrals = [];
_ignoredReferralsCache = {};
}
public function getReferrerByName(_arg1:String):OrganicReferrer{
var _local2:int;
if (match(_arg1)){
_local2 = _sourcesEngine[_arg1][0];
return (_sources[_local2]);
};
return (null);
}
public function addIgnoredKeyword(_arg1:String):void{
if (_ignoredKeywordsCache[_arg1] == undefined){
_ignoredKeywords.push(_arg1);
_ignoredKeywordsCache[_arg1] = (_ignoredKeywords.length - 1);
} else {
if (throwErrors){
throw (new Error((("\"" + _arg1) + "\" already exists, we don't add it.")));
};
};
}
public function get sources():Array{
return (_sources);
}
public static function getKeywordValueFromPath(_arg1:String, _arg2:String):String{
var _local3:String;
var _local4:Variables;
if (_arg2.indexOf((_arg1 + "=")) > -1){
if (_arg2.charAt(0) == "?"){
_arg2 = _arg2.substr(1);
};
_arg2 = _arg2.split("+").join("%20");
_local4 = new Variables(_arg2);
_local3 = _local4[_arg1];
};
return (_local3);
}
}
}//package com.google.analytics.core
Section 26
//OrganicReferrer (com.google.analytics.core.OrganicReferrer)
package com.google.analytics.core {
public class OrganicReferrer {
private var _engine:String;
private var _keyword:String;
public function OrganicReferrer(_arg1:String, _arg2:String){
this.engine = _arg1;
this.keyword = _arg2;
}
public function set engine(_arg1:String):void{
_engine = _arg1.toLowerCase();
}
public function get keyword():String{
return (_keyword);
}
public function toString():String{
return (((engine + "?") + keyword));
}
public function get engine():String{
return (_engine);
}
public function set keyword(_arg1:String):void{
_keyword = _arg1.toLowerCase();
}
}
}//package com.google.analytics.core
Section 27
//RequestObject (com.google.analytics.core.RequestObject)
package com.google.analytics.core {
import flash.net.*;
import flash.utils.*;
public class RequestObject {
public var start:int;
public var request:URLRequest;
public var end:int;
public function RequestObject(_arg1:URLRequest){
start = getTimer();
this.request = _arg1;
}
public function toString():String{
var _local1:Array;
_local1 = [];
_local1.push((("duration: " + duration) + "ms"));
_local1.push(("url: " + request.url));
return ((("{ " + _local1.join(", ")) + " }"));
}
public function get duration():int{
if (!hasCompleted()){
return (0);
};
return ((end - start));
}
public function hasCompleted():Boolean{
return ((end > 0));
}
public function complete():void{
end = getTimer();
}
}
}//package com.google.analytics.core
Section 28
//ServerOperationMode (com.google.analytics.core.ServerOperationMode)
package com.google.analytics.core {
public class ServerOperationMode {
private var _value:int;
private var _name:String;
public static const both:ServerOperationMode = new ServerOperationMode(2, "both");
;
public static const remote:ServerOperationMode = new ServerOperationMode(1, "remote");
;
public static const local:ServerOperationMode = new ServerOperationMode(0, "local");
;
public function ServerOperationMode(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.core
Section 29
//TrackerCache (com.google.analytics.core.TrackerCache)
package com.google.analytics.core {
import com.google.analytics.v4.*;
import flash.errors.*;
public class TrackerCache implements GoogleAnalyticsAPI {
public var tracker:GoogleAnalyticsAPI;
private var _ar:Array;
public static var CACHE_THROW_ERROR:Boolean;
public function TrackerCache(_arg1:GoogleAnalyticsAPI=null){
this.tracker = _arg1;
_ar = [];
}
public function size():uint{
return (_ar.length);
}
public function flush():void{
var _local1:Object;
var _local2:String;
var _local3:Array;
var _local4:int;
var _local5:int;
if (tracker == null){
return;
};
if (size() > 0){
_local4 = _ar.length;
while (_local5 < _local4) {
_local1 = _ar.shift();
_local2 = (_local1.name as String);
_local3 = (_local1.args as Array);
if (((!((_local2 == null))) && ((_local2 in tracker)))){
(tracker[_local2] as Function).apply(tracker, _local3);
};
_local5++;
};
};
}
public function enqueue(_arg1:String, ... _args):Boolean{
if (_arg1 == null){
return (false);
};
_ar.push({name:_arg1, args:_args});
return (true);
}
public function link(_arg1:String, _arg2:Boolean=false):void{
enqueue("link", _arg1, _arg2);
}
public function addOrganic(_arg1:String, _arg2:String):void{
enqueue("addOrganic", _arg1, _arg2);
}
public function setAllowLinker(_arg1:Boolean):void{
enqueue("setAllowLinker", _arg1);
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
enqueue("trackEvent", _arg1, _arg2, _arg3, _arg4);
return (true);
}
public function getClientInfo():Boolean{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getClientInfo' method for the moment."));
};
return (false);
}
public function trackTrans():void{
enqueue("trackTrans");
}
public function trackPageview(_arg1:String=""):void{
enqueue("trackPageview", _arg1);
}
public function setClientInfo(_arg1:Boolean):void{
enqueue("setClientInfo", _arg1);
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
enqueue("linkByPost", _arg1, _arg2);
}
public function setCookieTimeout(_arg1:int):void{
enqueue("setCookieTimeout", _arg1);
}
public function isEmpty():Boolean{
return ((_ar.length == 0));
}
public function getDetectTitle():Boolean{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getDetectTitle' method for the moment."));
};
return (false);
}
public function resetSession():void{
enqueue("resetSession");
}
public function setDetectFlash(_arg1:Boolean):void{
enqueue("setDetectFlash", _arg1);
}
public function clear():void{
_ar = [];
}
public function setCampNameKey(_arg1:String):void{
enqueue("setCampNameKey", _arg1);
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
enqueue("addItem", _arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
public function createEventTracker(_arg1:String):EventTracker{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'createEventTracker' method for the moment."));
};
return (null);
}
public function setVar(_arg1:String):void{
enqueue("setVar", _arg1);
}
public function clearIgnoredOrganic():void{
enqueue("clearIgnoredOrganic");
}
public function setDomainName(_arg1:String):void{
enqueue("setDomainName", _arg1);
}
public function setCampSourceKey(_arg1:String):void{
enqueue("setCampSourceKey", _arg1);
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'addTrans' method for the moment."));
};
return (null);
}
public function setCampContentKey(_arg1:String):void{
enqueue("setCampContentKey", _arg1);
}
public function setLocalServerMode():void{
enqueue("setLocalServerMode");
}
public function getLocalGifPath():String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getLocalGifPath' method for the moment."));
};
return ("");
}
public function setAllowAnchor(_arg1:Boolean):void{
enqueue("setAllowAnchor", _arg1);
}
public function clearIgnoredRef():void{
enqueue("clearIgnoredRef");
}
public function setLocalGifPath(_arg1:String):void{
enqueue("setLocalGifPath", _arg1);
}
public function getVersion():String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getVersion' method for the moment."));
};
return ("");
}
public function setCookiePath(_arg1:String):void{
enqueue("setCookiePath", _arg1);
}
public function setSampleRate(_arg1:Number):void{
enqueue("setSampleRate", _arg1);
}
public function setDetectTitle(_arg1:Boolean):void{
enqueue("setDetectTitle", _arg1);
}
public function setAllowHash(_arg1:Boolean):void{
enqueue("setAllowHash", _arg1);
}
public function addIgnoredOrganic(_arg1:String):void{
enqueue("addIgnoredOrganic", _arg1);
}
public function setCampNOKey(_arg1:String):void{
enqueue("setCampNOKey", _arg1);
}
public function getServiceMode():ServerOperationMode{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getServiceMode' method for the moment."));
};
return (null);
}
public function setLocalRemoteServerMode():void{
enqueue("setLocalRemoteServerMode");
}
public function cookiePathCopy(_arg1:String):void{
enqueue("cookiePathCopy", _arg1);
}
public function getDetectFlash():Boolean{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getDetectFlash' method for the moment."));
};
return (false);
}
public function setCampaignTrack(_arg1:Boolean):void{
enqueue("setCampaignTrack", _arg1);
}
public function clearOrganic():void{
enqueue("clearOrganic");
}
public function setCampTermKey(_arg1:String):void{
enqueue("setCampTermKey", _arg1);
}
public function addIgnoredRef(_arg1:String):void{
enqueue("addIgnoredRef", _arg1);
}
public function setCampMediumKey(_arg1:String):void{
enqueue("setCampMediumKey", _arg1);
}
public function setSessionTimeout(_arg1:int):void{
enqueue("setSessionTimeout", _arg1);
}
public function setRemoteServerMode():void{
enqueue("setRemoteServerMode");
}
public function element(){
return (_ar[0]);
}
public function getAccount():String{
if (CACHE_THROW_ERROR){
throw (new IllegalOperationError("The tracker is not ready and you can use the 'getAccount' method for the moment."));
};
return ("");
}
}
}//package com.google.analytics.core
Section 30
//TrackerMode (com.google.analytics.core.TrackerMode)
package com.google.analytics.core {
public class TrackerMode {
public static const BRIDGE:String = "Bridge";
public static const AS3:String = "AS3";
}
}//package com.google.analytics.core
Section 31
//Utils (com.google.analytics.core.Utils)
package com.google.analytics.core {
public class Utils {
public static function trim(_arg1:String, _arg2:Boolean=false):String{
var _local3:Array;
var _local4:String;
var _local5:int;
var _local6:int;
var _local7:int;
if (_arg1 == ""){
return ("");
};
_local3 = [" ", "\n", "\r", "\t"];
_local4 = _arg1;
if (_arg2){
_local5 = 0;
while ((((_local5 < _local3.length)) && ((_local4.indexOf(_local3[_local5]) > -1)))) {
_local4 = _local4.split(_local3[_local5]).join("");
_local5++;
};
} else {
_local6 = 0;
while ((((_local6 < _local4.length)) && ((_local3.indexOf(_local4.charAt(_local6)) > -1)))) {
_local6++;
};
_local4 = _local4.substr(_local6);
_local7 = (_local4.length - 1);
while ((((_local7 >= 0)) && ((_local3.indexOf(_local4.charAt(_local7)) > -1)))) {
_local7--;
};
_local4 = _local4.substring(0, (_local7 + 1));
};
return (_local4);
}
public static function generateHash(_arg1:String):int{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = 1;
_local3 = 0;
if (((!((_arg1 == null))) && (!((_arg1 == ""))))){
_local2 = 0;
_local4 = (_arg1.length - 1);
while (_local4 >= 0) {
_local5 = _arg1.charCodeAt(_local4);
_local2 = ((((_local2 << 6) & 268435455) + _local5) + (_local5 << 14));
_local3 = (_local2 & 266338304);
if (_local3 != 0){
_local2 = (_local2 ^ (_local3 >> 21));
};
_local4--;
};
};
return (_local2);
}
public static function generate32bitRandom():int{
return (Math.round((Math.random() * 2147483647)));
}
public static function validateAccount(_arg1:String):Boolean{
var _local2:RegExp;
_local2 = /^UA-[0-9]*-[0-9]*$/;
return (_local2.test(_arg1));
}
}
}//package com.google.analytics.core
Section 32
//Cookie (com.google.analytics.data.Cookie)
package com.google.analytics.data {
public interface Cookie {
function fromSharedObject(_arg1:Object):void;
function toURLString():String;
function get creation():Date;
function toSharedObject():Object;
function isExpired():Boolean;
function set creation(_arg1:Date):void;
function set expiration(_arg1:Date):void;
function get expiration():Date;
}
}//package com.google.analytics.data
Section 33
//UTMA (com.google.analytics.data.UTMA)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMA extends UTMCookie {
private var _sessionId:Number;
private var _domainHash:Number;
private var _firstTime:Number;
private var _currentTime:Number;
private var _lastTime:Number;
private var _sessionCount:Number;
public function UTMA(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Number=NaN, _arg5:Number=NaN, _arg6:Number=NaN){
super("utma", "__utma", ["domainHash", "sessionId", "firstTime", "lastTime", "currentTime", "sessionCount"], (Timespan.twoyears * 1000));
this.domainHash = _arg1;
this.sessionId = _arg2;
this.firstTime = _arg3;
this.lastTime = _arg4;
this.currentTime = _arg5;
this.sessionCount = _arg6;
}
public function get lastTime():Number{
return (_lastTime);
}
public function set lastTime(_arg1:Number):void{
_lastTime = _arg1;
update();
}
public function set currentTime(_arg1:Number):void{
_currentTime = _arg1;
update();
}
public function get sessionId():Number{
return (_sessionId);
}
public function get sessionCount():Number{
return (_sessionCount);
}
public function get firstTime():Number{
return (_firstTime);
}
public function get currentTime():Number{
return (_currentTime);
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set sessionId(_arg1:Number):void{
_sessionId = _arg1;
update();
}
public function set sessionCount(_arg1:Number):void{
_sessionCount = _arg1;
update();
}
public function get domainHash():Number{
return (_domainHash);
}
public function set firstTime(_arg1:Number):void{
_firstTime = _arg1;
update();
}
}
}//package com.google.analytics.data
Section 34
//UTMB (com.google.analytics.data.UTMB)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMB extends UTMCookie {
private var _trackCount:Number;
private var _lastTime:Number;
private var _domainHash:Number;
private var _token:Number;
public static var defaultTimespan:Number = Timespan.thirtyminutes;
public function UTMB(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Number=NaN){
super("utmb", "__utmb", ["domainHash", "trackCount", "token", "lastTime"], (defaultTimespan * 1000));
this.domainHash = _arg1;
this.trackCount = _arg2;
this.token = _arg3;
this.lastTime = _arg4;
}
public function set token(_arg1:Number):void{
_token = _arg1;
update();
}
public function set trackCount(_arg1:Number):void{
_trackCount = _arg1;
update();
}
public function get lastTime():Number{
return (_lastTime);
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set lastTime(_arg1:Number):void{
_lastTime = _arg1;
update();
}
public function get domainHash():Number{
return (_domainHash);
}
public function get token():Number{
return (_token);
}
public function get trackCount():Number{
return (_trackCount);
}
}
}//package com.google.analytics.data
Section 35
//UTMC (com.google.analytics.data.UTMC)
package com.google.analytics.data {
public class UTMC extends UTMCookie {
private var _domainHash:Number;
public function UTMC(_arg1:Number=NaN){
super("utmc", "__utmc", ["domainHash"]);
this.domainHash = _arg1;
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function get domainHash():Number{
return (_domainHash);
}
}
}//package com.google.analytics.data
Section 36
//UTMCookie (com.google.analytics.data.UTMCookie)
package com.google.analytics.data {
import com.google.analytics.core.*;
public class UTMCookie implements Cookie {
protected var inURL:String;
protected var name:String;
private var _creation:Date;
private var _expiration:Date;
public var proxy:Buffer;
private var _timespan:Number;
protected var fields:Array;
public function UTMCookie(_arg1:String, _arg2:String, _arg3:Array, _arg4:Number=0){
this.name = _arg1;
this.inURL = _arg2;
this.fields = _arg3;
_timestamp(_arg4);
}
public function isEmpty():Boolean{
var _local1:int;
var _local2:String;
var _local3:int;
_local1 = 0;
_local3 = 0;
while (_local3 < fields.length) {
_local2 = fields[_local3];
if ((((this[_local2] is Number)) && (isNaN(this[_local2])))){
_local1++;
} else {
if ((((this[_local2] is String)) && ((this[_local2] == "")))){
_local1++;
};
};
_local3++;
};
if (_local1 == fields.length){
return (true);
};
return (false);
}
protected function update():void{
resetTimestamp();
if (proxy){
proxy.update(name, toSharedObject());
};
}
public function fromSharedObject(_arg1:Object):void{
var _local2:String;
var _local3:int;
var _local4:int;
_local3 = fields.length;
_local4 = 0;
while (_local4 < _local3) {
_local2 = fields[_local4];
if (_arg1[_local2]){
this[_local2] = _arg1[_local2];
};
_local4++;
};
if (_arg1.creation){
this.creation = _arg1.creation;
};
if (_arg1.expiration){
this.expiration = _arg1.expiration;
};
}
private function _timestamp(_arg1:Number):void{
creation = new Date();
_timespan = _arg1;
if (_arg1 > 0){
expiration = new Date((creation.valueOf() + _arg1));
};
}
public function isExpired():Boolean{
var _local1:Date;
var _local2:Number;
_local1 = new Date();
_local2 = (expiration.valueOf() - _local1.valueOf());
if (_local2 <= 0){
return (true);
};
return (false);
}
public function set expiration(_arg1:Date):void{
_expiration = _arg1;
}
public function get creation():Date{
return (_creation);
}
public function reset():void{
var _local1:String;
var _local2:int;
_local2 = 0;
while (_local2 < fields.length) {
_local1 = fields[_local2];
if ((this[_local1] is Number)){
this[_local1] = NaN;
} else {
if ((this[_local1] is String)){
this[_local1] = "";
};
};
_local2++;
};
resetTimestamp();
update();
}
public function valueOf():String{
var _local1:Array;
var _local2:String;
var _local3:*;
var _local4:int;
_local1 = [];
_local4 = 0;
while (_local4 < fields.length) {
_local2 = fields[_local4];
_local3 = this[_local2];
if ((_local3 is String)){
if (_local3 == ""){
_local3 = "-";
_local1.push(_local3);
} else {
_local1.push(_local3);
};
} else {
if ((_local3 is Number)){
if (_local3 == 0){
_local1.push(_local3);
} else {
if (isNaN(_local3)){
_local3 = "-";
_local1.push(_local3);
} else {
_local1.push(_local3);
};
};
};
};
_local4++;
};
return (("" + _local1.join(".")));
}
public function resetTimestamp(_arg1:Number=NaN):void{
if (!isNaN(_arg1)){
_timespan = _arg1;
};
_creation = null;
_expiration = null;
_timestamp(_timespan);
}
public function get expiration():Date{
if (_expiration){
return (_expiration);
};
return (new Date((new Date().valueOf() + 1000)));
}
public function toURLString():String{
return (((inURL + "=") + valueOf()));
}
public function toSharedObject():Object{
var _local1:Object;
var _local2:String;
var _local3:*;
var _local4:int;
_local1 = {};
_local4 = 0;
for (;_local4 < fields.length;_local4++) {
_local2 = fields[_local4];
_local3 = this[_local2];
if ((_local3 is String)){
_local1[_local2] = _local3;
} else {
if (_local3 == 0){
_local1[_local2] = _local3;
} else {
if (isNaN(_local3)){
continue;
} else {
_local1[_local2] = _local3;
};
};
};
};
_local1.creation = creation;
_local1.expiration = expiration;
return (_local1);
}
public function toString(_arg1:Boolean=false):String{
var _local2:Array;
var _local3:String;
var _local4:*;
var _local5:int;
var _local6:int;
var _local7:String;
_local2 = [];
_local5 = fields.length;
_local6 = 0;
for (;_local6 < _local5;_local6++) {
_local3 = fields[_local6];
_local4 = this[_local3];
if ((_local4 is String)){
_local2.push((((_local3 + ": \"") + _local4) + "\""));
} else {
if (_local4 == 0){
_local2.push(((_local3 + ": ") + _local4));
} else {
if (isNaN(_local4)){
continue;
} else {
_local2.push(((_local3 + ": ") + _local4));
};
};
};
};
_local7 = (((name.toUpperCase() + " {") + _local2.join(", ")) + "}");
if (_arg1){
_local7 = (_local7 + (((" creation:" + creation) + ", expiration:") + expiration));
};
return (_local7);
}
public function set creation(_arg1:Date):void{
_creation = _arg1;
}
}
}//package com.google.analytics.data
Section 37
//UTMK (com.google.analytics.data.UTMK)
package com.google.analytics.data {
public class UTMK extends UTMCookie {
private var _hash:Number;
public function UTMK(_arg1:Number=NaN){
super("utmk", "__utmk", ["hash"]);
this.hash = _arg1;
}
public function set hash(_arg1:Number):void{
_hash = _arg1;
update();
}
public function get hash():Number{
return (_hash);
}
}
}//package com.google.analytics.data
Section 38
//UTMV (com.google.analytics.data.UTMV)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMV extends UTMCookie {
private var _domainHash:Number;
private var _value:String;
public function UTMV(_arg1:Number=NaN, _arg2:String=""){
super("utmv", "__utmv", ["domainHash", "value"], (Timespan.twoyears * 1000));
this.domainHash = _arg1;
this.value = _arg2;
}
override public function toURLString():String{
return (((inURL + "=") + encodeURI(valueOf())));
}
public function get value():String{
return (_value);
}
public function get domainHash():Number{
return (_domainHash);
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set value(_arg1:String):void{
_value = _arg1;
update();
}
}
}//package com.google.analytics.data
Section 39
//UTMZ (com.google.analytics.data.UTMZ)
package com.google.analytics.data {
import com.google.analytics.utils.*;
public class UTMZ extends UTMCookie {
private var _campaignTracking:String;
private var _campaignCreation:Number;
private var _responseCount:Number;
private var _domainHash:Number;
private var _campaignSessions:Number;
public static var defaultTimespan:Number = Timespan.sixmonths;
public function UTMZ(_arg1:Number=NaN, _arg2:Number=NaN, _arg3:Number=NaN, _arg4:Number=NaN, _arg5:String=""){
super("utmz", "__utmz", ["domainHash", "campaignCreation", "campaignSessions", "responseCount", "campaignTracking"], (defaultTimespan * 1000));
this.domainHash = _arg1;
this.campaignCreation = _arg2;
this.campaignSessions = _arg3;
this.responseCount = _arg4;
this.campaignTracking = _arg5;
}
public function set responseCount(_arg1:Number):void{
_responseCount = _arg1;
update();
}
public function set domainHash(_arg1:Number):void{
_domainHash = _arg1;
update();
}
public function set campaignCreation(_arg1:Number):void{
_campaignCreation = _arg1;
update();
}
public function get campaignTracking():String{
return (_campaignTracking);
}
public function get campaignSessions():Number{
return (_campaignSessions);
}
public function get domainHash():Number{
return (_domainHash);
}
public function get responseCount():Number{
return (_responseCount);
}
public function get campaignCreation():Number{
return (_campaignCreation);
}
public function set campaignSessions(_arg1:Number):void{
_campaignSessions = _arg1;
update();
}
public function set campaignTracking(_arg1:String):void{
_campaignTracking = _arg1;
update();
}
}
}//package com.google.analytics.data
Section 40
//X10 (com.google.analytics.data.X10)
package com.google.analytics.data {
public class X10 {
private var _delimEnd:String;// = ")"
private var _delimSet:String;// = "*"
private var _escapeChar:String;// = "'"
private var _delimBegin:String;// = "("
private var _delimNumValue:String;// = "!"
private var _key:String;// = "k"
private var _set:Array;
private var _projectData:Object;
private var _hasData:int;
private var _escapeCharMap:Object;
private var _minimum:int;
private var _value:String;// = "v"
public function X10(){
_key = "k";
_value = "v";
_set = [_key, _value];
_delimBegin = "(";
_delimEnd = ")";
_delimSet = "*";
_delimNumValue = "!";
_escapeChar = "'";
super();
_projectData = {};
_escapeCharMap = {};
_escapeCharMap[_escapeChar] = "'0";
_escapeCharMap[_delimEnd] = "'1";
_escapeCharMap[_delimSet] = "'2";
_escapeCharMap[_delimNumValue] = "'3";
_minimum = 1;
}
private function _clearInternal(_arg1:Number, _arg2:String):void{
var _local3:Boolean;
var _local4:int;
var _local5:int;
if (((hasProject(_arg1)) && (!((_projectData[_arg1][_arg2] == undefined))))){
_projectData[_arg1][_arg2] = undefined;
_local3 = true;
_local5 = _set.length;
_local4 = 0;
while (_local4 < _local5) {
if (_projectData[_arg1][_set[_local4]] != undefined){
_local3 = false;
break;
};
_local4++;
};
if (_local3){
_projectData[_arg1] = undefined;
_hasData = (_hasData - 1);
};
};
}
public function hasData():Boolean{
return ((_hasData > 0));
}
private function _setInternal(_arg1:Number, _arg2:String, _arg3:Number, _arg4:String):void{
if (!hasProject(_arg1)){
_projectData[_arg1] = {};
};
if (_projectData[_arg1][_arg2] == undefined){
_projectData[_arg1][_arg2] = [];
};
_projectData[_arg1][_arg2][_arg3] = _arg4;
_hasData = (_hasData + 1);
}
public function hasProject(_arg1:Number):Boolean{
return (_projectData[_arg1]);
}
public function clearKey(_arg1:Number):void{
_clearInternal(_arg1, _key);
}
private function _renderDataType(_arg1:Array):String{
var _local2:Array;
var _local3:String;
var _local4:int;
_local2 = [];
_local4 = 0;
while (_local4 < _arg1.length) {
if (_arg1[_local4] != undefined){
_local3 = "";
if (((!((_local4 == _minimum))) && ((_arg1[(_local4 - 1)] == undefined)))){
_local3 = (_local3 + _local4.toString());
_local3 = (_local3 + _delimNumValue);
};
_local3 = (_local3 + _escapeExtensibleValue(_arg1[_local4]));
_local2.push(_local3);
};
_local4++;
};
return (((_delimBegin + _local2.join(_delimSet)) + _delimEnd));
}
public function getKey(_arg1:Number, _arg2:Number):String{
return ((_getInternal(_arg1, _key, _arg2) as String));
}
public function clearValue(_arg1:Number):void{
_clearInternal(_arg1, _value);
}
public function renderMergedUrlString(_arg1:X10=null):String{
var _local2:Array;
var _local3:String;
if (!_arg1){
return (renderUrlString());
};
_local2 = [_arg1.renderUrlString()];
for (_local3 in _projectData) {
if (((hasProject(Number(_local3))) && (!(_arg1.hasProject(Number(_local3)))))){
_local2.push((_local3 + _renderProject(_projectData[_local3])));
};
};
return (_local2.join(""));
}
public function setValue(_arg1:Number, _arg2:Number, _arg3:Number):Boolean{
if (((((!((Math.round(_arg3) == _arg3))) || (isNaN(_arg3)))) || ((_arg3 == Infinity)))){
return (false);
};
_setInternal(_arg1, _value, _arg2, _arg3.toString());
return (true);
}
public function renderUrlString():String{
var _local1:Array;
var _local2:String;
_local1 = [];
for (_local2 in _projectData) {
if (hasProject(Number(_local2))){
_local1.push((_local2 + _renderProject(_projectData[_local2])));
};
};
return (_local1.join(""));
}
private function _getInternal(_arg1:Number, _arg2:String, _arg3:Number):Object{
if (((hasProject(_arg1)) && (!((_projectData[_arg1][_arg2] == undefined))))){
return (_projectData[_arg1][_arg2][_arg3]);
};
return (undefined);
}
public function setKey(_arg1:Number, _arg2:Number, _arg3:String):Boolean{
_setInternal(_arg1, _key, _arg2, _arg3);
return (true);
}
public function getValue(_arg1:Number, _arg2:Number){
var _local3:*;
_local3 = _getInternal(_arg1, _value, _arg2);
if (_local3 == null){
return (null);
};
return (Number(_local3));
}
private function _renderProject(_arg1:Object):String{
var _local2:String;
var _local3:Boolean;
var _local4:int;
var _local5:Array;
var _local6:int;
_local2 = "";
_local3 = false;
_local6 = _set.length;
_local4 = 0;
while (_local4 < _local6) {
_local5 = _arg1[_set[_local4]];
if (_local5){
if (_local3){
_local2 = (_local2 + _set[_local4]);
};
_local2 = (_local2 + _renderDataType(_local5));
_local3 = false;
} else {
_local3 = true;
};
_local4++;
};
return (_local2);
}
private function _escapeExtensibleValue(_arg1:String):String{
var _local2:String;
var _local3:int;
var _local4:String;
var _local5:String;
_local2 = "";
_local3 = 0;
while (_local3 < _arg1.length) {
_local4 = _arg1.charAt(_local3);
_local5 = _escapeCharMap[_local4];
if (_local5){
_local2 = (_local2 + _local5);
} else {
_local2 = (_local2 + _local4);
};
_local3++;
};
return (_local2);
}
}
}//package com.google.analytics.data
Section 41
//_Style (com.google.analytics.debug._Style)
package com.google.analytics.debug {
import flash.net.*;
import flash.text.*;
public class _Style {
public var borderColor:uint;
public var backgroundColor:uint;
private var _sheet:StyleSheet;
public var roundedCorner:uint;
public var alertColor:uint;
public var infoColor:uint;
public var successColor:uint;
private var _loader:URLLoader;
public var failureColor:uint;
private var _defaultSheet:String;
public var warningColor:uint;
public function _Style(){
_sheet = new StyleSheet();
_loader = new URLLoader();
_init();
}
private function _parseSheet(_arg1:String):void{
_sheet.parseCSS(_arg1);
}
public function get sheet():StyleSheet{
return (_sheet);
}
private function _init():void{
_defaultSheet = "";
_defaultSheet = (_defaultSheet + "a{text-decoration: underline;}\n");
_defaultSheet = (_defaultSheet + ".uiLabel{color: #000000;font-family: Arial;font-size: 12;margin-left: 2;margin-right: 2;}\n");
_defaultSheet = (_defaultSheet + ".uiWarning{color: #ffffff;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiAlert{color: #ffffff;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiInfo{color: #000000;font-family: Arial;font-size: 14;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiSuccess{color: #ffffff;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiFailure{color: #ffffff;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiAlertAction{color: #ffffff;text-align: center;font-family: Arial;font-size: 12;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + ".uiAlertTitle{color: #ffffff;font-family: Arial;font-size: 16;font-weight: bold;margin-left: 6;margin-right: 6;}\n");
_defaultSheet = (_defaultSheet + "\n");
roundedCorner = 6;
backgroundColor = 0xCCCCCC;
borderColor = 0x555555;
infoColor = 16777113;
alertColor = 0xFFCC00;
warningColor = 0xCC0000;
successColor = 0xFF00;
failureColor = 0xFF0000;
_parseSheet(_defaultSheet);
}
}
}//package com.google.analytics.debug
Section 42
//Alert (com.google.analytics.debug.Alert)
package com.google.analytics.debug {
import flash.events.*;
public class Alert extends Label {
public var actionOnNextLine:Boolean;// = true
public var autoClose:Boolean;// = true
private var _actions:Array;
public function Alert(_arg1:String, _arg2:Array, _arg3:String="uiAlert", _arg4:uint=0, _arg5:Align=null, _arg6:Boolean=false, _arg7:Boolean=true){
var _local8:int;
autoClose = true;
actionOnNextLine = true;
if (_arg4 == 0){
_arg4 = Style.alertColor;
};
if (_arg5 == null){
_arg5 = Align.center;
};
super(_arg1, _arg3, _arg4, _arg5, _arg6);
this.selectable = true;
super.mouseChildren = true;
this.buttonMode = true;
this.mouseEnabled = true;
this.useHandCursor = true;
this.actionOnNextLine = _arg7;
_actions = [];
_local8 = 0;
while (_local8 < _arg2.length) {
_arg2[_local8].container = this;
_actions.push(_arg2[_local8]);
_local8++;
};
}
protected function getAction(_arg1:String):AlertAction{
var _local2:int;
_local2 = 0;
while (_local2 < _actions.length) {
if (_arg1 == _actions[_local2].activator){
return (_actions[_local2]);
};
_local2++;
};
return (null);
}
override protected function layout():void{
super.layout();
_defineActions();
}
protected function spaces(_arg1:int):String{
var _local2:String;
var _local3:String;
var _local4:int;
_local2 = "";
_local3 = " ";
_local4 = 0;
while (_local4 < (_arg1 + 1)) {
_local2 = (_local2 + _local3);
_local4++;
};
return (_local2);
}
override public function onLink(_arg1:TextEvent):void{
var _local2:AlertAction;
if (isValidAction(_arg1.text)){
_local2 = getAction(_arg1.text);
if (_local2){
_local2.execute();
};
};
if (autoClose){
close();
};
}
protected function isValidAction(_arg1:String):Boolean{
var _local2:int;
_local2 = 0;
while (_local2 < _actions.length) {
if (_arg1 == _actions[_local2].activator){
return (true);
};
_local2++;
};
return (false);
}
private function _defineActions():void{
var _local1:String;
var _local2:Array;
var _local3:AlertAction;
var _local4:int;
_local1 = "";
if (actionOnNextLine){
_local1 = (_local1 + "\n");
} else {
_local1 = (_local1 + " |");
};
_local1 = (_local1 + " ");
_local2 = [];
_local4 = 0;
while (_local4 < _actions.length) {
_local3 = _actions[_local4];
_local2.push((((("<a href=\"event:" + _local3.activator) + "\">") + _local3.name) + "</a>"));
_local4++;
};
_local1 = (_local1 + _local2.join(" | "));
appendText(_local1, "uiAlertAction");
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
}
}//package com.google.analytics.debug
Section 43
//AlertAction (com.google.analytics.debug.AlertAction)
package com.google.analytics.debug {
public class AlertAction {
public var container:Alert;
private var _callback;
public var name:String;
public var activator:String;
public function AlertAction(_arg1:String, _arg2:String, _arg3){
this.name = _arg1;
this.activator = _arg2;
_callback = _arg3;
}
public function execute():void{
if (_callback){
if ((_callback is Function)){
(_callback as Function)();
} else {
if ((_callback is String)){
var _local1 = container;
_local1[_callback]();
};
};
};
}
}
}//package com.google.analytics.debug
Section 44
//Align (com.google.analytics.debug.Align)
package com.google.analytics.debug {
public class Align {
private var _value:int;
private var _name:String;
public static const bottomRight:Align = new Align(18, "bottomRight");
;
public static const right:Align = new Align(16, "right");
;
public static const left:Align = new Align(32, "left");
;
public static const topRight:Align = new Align(17, "topRight");
;
public static const bottom:Align = new Align(2, "bottom");
;
public static const bottomLeft:Align = new Align(34, "bottomLeft");
;
public static const topLeft:Align = new Align(33, "topLeft");
;
public static const center:Align = new Align(0x0100, "center");
;
public static const none:Align = new Align(0, "none");
;
public static const top:Align = new Align(1, "top");
;
public function Align(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.debug
Section 45
//Background (com.google.analytics.debug.Background)
package com.google.analytics.debug {
import flash.display.*;
public class Background {
public static function drawRounded(_arg1, _arg2:Graphics, _arg3:uint=0, _arg4:uint=0):void{
var _local5:uint;
var _local6:uint;
var _local7:uint;
_local7 = Style.roundedCorner;
if ((((_arg3 > 0)) && ((_arg4 > 0)))){
_local5 = _arg3;
_local6 = _arg4;
} else {
_local5 = _arg1.width;
_local6 = _arg1.height;
};
if (((_arg1.stickToEdge) && (!((_arg1.alignement == Align.none))))){
switch (_arg1.alignement){
case Align.top:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, 0, _local7, _local7);
break;
case Align.topLeft:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, 0, 0, _local7);
break;
case Align.topRight:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, 0, _local7, 0);
break;
case Align.bottom:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, _local7, _local7, 0, 0);
break;
case Align.bottomLeft:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, _local7, 0, 0);
break;
case Align.bottomRight:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, _local7, 0, 0, 0);
break;
case Align.left:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, 0, _local7, 0, _local7);
break;
case Align.right:
_arg2.drawRoundRectComplex(0, 0, _local5, _local6, _local7, 0, _local7, 0);
break;
case Align.center:
_arg2.drawRoundRect(0, 0, _local5, _local6, _local7, _local7);
break;
};
} else {
_arg2.drawRoundRect(0, 0, _local5, _local6, _local7, _local7);
};
}
}
}//package com.google.analytics.debug
Section 46
//Debug (com.google.analytics.debug.Debug)
package com.google.analytics.debug {
import flash.events.*;
import flash.ui.*;
public class Debug extends Label {
private var _lines:Array;
private var _preferredForcedWidth:uint;// = 540
private var _linediff:int;// = 0
public var maxLines:uint;// = 16
public static var count:uint = 0;
public function Debug(_arg1:uint=0, _arg2:Align=null, _arg3:Boolean=false){
if (_arg2 == null){
_arg2 = Align.bottom;
};
super("", "uiLabel", _arg1, _arg2, _arg3);
this.name = ("Debug" + count++);
_lines = [];
selectable = true;
addEventListener(KeyboardEvent.KEY_DOWN, onKey);
}
public function writeBold(_arg1:String):void{
write(_arg1, true);
}
private function _getLinesToDisplay(_arg1:int=0):Array{
var _local2:Array;
var _local3:uint;
var _local4:uint;
if ((_lines.length - 1) > maxLines){
if ((_linediff <= 0)){
_linediff = (_linediff + _arg1);
} else {
if ((((_linediff > 0)) && ((_arg1 < 0)))){
_linediff = (_linediff + _arg1);
};
};
_local3 = ((_lines.length - maxLines) + _linediff);
_local4 = (_local3 + maxLines);
_local2 = _lines.slice(_local3, _local4);
} else {
_local2 = _lines;
};
return (_local2);
}
private function onKey(_arg1:KeyboardEvent=null):void{
var _local2:Array;
switch (_arg1.keyCode){
case Keyboard.DOWN:
_local2 = _getLinesToDisplay(1);
break;
case Keyboard.UP:
_local2 = _getLinesToDisplay(-1);
break;
default:
_local2 = null;
};
if (_local2 == null){
return;
};
text = _local2.join("\n");
}
override public function get forcedWidth():uint{
if (this.parent){
if (UISprite(this.parent).forcedWidth > _preferredForcedWidth){
return (_preferredForcedWidth);
};
return (UISprite(this.parent).forcedWidth);
//unresolved jump
};
return (super.forcedWidth);
}
public function write(_arg1:String, _arg2:Boolean=false):void{
var _local3:Array;
if (_arg1.indexOf("") > -1){
_local3 = _arg1.split("\n");
} else {
_local3 = [_arg1];
};
var _local4 = "";
var _local5 = "";
if (_arg2){
_local4 = "<b>";
_local5 = "</b>";
};
var _local6:int;
while (_local6 < _local3.length) {
_lines.push(((_local4 + _local3[_local6]) + _local5));
_local6++;
};
var _local7:Array = _getLinesToDisplay();
text = _local7.join("\n");
}
public function close():void{
dispose();
}
override protected function dispose():void{
removeEventListener(KeyboardEvent.KEY_DOWN, onKey);
super.dispose();
}
}
}//package com.google.analytics.debug
Section 47
//DebugConfiguration (com.google.analytics.debug.DebugConfiguration)
package com.google.analytics.debug {
import com.google.analytics.core.*;
import flash.net.*;
import flash.utils.*;
import flash.ui.*;
public class DebugConfiguration {
public var showHideKey:Number;
private var _mode:VisualDebugMode;
private var _verbose:Boolean;// = false
public var destroyKey:Number;
public var GIFRequests:Boolean;// = false
public var showInfos:Boolean;// = true
public var infoTimeout:Number;// = 1000
public var minimizedOnStart:Boolean;// = false
private var _active:Boolean;// = false
public var traceOutput:Boolean;// = false
public var layout:ILayout;
public var warningTimeout:Number;// = 1500
public var javascript:Boolean;// = false
public var showWarnings:Boolean;// = true
private var _visualInitialized:Boolean;// = false
public function DebugConfiguration(){
_mode = VisualDebugMode.basic;
showHideKey = Keyboard.SPACE;
destroyKey = Keyboard.BACKSPACE;
super();
}
public function get verbose():Boolean{
return (_verbose);
}
public function set verbose(_arg1:Boolean):void{
_verbose = _arg1;
}
public function set mode(_arg1):void{
if ((_arg1 is String)){
switch (_arg1){
case "geek":
_arg1 = VisualDebugMode.geek;
break;
case "advanced":
_arg1 = VisualDebugMode.advanced;
break;
case "basic":
default:
_arg1 = VisualDebugMode.basic;
};
};
_mode = _arg1;
}
public function success(_arg1:String):void{
if (layout){
layout.createSuccessAlert(_arg1);
};
if (traceOutput){
trace((("[+] " + _arg1) + " !!"));
};
}
public function get active():Boolean{
return (_active);
}
private function _initializeVisual():void{
if (layout){
layout.init();
_visualInitialized = true;
};
}
private function _destroyVisual():void{
if (((layout) && (_visualInitialized))){
layout.destroy();
};
}
public function warning(_arg1:String, _arg2:VisualDebugMode=null):void{
if (_filter(_arg2)){
return;
};
if (((layout) && (showWarnings))){
layout.createWarning(_arg1);
};
if (traceOutput){
trace((("## " + _arg1) + " ##"));
};
}
private function _filter(_arg1:VisualDebugMode=null):Boolean{
return (((_arg1) && ((int(_arg1) >= int(this.mode)))));
}
public function failure(_arg1:String):void{
if (layout){
layout.createFailureAlert(_arg1);
};
if (traceOutput){
trace((("[-] " + _arg1) + " !!"));
};
}
public function get mode(){
return (_mode);
}
public function set active(_arg1:Boolean):void{
_active = _arg1;
if (_active){
_initializeVisual();
} else {
_destroyVisual();
};
}
protected function trace(_arg1:String):void{
var _local7:Array;
var _local8:int;
var _local2:Array = [];
var _local3 = "";
var _local4 = "";
if (this.mode == VisualDebugMode.geek){
_local3 = (getTimer() + " - ");
_local4 = (new Array(_local3.length).join(" ") + " ");
};
if (_arg1.indexOf("\n") > -1){
_local7 = _arg1.split("\n");
_local8 = 0;
while (_local8 < _local7.length) {
if (_local7[_local8] == ""){
} else {
if (_local8 == 0){
_local2.push((_local3 + _local7[_local8]));
} else {
_local2.push((_local4 + _local7[_local8]));
};
};
_local8++;
};
} else {
_local2.push((_local3 + _arg1));
};
var _local5:int = _local2.length;
var _local6:int;
while (_local6 < _local5) {
trace(_local2[_local6]);
_local6++;
};
}
public function alert(_arg1:String):void{
if (layout){
layout.createAlert(_arg1);
};
if (traceOutput){
trace((("!! " + _arg1) + " !!"));
};
}
public function info(_arg1:String, _arg2:VisualDebugMode=null):void{
if (_filter(_arg2)){
return;
};
if (((layout) && (showInfos))){
layout.createInfo(_arg1);
};
if (traceOutput){
trace(_arg1);
};
}
public function alertGifRequest(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):void{
if (layout){
layout.createGIFRequestAlert(_arg1, _arg2, _arg3);
};
if (traceOutput){
trace(((">> " + _arg1) + " <<"));
};
}
}
}//package com.google.analytics.debug
Section 48
//FailureAlert (com.google.analytics.debug.FailureAlert)
package com.google.analytics.debug {
public class FailureAlert extends Alert {
public function FailureAlert(_arg1:DebugConfiguration, _arg2:String, _arg3:Array){
var _local4:Align;
var _local5:Boolean;
var _local6:Boolean;
_local4 = Align.bottomLeft;
_local5 = true;
_local6 = false;
if (_arg1.verbose){
_arg2 = ((("<u><span class=\"uiAlertTitle\">Failure</span>" + spaces(18)) + "</u>\n\n") + _arg2);
_local4 = Align.center;
_local5 = false;
_local6 = true;
};
super(_arg2, _arg3, "uiFailure", Style.failureColor, _local4, _local5, _local6);
}
}
}//package com.google.analytics.debug
Section 49
//GIFRequestAlert (com.google.analytics.debug.GIFRequestAlert)
package com.google.analytics.debug {
public class GIFRequestAlert extends Alert {
public function GIFRequestAlert(_arg1:String, _arg2:Array){
super(_arg1, _arg2);
}
}
}//package com.google.analytics.debug
Section 50
//ILayout (com.google.analytics.debug.ILayout)
package com.google.analytics.debug {
import com.google.analytics.core.*;
import flash.net.*;
import flash.display.*;
public interface ILayout {
function createWarning(_arg1:String):void;
function addToStage(_arg1:DisplayObject):void;
function createGIFRequestAlert(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):void;
function createPanel(_arg1:String, _arg2:uint, _arg3:uint):void;
function createInfo(_arg1:String):void;
function createFailureAlert(_arg1:String):void;
function addToPanel(_arg1:String, _arg2:DisplayObject):void;
function init():void;
function createSuccessAlert(_arg1:String):void;
function createVisualDebug():void;
function createAlert(_arg1:String):void;
function destroy():void;
function bringToFront(_arg1:DisplayObject):void;
function isAvailable():Boolean;
}
}//package com.google.analytics.debug
Section 51
//Info (com.google.analytics.debug.Info)
package com.google.analytics.debug {
import flash.events.*;
import flash.utils.*;
public class Info extends Label {
private var _timer:Timer;
public function Info(_arg1:String="", _arg2:uint=3000){
super(_arg1, "uiInfo", Style.infoColor, Align.top, true);
if (_arg2 > 0){
_timer = new Timer(_arg2, 1);
_timer.start();
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, onComplete, false, 0, true);
};
}
public function onComplete(_arg1:TimerEvent):void{
close();
}
override public function onLink(_arg1:TextEvent):void{
switch (_arg1.text){
case "hide":
close();
break;
};
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
}
}//package com.google.analytics.debug
Section 52
//Label (com.google.analytics.debug.Label)
package com.google.analytics.debug {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class Label extends UISprite {
private var _color:uint;
private var _background:Shape;
private var _textField:TextField;
public var stickToEdge:Boolean;
private var _text:String;
protected var selectable:Boolean;
private var _tag:String;
public static var count:uint = 0;
public function Label(_arg1:String="", _arg2:String="uiLabel", _arg3:uint=0, _arg4:Align=null, _arg5:Boolean=false){
this.name = ("Label" + count++);
selectable = false;
_background = new Shape();
_textField = new TextField();
_text = _arg1;
_tag = _arg2;
if (_arg4 == null){
_arg4 = Align.none;
};
this.alignement = _arg4;
this.stickToEdge = _arg5;
if (_arg3 == 0){
_arg3 = Style.backgroundColor;
};
_color = _arg3;
_textField.addEventListener(TextEvent.LINK, onLink);
}
public function get tag():String{
return (_tag);
}
private function _draw():void{
var _local1:Graphics = _background.graphics;
_local1.clear();
_local1.beginFill(_color);
var _local2:uint = _textField.width;
var _local3:uint = _textField.height;
if (forcedWidth > 0){
_local2 = forcedWidth;
};
Background.drawRounded(this, _local1, _local2, _local3);
_local1.endFill();
}
public function get text():String{
return (_textField.text);
}
public function appendText(_arg1:String, _arg2:String=""):void{
if (_arg1 == ""){
return;
};
if (_arg2 == ""){
_arg2 = tag;
};
_textField.htmlText = (_textField.htmlText + (((("<span class=\"" + _arg2) + "\">") + _arg1) + "</span>"));
_text = (_text + _arg1);
_draw();
resize();
}
public function set text(_arg1:String):void{
if (_arg1 == ""){
_arg1 = _text;
};
_textField.htmlText = (((("<span class=\"" + tag) + "\">") + _arg1) + "</span>");
_text = _arg1;
_draw();
resize();
}
override protected function layout():void{
_textField.type = TextFieldType.DYNAMIC;
_textField.autoSize = TextFieldAutoSize.LEFT;
_textField.background = false;
_textField.selectable = selectable;
_textField.multiline = true;
_textField.styleSheet = Style.sheet;
this.text = _text;
addChild(_background);
addChild(_textField);
}
public function set tag(_arg1:String):void{
_tag = _arg1;
text = "";
}
public function onLink(_arg1:TextEvent):void{
}
override protected function dispose():void{
_textField.removeEventListener(TextEvent.LINK, onLink);
super.dispose();
}
}
}//package com.google.analytics.debug
Section 53
//Layout (com.google.analytics.debug.Layout)
package com.google.analytics.debug {
import com.google.analytics.core.*;
import flash.net.*;
import flash.events.*;
import flash.display.*;
import com.google.analytics.*;
public class Layout implements ILayout {
private var _display:DisplayObject;
private var _infoQueue:Array;
private var _maxCharPerLine:int;// = 85
private var _hasInfo:Boolean;
private var _warningQueue:Array;
private var _hasDebug:Boolean;
private var _hasWarning:Boolean;
private var _mainPanel:Panel;
private var _GRAlertQueue:Array;
private var _debug:DebugConfiguration;
public var visualDebug:Debug;
private var _hasGRAlert:Boolean;
public function Layout(_arg1:DebugConfiguration, _arg2:DisplayObject){
_display = _arg2;
_debug = _arg1;
_hasWarning = false;
_hasInfo = false;
_hasDebug = false;
_hasGRAlert = false;
_warningQueue = [];
_infoQueue = [];
_GRAlertQueue = [];
}
private function onKey(_arg1:KeyboardEvent=null):void{
switch (_arg1.keyCode){
case _debug.showHideKey:
_mainPanel.visible = !(_mainPanel.visible);
break;
case _debug.destroyKey:
destroy();
break;
};
}
public function createWarning(_arg1:String):void{
if (((_hasWarning) || (!(isAvailable())))){
_warningQueue.push(_arg1);
return;
};
_arg1 = _filterMaxChars(_arg1);
_hasWarning = true;
var _local2:Warning = new Warning(_arg1, _debug.warningTimeout);
addToPanel("analytics", _local2);
_local2.addEventListener(Event.REMOVED_FROM_STAGE, _clearWarning, false, 0, true);
if (_hasDebug){
visualDebug.writeBold(_arg1);
};
}
public function bringToFront(_arg1:DisplayObject):void{
_display.stage.setChildIndex(_arg1, (_display.stage.numChildren - 1));
}
public function createFailureAlert(_arg1:String):void{
var _local2:AlertAction;
if (_debug.verbose){
_arg1 = _filterMaxChars(_arg1);
_local2 = new AlertAction("Close", "close", "close");
} else {
_local2 = new AlertAction("X", "close", "close");
};
var _local3:Alert = new FailureAlert(_debug, _arg1, [_local2]);
addToPanel("analytics", _local3);
if (_hasDebug){
if (_debug.verbose){
_arg1 = _arg1.split("\n").join("");
_arg1 = _filterMaxChars(_arg1, 66);
};
visualDebug.writeBold(_arg1);
};
}
public function init():void{
var _local1 = 10;
var _local2:uint = (_display.stage.stageWidth - (_local1 * 2));
var _local3:uint = (_display.stage.stageHeight - (_local1 * 2));
var _local4:Panel = new Panel("analytics", _local2, _local3);
_local4.alignement = Align.top;
_local4.stickToEdge = false;
_local4.title = ("Google Analytics v" + GATracker.version);
_mainPanel = _local4;
addToStage(_local4);
bringToFront(_local4);
if (_debug.minimizedOnStart){
_mainPanel.onToggle();
};
createVisualDebug();
_display.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKey, false, 0, true);
}
public function addToPanel(_arg1:String, _arg2:DisplayObject):void{
var _local4:Panel;
var _local3:DisplayObject = _display.stage.getChildByName(_arg1);
if (_local3){
_local4 = (_local3 as Panel);
_local4.addData(_arg2);
} else {
trace((("panel \"" + _arg1) + "\" not found"));
};
}
private function _clearInfo(_arg1:Event):void{
_hasInfo = false;
if (_infoQueue.length > 0){
createInfo(_infoQueue.shift());
};
}
private function _filterMaxChars(_arg1:String, _arg2:int=0):String{
var _local6:String;
var _local3 = "\n";
var _local4:Array = [];
var _local5:Array = _arg1.split(_local3);
if (_arg2 == 0){
_arg2 = _maxCharPerLine;
};
var _local7:int;
while (_local7 < _local5.length) {
_local6 = _local5[_local7];
while (_local6.length > _arg2) {
_local4.push(_local6.substr(0, _arg2));
_local6 = _local6.substring(_arg2);
};
_local4.push(_local6);
_local7++;
};
return (_local4.join(_local3));
}
private function _clearGRAlert(_arg1:Event):void{
_hasGRAlert = false;
if (_GRAlertQueue.length > 0){
createGIFRequestAlert.apply(this, _GRAlertQueue.shift());
};
}
public function createSuccessAlert(_arg1:String):void{
var _local2:AlertAction;
if (_debug.verbose){
_arg1 = _filterMaxChars(_arg1);
_local2 = new AlertAction("Close", "close", "close");
} else {
_local2 = new AlertAction("X", "close", "close");
};
var _local3:Alert = new SuccessAlert(_debug, _arg1, [_local2]);
addToPanel("analytics", _local3);
if (_hasDebug){
if (_debug.verbose){
_arg1 = _arg1.split("\n").join("");
_arg1 = _filterMaxChars(_arg1, 66);
};
visualDebug.writeBold(_arg1);
};
}
public function isAvailable():Boolean{
return (!((_display.stage == null)));
}
public function createAlert(_arg1:String):void{
_arg1 = _filterMaxChars(_arg1);
var _local2:Alert = new Alert(_arg1, [new AlertAction("Close", "close", "close")]);
addToPanel("analytics", _local2);
if (_hasDebug){
visualDebug.writeBold(_arg1);
};
}
public function createInfo(_arg1:String):void{
if (((_hasInfo) || (!(isAvailable())))){
_infoQueue.push(_arg1);
return;
};
_arg1 = _filterMaxChars(_arg1);
_hasInfo = true;
var _local2:Info = new Info(_arg1, _debug.infoTimeout);
addToPanel("analytics", _local2);
_local2.addEventListener(Event.REMOVED_FROM_STAGE, _clearInfo, false, 0, true);
if (_hasDebug){
visualDebug.write(_arg1);
};
}
public function createGIFRequestAlert(_arg1:String, _arg2:URLRequest, _arg3:GIFRequest):void{
var message = _arg1;
var request = _arg2;
var ref = _arg3;
if (_hasGRAlert){
_GRAlertQueue.push([message, request, ref]);
return;
};
_hasGRAlert = true;
var f:Function = function ():void{
ref.sendRequest(request);
};
message = _filterMaxChars(message);
var gra:GIFRequestAlert = new GIFRequestAlert(message, [new AlertAction("OK", "ok", f), new AlertAction("Cancel", "cancel", "close")]);
addToPanel("analytics", gra);
gra.addEventListener(Event.REMOVED_FROM_STAGE, _clearGRAlert, false, 0, true);
if (_hasDebug){
if (_debug.verbose){
message = message.split("\n").join("");
message = _filterMaxChars(message, 66);
};
visualDebug.write(message);
};
}
public function createVisualDebug():void{
if (!visualDebug){
visualDebug = new Debug();
visualDebug.alignement = Align.bottom;
visualDebug.stickToEdge = true;
addToPanel("analytics", visualDebug);
_hasDebug = true;
};
}
public function addToStage(_arg1:DisplayObject):void{
_display.stage.addChild(_arg1);
}
private function _clearWarning(_arg1:Event):void{
_hasWarning = false;
if (_warningQueue.length > 0){
createWarning(_warningQueue.shift());
};
}
public function createPanel(_arg1:String, _arg2:uint, _arg3:uint):void{
var _local4:Panel = new Panel(_arg1, _arg2, _arg3);
_local4.alignement = Align.center;
_local4.stickToEdge = false;
addToStage(_local4);
bringToFront(_local4);
}
public function destroy():void{
_mainPanel.close();
_debug.layout = null;
}
}
}//package com.google.analytics.debug
Section 54
//Margin (com.google.analytics.debug.Margin)
package com.google.analytics.debug {
public class Margin {
public var bottom:int;
public var top:int;
public var right:int;
public var left:int;
public function Margin(_arg1:int=0, _arg2:int=0, _arg3:int=0, _arg4:int=0){
this.top = _arg1;
this.bottom = _arg2;
this.left = _arg3;
this.right = _arg4;
}
}
}//package com.google.analytics.debug
Section 55
//Panel (com.google.analytics.debug.Panel)
package com.google.analytics.debug {
import flash.events.*;
import flash.display.*;
public class Panel extends UISprite {
private var _savedH:uint;
private var _data:UISprite;
private var _mask:Sprite;
private var _background:Shape;
private var _savedW:uint;
private var _stickToEdge:Boolean;
private var _border:Shape;
private var _borderColor:uint;
protected var baseAlpha:Number;
private var _backgroundColor:uint;
private var _title:Label;
private var _colapsed:Boolean;
private var _name:String;
public function Panel(_arg1:String, _arg2:uint, _arg3:uint, _arg4:uint=0, _arg5:uint=0, _arg6:Number=0.3, _arg7:Align=null, _arg8:Boolean=false){
_name = _arg1;
this.name = _arg1;
this.mouseEnabled = false;
_colapsed = false;
forcedWidth = _arg2;
forcedHeight = _arg3;
this.baseAlpha = _arg6;
_background = new Shape();
_data = new UISprite();
_data.forcedWidth = _arg2;
_data.forcedHeight = _arg3;
_data.mouseEnabled = false;
_title = new Label(_arg1, "uiLabel", 0xFFFFFF, Align.topLeft, _arg8);
_title.buttonMode = true;
_title.margin.top = 0.6;
_title.margin.left = 0.6;
_title.addEventListener(MouseEvent.CLICK, onToggle);
_title.mouseChildren = false;
_border = new Shape();
_mask = new Sprite();
_mask.useHandCursor = false;
_mask.mouseEnabled = false;
_mask.mouseChildren = false;
if (_arg7 == null){
_arg7 = Align.none;
};
this.alignement = _arg7;
this.stickToEdge = _arg8;
if (_arg4 == 0){
_arg4 = Style.backgroundColor;
};
_backgroundColor = _arg4;
if (_arg5 == 0){
_arg5 = Style.borderColor;
};
_borderColor = _arg5;
}
public function get stickToEdge():Boolean{
return (_stickToEdge);
}
public function onToggle(_arg1:MouseEvent=null):void{
if (_colapsed){
_data.visible = true;
} else {
_data.visible = false;
};
_colapsed = !(_colapsed);
_update();
resize();
}
public function set stickToEdge(_arg1:Boolean):void{
_stickToEdge = _arg1;
_title.stickToEdge = _arg1;
}
override protected function dispose():void{
_title.removeEventListener(MouseEvent.CLICK, onToggle);
super.dispose();
}
private function _draw():void{
var _local1:uint;
var _local2:uint;
if (((_savedW) && (_savedH))){
forcedWidth = _savedW;
forcedHeight = _savedH;
};
if (!_colapsed){
_local1 = forcedWidth;
_local2 = forcedHeight;
} else {
_local1 = _title.width;
_local2 = _title.height;
_savedW = forcedWidth;
_savedH = forcedHeight;
forcedWidth = _local1;
forcedHeight = _local2;
};
var _local3:Graphics = _background.graphics;
_local3.clear();
_local3.beginFill(_backgroundColor);
Background.drawRounded(this, _local3, _local1, _local2);
_local3.endFill();
var _local4:Graphics = _data.graphics;
_local4.clear();
_local4.beginFill(_backgroundColor, 0);
Background.drawRounded(this, _local4, _local1, _local2);
_local4.endFill();
var _local5:Graphics = _border.graphics;
_local5.clear();
_local5.lineStyle(0.1, _borderColor);
Background.drawRounded(this, _local5, _local1, _local2);
_local5.endFill();
var _local6:Graphics = _mask.graphics;
_local6.clear();
_local6.beginFill(_backgroundColor);
Background.drawRounded(this, _local6, (_local1 + 1), (_local2 + 1));
_local6.endFill();
}
public function get title():String{
return (_title.text);
}
private function _update():void{
_draw();
if (baseAlpha < 1){
_background.alpha = baseAlpha;
_border.alpha = baseAlpha;
};
}
public function addData(_arg1:DisplayObject):void{
_data.addChild(_arg1);
}
override protected function layout():void{
_update();
addChild(_background);
addChild(_data);
addChild(_title);
addChild(_border);
addChild(_mask);
mask = _mask;
}
public function set title(_arg1:String):void{
_title.text = _arg1;
}
public function close():void{
dispose();
if (parent != null){
parent.removeChild(this);
};
}
}
}//package com.google.analytics.debug
Section 56
//Style (com.google.analytics.debug.Style)
package com.google.analytics.debug {
public const Style:_Style = new _Style();
}//package com.google.analytics.debug
Section 57
//SuccessAlert (com.google.analytics.debug.SuccessAlert)
package com.google.analytics.debug {
public class SuccessAlert extends Alert {
public function SuccessAlert(_arg1:DebugConfiguration, _arg2:String, _arg3:Array){
var _local4:Align;
var _local5:Boolean;
var _local6:Boolean;
_local4 = Align.bottomLeft;
_local5 = true;
_local6 = false;
if (_arg1.verbose){
_arg2 = ((("<u><span class=\"uiAlertTitle\">Success</span>" + spaces(18)) + "</u>\n\n") + _arg2);
_local4 = Align.center;
_local5 = false;
_local6 = true;
};
super(_arg2, _arg3, "uiSuccess", Style.successColor, _local4, _local5, _local6);
}
}
}//package com.google.analytics.debug
Section 58
//UISprite (com.google.analytics.debug.UISprite)
package com.google.analytics.debug {
import flash.events.*;
import flash.display.*;
public class UISprite extends Sprite {
private var _forcedHeight:uint;
protected var listenResize:Boolean;
public var alignement:Align;
private var _forcedWidth:uint;
public var margin:Margin;
protected var alignTarget:DisplayObject;
public function UISprite(_arg1:DisplayObject=null){
listenResize = false;
alignement = Align.none;
this.alignTarget = _arg1;
margin = new Margin();
addEventListener(Event.ADDED_TO_STAGE, _onAddedToStage);
addEventListener(Event.REMOVED_FROM_STAGE, _onRemovedFromStage);
}
protected function dispose():void{
var _local1:DisplayObject;
var _local2:int;
_local2 = 0;
while (_local2 < numChildren) {
_local1 = getChildAt(_local2);
if (_local1){
removeChild(_local1);
};
_local2++;
};
}
protected function layout():void{
}
public function get forcedHeight():uint{
if (_forcedHeight){
return (_forcedHeight);
};
return (height);
}
public function alignTo(_arg1:Align, _arg2:DisplayObject=null):void{
var _local3:uint;
var _local4:uint;
var _local5:uint;
var _local6:uint;
var _local7:UISprite;
if (_arg2 == null){
if ((parent is Stage)){
_arg2 = this.stage;
} else {
_arg2 = parent;
};
};
if (_arg2 == this.stage){
if (this.stage == null){
return;
};
_local3 = this.stage.stageHeight;
_local4 = this.stage.stageWidth;
_local5 = 0;
_local6 = 0;
} else {
_local7 = (_arg2 as UISprite);
if (_local7.forcedHeight){
_local3 = _local7.forcedHeight;
} else {
_local3 = _local7.height;
};
if (_local7.forcedWidth){
_local4 = _local7.forcedWidth;
} else {
_local4 = _local7.width;
};
_local5 = 0;
_local6 = 0;
};
switch (_arg1){
case Align.top:
x = ((_local4 / 2) - (forcedWidth / 2));
y = (_local6 + margin.top);
break;
case Align.bottom:
x = ((_local4 / 2) - (forcedWidth / 2));
y = (((_local6 + _local3) - forcedHeight) - margin.bottom);
break;
case Align.left:
x = (_local5 + margin.left);
y = ((_local3 / 2) - (forcedHeight / 2));
break;
case Align.right:
x = (((_local5 + _local4) - forcedWidth) - margin.right);
y = ((_local3 / 2) - (forcedHeight / 2));
break;
case Align.center:
x = ((_local4 / 2) - (forcedWidth / 2));
y = ((_local3 / 2) - (forcedHeight / 2));
break;
case Align.topLeft:
x = (_local5 + margin.left);
y = (_local6 + margin.top);
break;
case Align.topRight:
x = (((_local5 + _local4) - forcedWidth) - margin.right);
y = (_local6 + margin.top);
break;
case Align.bottomLeft:
x = (_local5 + margin.left);
y = (((_local6 + _local3) - forcedHeight) - margin.bottom);
break;
case Align.bottomRight:
x = (((_local5 + _local4) - forcedWidth) - margin.right);
y = (((_local6 + _local3) - forcedHeight) - margin.bottom);
break;
};
if (((!(listenResize)) && (!((_arg1 == Align.none))))){
_arg2.addEventListener(Event.RESIZE, onResize, false, 0, true);
listenResize = true;
};
this.alignement = _arg1;
this.alignTarget = _arg2;
}
public function get forcedWidth():uint{
if (_forcedWidth){
return (_forcedWidth);
};
return (width);
}
protected function onResize(_arg1:Event):void{
resize();
}
private function _onRemovedFromStage(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, _onAddedToStage);
removeEventListener(Event.REMOVED_FROM_STAGE, _onRemovedFromStage);
dispose();
}
public function resize():void{
if (alignement != Align.none){
alignTo(alignement, alignTarget);
};
}
private function _onAddedToStage(_arg1:Event):void{
layout();
resize();
}
public function set forcedHeight(_arg1:uint):void{
_forcedHeight = _arg1;
}
public function set forcedWidth(_arg1:uint):void{
_forcedWidth = _arg1;
}
}
}//package com.google.analytics.debug
Section 59
//Warning (com.google.analytics.debug.Warning)
package com.google.analytics.debug {
import flash.events.*;
import flash.utils.*;
public class Warning extends Label {
private var _timer:Timer;
public function Warning(_arg1:String="", _arg2:uint=3000){
super(_arg1, "uiWarning", Style.warningColor, Align.top, false);
margin.top = 32;
if (_arg2 > 0){
_timer = new Timer(_arg2, 1);
_timer.start();
_timer.addEventListener(TimerEvent.TIMER_COMPLETE, onComplete, false, 0, true);
};
}
public function onComplete(_arg1:TimerEvent):void{
close();
}
override public function onLink(_arg1:TextEvent):void{
switch (_arg1.text){
case "hide":
close();
break;
};
}
public function close():void{
if (parent != null){
parent.removeChild(this);
};
}
}
}//package com.google.analytics.debug
Section 60
//VisualDebugMode (com.google.analytics.debug.VisualDebugMode)
package com.google.analytics.debug {
public class VisualDebugMode {
private var _value:int;
private var _name:String;
public static const advanced:VisualDebugMode = new VisualDebugMode(1, "advanced");
;
public static const geek:VisualDebugMode = new VisualDebugMode(2, "geek");
;
public static const basic:VisualDebugMode = new VisualDebugMode(0, "basic");
;
public function VisualDebugMode(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.debug
Section 61
//AnalyticsEvent (com.google.analytics.events.AnalyticsEvent)
package com.google.analytics.events {
import flash.events.*;
import com.google.analytics.*;
public class AnalyticsEvent extends Event {
public var tracker:AnalyticsTracker;
public static const READY:String = "ready";
public function AnalyticsEvent(_arg1:String, _arg2:AnalyticsTracker, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.tracker = _arg2;
}
override public function clone():Event{
return (new AnalyticsEvent(type, tracker, bubbles, cancelable));
}
}
}//package com.google.analytics.events
Section 62
//AdSenseGlobals (com.google.analytics.external.AdSenseGlobals)
package com.google.analytics.external {
import com.google.analytics.debug.*;
public class AdSenseGlobals extends JavascriptProxy {
private var _gaGlobalVerified:Boolean;// = false
public static var gaGlobal_js:XML = <script>
<![CDATA[
function()
{
try
{
gaGlobal
}
catch(e)
{
gaGlobal = {} ;
}
}
]]>
</script>
;
public function AdSenseGlobals(_arg1:DebugConfiguration){
_gaGlobalVerified = false;
super(_arg1);
}
public function set vid(_arg1:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.vid", _arg1);
}
public function get hid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.hid"));
}
public function get dh():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.dh"));
}
public function get gaGlobal():Object{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal"));
}
public function set hid(_arg1:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.hid", _arg1);
}
public function get sid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.sid"));
}
private function _verify():void{
if (!_gaGlobalVerified){
executeBlock(gaGlobal_js);
_gaGlobalVerified = true;
};
}
public function get vid():String{
if (!isAvailable()){
return (null);
};
_verify();
return (getProperty("gaGlobal.vid"));
}
public function set sid(_arg1:String):void{
if (!isAvailable()){
return;
};
_verify();
setProperty("gaGlobal.sid", _arg1);
}
}
}//package com.google.analytics.external
Section 63
//HTMLDOM (com.google.analytics.external.HTMLDOM)
package com.google.analytics.external {
import com.google.analytics.debug.*;
public class HTMLDOM extends JavascriptProxy {
private var _referrer:String;
private var _protocol:String;
private var _host:String;
private var _location:String;
private var _pathname:String;
private var _title:String;
private var _characterSet:String;
private var _search:String;
private var _language:String;
private var _colorDepth:String;
public static var cache_properties_js:XML = <script>
<![CDATA[
function()
{
var obj = {};
obj.host = document.location.host;
obj.language = navigator.language ? navigator.language : navigator.browserLanguage;
obj.characterSet = document.characterSet ? document.characterSet : document.charset;
obj.colorDepth = window.screen.colorDepth;
obj.location = document.location.toString();
obj.pathname = document.location.pathname;
obj.protocol = document.location.protocol;
obj.search = document.location.search;
obj.referrer = document.referrer;
obj.title = document.title;
return obj;
}
]]>
</script>
;
public function HTMLDOM(_arg1:DebugConfiguration){
super(_arg1);
}
public function get search():String{
if (_search){
return (_search);
};
if (!isAvailable()){
return (null);
};
_search = getProperty("document.location.search");
return (_search);
}
public function get location():String{
if (_location){
return (_location);
};
if (!isAvailable()){
return (null);
};
_location = getPropertyString("document.location");
return (_location);
}
public function get pathname():String{
if (_pathname){
return (_pathname);
};
if (!isAvailable()){
return (null);
};
_pathname = getProperty("document.location.pathname");
return (_pathname);
}
public function get referrer():String{
if (_referrer){
return (_referrer);
};
if (!isAvailable()){
return (null);
};
_referrer = getProperty("document.referrer");
return (_referrer);
}
public function get protocol():String{
if (_protocol){
return (_protocol);
};
if (!isAvailable()){
return (null);
};
_protocol = getProperty("document.location.protocol");
return (_protocol);
}
public function cacheProperties():void{
var _local1:Object;
if (!isAvailable()){
return;
};
_local1 = call(cache_properties_js);
if (_local1){
_host = _local1.host;
_language = _local1.language;
_characterSet = _local1.characterSet;
_colorDepth = _local1.colorDepth;
_location = _local1.location;
_pathname = _local1.pathname;
_protocol = _local1.protocol;
_search = _local1.search;
_referrer = _local1.referrer;
_title = _local1.title;
};
}
public function get colorDepth():String{
if (_colorDepth){
return (_colorDepth);
};
if (!isAvailable()){
return (null);
};
_colorDepth = getProperty("window.screen.colorDepth");
return (_colorDepth);
}
public function get title():String{
if (_title){
return (_title);
};
if (!isAvailable()){
return (null);
};
_title = getProperty("document.title");
return (_title);
}
public function get host():String{
if (_host){
return (_host);
};
if (!isAvailable()){
return (null);
};
_host = getProperty("document.location.host");
return (_host);
}
public function get characterSet():String{
var _local1:String;
if (_characterSet){
return (_characterSet);
};
if (!isAvailable()){
return (null);
};
_local1 = getProperty("document.characterSet");
if (_local1 == null){
_local1 = getProperty("document.charset");
};
_characterSet = _local1;
return (_characterSet);
}
public function get language():String{
var _local1:String;
if (_language){
return (_language);
};
if (!isAvailable()){
return (null);
};
_local1 = getProperty("navigator.language");
if (_local1 == null){
_local1 = getProperty("navigator.browserLanguage");
};
_language = _local1;
return (_language);
}
}
}//package com.google.analytics.external
Section 64
//JavascriptProxy (com.google.analytics.external.JavascriptProxy)
package com.google.analytics.external {
import com.google.analytics.debug.*;
import flash.external.*;
import flash.system.*;
public class JavascriptProxy {
private var _notAvailableWarning:Boolean;// = true
private var _debug:DebugConfiguration;
public static var setProperty_js:XML = <script>
<![CDATA[
function( path , value )
{
var paths;
var prop;
if( path.indexOf(".") > 0 )
{
paths = path.split(".");
prop = paths.pop() ;
}
else
{
paths = [];
prop = path;
}
var target = window ;
var len = paths.length ;
for( var i = 0 ; i < len ; i++ )
{
target = target[ paths[i] ] ;
}
target[ prop ] = value ;
}
]]>
</script>
;
public static var hasProperty_js:XML = <script>
<![CDATA[
function( path )
{
var paths;
if( path.indexOf(".") > 0 )
{
paths = path.split(".");
}
else
{
paths = [path];
}
var target = window ;
var len = paths.length ;
for( var i = 0 ; i < len ; i++ )
{
target = target[ paths[i] ] ;
}
if( target )
{
return true;
}
else
{
return false;
}
}
]]>
</script>
;
public static var setPropertyRef_js:XML = <script>
<![CDATA[
function( path , target )
{
var paths;
var prop;
if( path.indexOf(".") > 0 )
{
paths = path.split(".");
prop = paths.pop() ;
}
else
{
paths = [];
prop = path;
}
alert( "paths:"+paths.length+", prop:"+prop );
var targets;
var name;
if( target.indexOf(".") > 0 )
{
targets = target.split(".");
name = targets.pop();
}
else
{
targets = [];
name = target;
}
alert( "targets:"+targets.length+", name:"+name );
var root = window;
var len = paths.length;
for( var i = 0 ; i < len ; i++ )
{
root = root[ paths[i] ] ;
}
var ref = window;
var depth = targets.length;
for( var j = 0 ; j < depth ; j++ )
{
ref = ref[ targets[j] ] ;
}
root[ prop ] = ref[name] ;
}
]]>
</script>
;
public function JavascriptProxy(_arg1:DebugConfiguration){
_notAvailableWarning = true;
super();
_debug = _arg1;
}
public function getProperty(_arg1:String){
return (call((_arg1 + ".valueOf")));
}
public function hasProperty(_arg1:String):Boolean{
return (call(hasProperty_js, _arg1));
}
public function setProperty(_arg1:String, _arg2):void{
call(setProperty_js, _arg1, _arg2);
}
public function executeBlock(_arg1:String):void{
var data = _arg1;
if (isAvailable()){
try {
ExternalInterface.call(data);
} catch(e:SecurityError) {
if (_debug.javascript){
_debug.warning("ExternalInterface is not allowed.\nEnsure that allowScriptAccess is set to \"always\" in the Flash embed HTML.");
};
} catch(e:Error) {
if (_debug.javascript){
_debug.warning(("ExternalInterface failed to make the call\nreason: " + e.message));
};
};
};
}
public function getPropertyString(_arg1:String):String{
return (call((_arg1 + ".toString")));
}
public function setPropertyByReference(_arg1:String, _arg2:String):void{
call(setPropertyRef_js, _arg1, _arg2);
}
public function call(_arg1:String, ... _args){
var output:String;
var functionName = _arg1;
var args = _args;
if (isAvailable()){
try {
if (((_debug.javascript) && (_debug.verbose))){
output = "";
output = ("Flash->JS: " + functionName);
output = (output + "( ");
if (args.length > 0){
output = (output + args.join(","));
};
output = (output + " )");
_debug.info(output);
};
args.unshift(functionName);
return (ExternalInterface.call.apply(ExternalInterface, args));
} catch(e:SecurityError) {
if (_debug.javascript){
_debug.warning("ExternalInterface is not allowed.\nEnsure that allowScriptAccess is set to \"always\" in the Flash embed HTML.");
};
} catch(e:Error) {
if (_debug.javascript){
_debug.warning(("ExternalInterface failed to make the call\nreason: " + e.message));
};
};
};
return (null);
}
public function isAvailable():Boolean{
var _local1:Boolean;
_local1 = ExternalInterface.available;
if (((_local1) && ((Capabilities.playerType == "External")))){
_local1 = false;
};
if (((((!(_local1)) && (_debug.javascript))) && (_notAvailableWarning))){
_debug.warning("ExternalInterface is not available.");
_notAvailableWarning = false;
};
return (_local1);
}
}
}//package com.google.analytics.external
Section 65
//Environment (com.google.analytics.utils.Environment)
package com.google.analytics.utils {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.external.*;
import flash.system.*;
public class Environment {
private var _dom:HTMLDOM;
private var _appName:String;
private var _debug:DebugConfiguration;
private var _appVersion:Version;
private var _url:String;
private var _protocol:Protocols;
private var _userAgent:UserAgent;
public function Environment(_arg1:String="", _arg2:String="", _arg3:String="", _arg4:DebugConfiguration=null, _arg5:HTMLDOM=null){
var _local6:Version;
super();
if (_arg2 == ""){
if (isAIR()){
_arg2 = "AIR";
} else {
_arg2 = "Flash";
};
};
if (_arg3 == ""){
_local6 = flashVersion;
} else {
_local6 = Version.fromString(_arg3);
};
_url = _arg1;
_appName = _arg2;
_appVersion = _local6;
_debug = _arg4;
_dom = _arg5;
}
public function isAIR():Boolean{
return ((((playerType == "Desktop")) && ((Security.sandboxType.toString() == "application"))));
}
public function get playerType():String{
return (Capabilities.playerType);
}
public function get locationSearch():String{
var _local1:String;
_local1 = _dom.search;
if (_local1){
return (_local1);
};
return ("");
}
public function get protocol():Protocols{
if (!_protocol){
_findProtocol();
};
return (_protocol);
}
public function get flashVersion():Version{
var _local1:Version;
_local1 = Version.fromString(Capabilities.version.split(" ")[1], ",");
return (_local1);
}
public function get screenWidth():Number{
return (Capabilities.screenResolutionX);
}
public function get languageEncoding():String{
var _local1:String;
if (System.useCodePage){
_local1 = _dom.characterSet;
if (_local1){
return (_local1);
};
return ("-");
};
return ("UTF-8");
}
public function get appName():String{
return (_appName);
}
public function get screenColorDepth():String{
var _local1:String;
var _local2:String;
switch (Capabilities.screenColor){
case "bw":
_local1 = "1";
break;
case "gray":
_local1 = "2";
break;
case "color":
default:
_local1 = "24";
};
_local2 = _dom.colorDepth;
if (_local2){
_local1 = _local2;
};
return (_local1);
}
private function _findProtocol():void{
var _local1:Protocols;
var _local2:String;
var _local3:String;
var _local4:String;
var _local5:String;
_local1 = Protocols.none;
if (_url != ""){
_local4 = _url.toLowerCase();
_local5 = _local4.substr(0, 5);
switch (_local5){
case "file:":
_local1 = Protocols.file;
break;
case "http:":
_local1 = Protocols.HTTP;
break;
case "https":
if (_local4.charAt(5) == ":"){
_local1 = Protocols.HTTPS;
};
break;
default:
_protocol = Protocols.none;
};
};
_local2 = _dom.protocol;
_local3 = (_local1.toString() + ":").toLowerCase();
if (((((_local2) && (!((_local2 == _local3))))) && (_debug))){
_debug.warning(((("Protocol mismatch: SWF=" + _local3) + ", DOM=") + _local2));
};
_protocol = _local1;
}
public function get locationSWFPath():String{
return (_url);
}
public function get platform():String{
var _local1:String;
_local1 = Capabilities.manufacturer;
return (_local1.split("Adobe ")[1]);
}
public function get operatingSystem():String{
return (Capabilities.os);
}
public function set appName(_arg1:String):void{
_appName = _arg1;
userAgent.applicationProduct = _arg1;
}
public function get userAgent():UserAgent{
if (!_userAgent){
_userAgent = new UserAgent(this, appName, appVersion.toString(4));
};
return (_userAgent);
}
ga_internal function set url(_arg1:String):void{
_url = _arg1;
}
public function get referrer():String{
var _local1:String;
_local1 = _dom.referrer;
if (_local1){
return (_local1);
};
if (protocol == Protocols.file){
return ("localhost");
};
return ("");
}
public function isInHTML():Boolean{
return ((Capabilities.playerType == "PlugIn"));
}
public function get language():String{
var _local1:String;
var _local2:String;
_local1 = _dom.language;
_local2 = Capabilities.language;
if (_local1){
if ((((_local1.length > _local2.length)) && ((_local1.substr(0, _local2.length) == _local2)))){
_local2 = _local1;
};
};
return (_local2);
}
public function get domainName():String{
var _local1:String;
var _local2:String;
var _local3:int;
if ((((protocol == Protocols.HTTP)) || ((protocol == Protocols.HTTPS)))){
_local1 = _url.toLowerCase();
if (protocol == Protocols.HTTP){
_local2 = _local1.split("http://").join("");
} else {
if (protocol == Protocols.HTTPS){
_local2 = _local1.split("https://").join("");
};
};
_local3 = _local2.indexOf("/");
if (_local3 > -1){
_local2 = _local2.substring(0, _local3);
};
return (_local2);
};
if (protocol == Protocols.file){
return ("localhost");
};
return ("");
}
public function set userAgent(_arg1:UserAgent):void{
_userAgent = _arg1;
}
public function set appVersion(_arg1:Version):void{
_appVersion = _arg1;
userAgent.applicationVersion = _arg1.toString(4);
}
public function get screenHeight():Number{
return (Capabilities.screenResolutionY);
}
public function get locationPath():String{
var _local1:String;
_local1 = _dom.pathname;
if (_local1){
return (_local1);
};
return ("");
}
public function get documentTitle():String{
var _local1:String;
_local1 = _dom.title;
if (_local1){
return (_local1);
};
return ("");
}
public function get appVersion():Version{
return (_appVersion);
}
}
}//package com.google.analytics.utils
Section 66
//Protocols (com.google.analytics.utils.Protocols)
package com.google.analytics.utils {
public class Protocols {
private var _value:int;
private var _name:String;
public static const none:Protocols = new Protocols(0, "none");
;
public static const HTTPS:Protocols = new Protocols(3, "HTTPS");
;
public static const file:Protocols = new Protocols(1, "file");
;
public static const HTTP:Protocols = new Protocols(2, "HTTP");
;
public function Protocols(_arg1:int=0, _arg2:String=""){
_value = _arg1;
_name = _arg2;
}
public function valueOf():int{
return (_value);
}
public function toString():String{
return (_name);
}
}
}//package com.google.analytics.utils
Section 67
//Timespan (com.google.analytics.utils.Timespan)
package com.google.analytics.utils {
public class Timespan {
public static var sixmonths:Number = 15768000;
public static var twoyears:Number = 63072000;
public static var thirtyminutes:Number = 1800;
}
}//package com.google.analytics.utils
Section 68
//URL (com.google.analytics.utils.URL)
package com.google.analytics.utils {
public class URL {
private var _url:String;
public function URL(_arg1:String=""){
_url = _arg1.toLowerCase();
}
public function get domain():String{
var _local1:Array;
if (((!((hostName == ""))) && ((hostName.indexOf(".") > -1)))){
_local1 = hostName.split(".");
switch (_local1.length){
case 2:
return (hostName);
case 3:
if (_local1[1] == "co"){
return (hostName);
};
_local1.shift();
return (_local1.join("."));
case 4:
_local1.shift();
return (_local1.join("."));
};
};
return ("");
}
public function get path():String{
var _local1:String = _url;
if (_local1.indexOf("://") > -1){
_local1 = _local1.split("://")[1];
};
if (_local1.indexOf(hostName) == 0){
_local1 = _local1.substr(hostName.length);
};
if (_local1.indexOf("?") > -1){
_local1 = _local1.split("?")[0];
};
if (_local1.charAt(0) != "/"){
_local1 = ("/" + _local1);
};
return (_local1);
}
public function get protocol():Protocols{
var _local1:String = _url.split("://")[0];
switch (_local1){
case "file":
return (Protocols.file);
case "http":
return (Protocols.HTTP);
case "https":
return (Protocols.HTTPS);
default:
return (Protocols.none);
};
}
public function get hostName():String{
var _local1:String = _url;
if (_local1.indexOf("://") > -1){
_local1 = _local1.split("://")[1];
};
if (_local1.indexOf("/") > -1){
_local1 = _local1.split("/")[0];
};
if (_local1.indexOf("?") > -1){
_local1 = _local1.split("?")[0];
};
if ((((protocol == Protocols.file)) || ((protocol == Protocols.none)))){
return ("");
};
return (_local1);
}
public function get subDomain():String{
if (((!((domain == ""))) && (!((domain == hostName))))){
return (hostName.split(("." + domain)).join(""));
};
return ("");
}
public function get search():String{
var _local1:String = _url;
if (_local1.indexOf("://") > -1){
_local1 = _local1.split("://")[1];
};
if (_local1.indexOf(hostName) == 0){
_local1 = _local1.substr(hostName.length);
};
if (_local1.indexOf("?") > -1){
_local1 = _local1.split("?")[1];
} else {
_local1 = "";
};
return (_local1);
}
}
}//package com.google.analytics.utils
Section 69
//UserAgent (com.google.analytics.utils.UserAgent)
package com.google.analytics.utils {
import com.google.analytics.core.*;
import flash.system.*;
public class UserAgent {
private var _version:Version;
private var _localInfo:Environment;
private var _applicationProduct:String;
public static var minimal:Boolean = false;
public function UserAgent(_arg1:Environment, _arg2:String="", _arg3:String=""){
_localInfo = _arg1;
applicationProduct = _arg2;
_version = Version.fromString(_arg3);
}
public function get tamarinProductToken():String{
if (UserAgent.minimal){
return ("");
};
if (System.vmVersion){
return (("Tamarin/" + Utils.trim(System.vmVersion, true)));
};
return ("");
}
public function set applicationProduct(_arg1:String):void{
_applicationProduct = _arg1;
}
public function get applicationVersion():String{
return (_version.toString(2));
}
public function get applicationProductToken():String{
var _local1:String;
_local1 = applicationProduct;
if (applicationVersion != ""){
_local1 = (_local1 + ("/" + applicationVersion));
};
return (_local1);
}
public function get vendorProductToken():String{
var _local1:String;
_local1 = "";
if (_localInfo.isAIR()){
_local1 = (_local1 + "AIR");
} else {
_local1 = (_local1 + "FlashPlayer");
};
_local1 = (_local1 + "/");
_local1 = (_local1 + _version.toString(3));
return (_local1);
}
public function toString():String{
var _local1:String;
_local1 = "";
_local1 = (_local1 + applicationProductToken);
if (applicationComment != ""){
_local1 = (_local1 + (" " + applicationComment));
};
if (tamarinProductToken != ""){
_local1 = (_local1 + (" " + tamarinProductToken));
};
if (vendorProductToken != ""){
_local1 = (_local1 + (" " + vendorProductToken));
};
return (_local1);
}
public function get applicationComment():String{
var _local1:Array;
_local1 = [];
_local1.push(_localInfo.platform);
_local1.push(_localInfo.playerType);
if (!UserAgent.minimal){
_local1.push(_localInfo.operatingSystem);
_local1.push(_localInfo.language);
};
if (Capabilities.isDebugger){
_local1.push("DEBUG");
};
if (_local1.length > 0){
return ((("(" + _local1.join("; ")) + ")"));
};
return ("");
}
public function set applicationVersion(_arg1:String):void{
_version = Version.fromString(_arg1);
}
public function get applicationProduct():String{
return (_applicationProduct);
}
}
}//package com.google.analytics.utils
Section 70
//Variables (com.google.analytics.utils.Variables)
package com.google.analytics.utils {
import flash.net.*;
public dynamic class Variables {
public var post:Array;
public var URIencode:Boolean;
public var pre:Array;
public var sort:Boolean;// = true
public function Variables(_arg1:String=null, _arg2:Array=null, _arg3:Array=null){
pre = [];
post = [];
super();
if (_arg1){
decode(_arg1);
};
if (_arg2){
this.pre = _arg2;
};
if (_arg3){
this.post = _arg3;
};
}
private function _join(_arg1:Variables):void{
var _local2:String;
if (!_arg1){
return;
};
for (_local2 in _arg1) {
this[_local2] = _arg1[_local2];
};
}
public function join(... _args):void{
var _local2:int = _args.length;
var _local3:int;
while (_local3 < _local2) {
if (!(_args[_local3] is Variables)){
} else {
_join(_args[_local3]);
};
_local3++;
};
}
public function toString():String{
var _local2:String;
var _local3:String;
var _local4:String;
var _local5:int;
var _local6:int;
var _local7:String;
var _local8:String;
var _local1:Array = [];
for (_local3 in this) {
_local2 = this[_local3];
if (URIencode){
_local2 = encodeURI(_local2);
};
_local1.push(((_local3 + "=") + _local2));
};
if (sort){
_local1.sort();
};
if (pre.length > 0){
pre.reverse();
_local5 = 0;
while (_local5 < pre.length) {
_local7 = pre[_local5];
_local6 = 0;
while (_local6 < _local1.length) {
_local4 = _local1[_local6];
if (_local4.indexOf(_local7) == 0){
_local1.unshift(_local1.splice(_local6, 1)[0]);
};
_local6++;
};
_local5++;
};
pre.reverse();
};
if (post.length > 0){
_local5 = 0;
while (_local5 < post.length) {
_local8 = post[_local5];
_local6 = 0;
while (_local6 < _local1.length) {
_local4 = _local1[_local6];
if (_local4.indexOf(_local8) == 0){
_local1.push(_local1.splice(_local6, 1)[0]);
};
_local6++;
};
_local5++;
};
};
return (_local1.join("&"));
}
public function decode(_arg1:String):void{
var _local2:Array;
var _local3:String;
var _local4:String;
var _local5:String;
var _local6:Array;
if (_arg1 == ""){
return;
};
if (_arg1.indexOf("&") > -1){
_local2 = _arg1.split("&");
} else {
_local2 = [_arg1];
};
var _local7:int;
while (_local7 < _local2.length) {
_local3 = _local2[_local7];
if (_local3.indexOf("=") > -1){
_local6 = _local3.split("=");
_local4 = _local6[0];
_local5 = decodeURI(_local6[1]);
this[_local4] = _local5;
};
_local7++;
};
}
public function toURLVariables():URLVariables{
var _local2:String;
var _local1:URLVariables = new URLVariables();
for (_local2 in this) {
_local1[_local2] = this[_local2];
};
return (_local1);
}
}
}//package com.google.analytics.utils
Section 71
//Version (com.google.analytics.utils.Version)
package com.google.analytics.utils {
public class Version {
private var _maxBuild:uint;// = 0xFF
private var _maxMinor:uint;// = 15
private var _maxMajor:uint;// = 15
private var _revision:uint;
private var _separator:String;// = "."
private var _maxRevision:uint;// = 0xFFFF
private var _build:uint;
private var _minor:uint;
private var _major:uint;
public function Version(_arg1:uint=0, _arg2:uint=0, _arg3:uint=0, _arg4:uint=0){
var _local5:Version;
_maxMajor = 15;
_maxMinor = 15;
_maxBuild = 0xFF;
_maxRevision = 0xFFFF;
_separator = ".";
super();
if ((((((((_arg1 > _maxMajor)) && ((_arg2 == 0)))) && ((_arg3 == 0)))) && ((_arg4 == 0)))){
_local5 = Version.fromNumber(_arg1);
_arg1 = _local5.major;
_arg2 = _local5.minor;
_arg3 = _local5.build;
_arg4 = _local5.revision;
};
this.major = _arg1;
this.minor = _arg2;
this.build = _arg3;
this.revision = _arg4;
}
public function toString(_arg1:int=0):String{
var _local2:Array;
if ((((_arg1 <= 0)) || ((_arg1 > 4)))){
_arg1 = getFields();
};
switch (_arg1){
case 1:
_local2 = [major];
break;
case 2:
_local2 = [major, minor];
break;
case 3:
_local2 = [major, minor, build];
break;
case 4:
default:
_local2 = [major, minor, build, revision];
};
return (_local2.join(_separator));
}
public function get revision():uint{
return (_revision);
}
public function set build(_arg1:uint):void{
_build = Math.min(_arg1, _maxBuild);
}
public function set minor(_arg1:uint):void{
_minor = Math.min(_arg1, _maxMinor);
}
public function get build():uint{
return (_build);
}
public function set major(_arg1:uint):void{
_major = Math.min(_arg1, _maxMajor);
}
public function get minor():uint{
return (_minor);
}
public function valueOf():uint{
return (((((major << 28) | (minor << 24)) | (build << 16)) | revision));
}
public function get major():uint{
return (_major);
}
public function set revision(_arg1:uint):void{
_revision = Math.min(_arg1, _maxRevision);
}
private function getFields():int{
var _local1:int;
_local1 = 4;
if (revision == 0){
_local1--;
};
if ((((_local1 == 3)) && ((build == 0)))){
_local1--;
};
if ((((_local1 == 2)) && ((minor == 0)))){
_local1--;
};
return (_local1);
}
public function equals(_arg1):Boolean{
if (!(_arg1 is Version)){
return (false);
};
if ((((((((_arg1.major == major)) && ((_arg1.minor == minor)))) && ((_arg1.build == build)))) && ((_arg1.revision == revision)))){
return (true);
};
return (false);
}
public static function fromString(_arg1:String="", _arg2:String="."):Version{
var _local3:Version;
var _local4:Array;
_local3 = new (Version);
if ((((_arg1 == "")) || ((_arg1 == null)))){
return (_local3);
};
if (_arg1.indexOf(_arg2) > -1){
_local4 = _arg1.split(_arg2);
_local3.major = parseInt(_local4[0]);
_local3.minor = parseInt(_local4[1]);
_local3.build = parseInt(_local4[2]);
_local3.revision = parseInt(_local4[3]);
} else {
_local3.major = parseInt(_arg1);
};
return (_local3);
}
public static function fromNumber(_arg1:Number=0):Version{
var _local2:Version;
_local2 = new (Version);
if (((((((((((isNaN(_arg1)) || ((_arg1 == 0)))) || ((_arg1 < 0)))) || ((_arg1 == Number.MAX_VALUE)))) || ((_arg1 == Number.POSITIVE_INFINITY)))) || ((_arg1 == Number.NEGATIVE_INFINITY)))){
return (_local2);
};
_local2.major = (_arg1 >>> 28);
_local2.minor = ((_arg1 & 251658240) >>> 24);
_local2.build = ((_arg1 & 0xFF0000) >>> 16);
_local2.revision = (_arg1 & 0xFFFF);
return (_local2);
}
}
}//package com.google.analytics.utils
Section 72
//Bridge (com.google.analytics.v4.Bridge)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.external.*;
public class Bridge implements GoogleAnalyticsAPI {
private var _debug:DebugConfiguration;
private var _proxy:JavascriptProxy;
private var _jsContainer:String;// = "_GATracker"
private var _hasGATracker:Boolean;// = false
private var _account:String;
private static var _linkTrackingObject_js:XML = <script>
<![CDATA[
function( container , target )
{
var targets ;
var name ;
if( target.indexOf(".") > 0 )
{
targets = target.split(".");
name = targets.pop();
}
else
{
targets = [];
name = target;
}
var ref = window;
var depth = targets.length;
for( var j = 0 ; j < depth ; j++ )
{
ref = ref[ targets[j] ] ;
}
window[container][target] = ref[name] ;
}
]]>
</script>
;
private static var _createTrackingObject_js:XML = <script>
<![CDATA[
function( acct )
{
_GATracker[acct] = _gat._getTracker(acct);
}
]]>
</script>
;
private static var _injectTrackingObject_js:XML = <script>
<![CDATA[
function()
{
try
{
_GATracker
}
catch(e)
{
_GATracker = {};
}
}
]]>
</script>
;
private static var _checkGAJS_js:XML = <script>
<![CDATA[
function()
{
if( _gat && _gat._getTracker )
{
return true;
}
return false;
}
]]>
</script>
;
private static var _checkValidTrackingObject_js:XML = <script>
<![CDATA[
function(acct)
{
if( _GATracker[acct] && (_GATracker[acct]._getAccount) )
{
return true ;
}
else
{
return false;
}
}
]]>
</script>
;
public function Bridge(_arg1:String, _arg2:DebugConfiguration, _arg3:JavascriptProxy){
var _local4:String;
var _local5:String;
var _local6:String;
super();
_account = _arg1;
_debug = _arg2;
_proxy = _arg3;
if (!_checkGAJS()){
_local4 = "";
_local4 = (_local4 + "ga.js not found, be sure to check if\n");
_local4 = (_local4 + "<script src=\"http://www.google-analytics.com/ga.js\"></script>\n");
_local4 = (_local4 + "is included in the HTML.");
_debug.warning(_local4);
throw (new Error(_local4));
};
if (!_hasGATracker){
if (((_debug.javascript) && (_debug.verbose))){
_local5 = "";
_local5 = (_local5 + "The Google Analytics tracking code was not found on the container page\n");
_local5 = (_local5 + "we create it");
_debug.info(_local5, VisualDebugMode.advanced);
};
_injectTrackingObject();
};
if (Utils.validateAccount(_arg1)){
_createTrackingObject(_arg1);
} else {
if (_checkTrackingObject(_arg1)){
_linkTrackingObject(_arg1);
} else {
_local6 = "";
_local6 = (_local6 + (("JS Object \"" + _arg1) + "\" doesn't exist in DOM\n"));
_local6 = (_local6 + "Bridge object not created.");
_debug.warning(_local6);
throw (new Error(_local6));
};
};
}
public function link(_arg1:String, _arg2:Boolean=false):void{
_debug.info((((("link( " + _arg1) + ", ") + _arg2) + " )"));
_call("_link", _arg1, _arg2);
}
public function addOrganic(_arg1:String, _arg2:String):void{
_debug.info((("addOrganic( " + [_arg1, _arg2].join(", ")) + " )"));
_call("_addOrganic", _arg1);
}
public function setAllowLinker(_arg1:Boolean):void{
_debug.info((("setAllowLinker( " + _arg1) + " )"));
_call("_setAllowLinker", _arg1);
}
private function _linkTrackingObject(_arg1:String):void{
_proxy.call(_linkTrackingObject_js, _jsContainer, _arg1);
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
var _local5 = 2;
if (((_arg3) && (!((_arg3 == ""))))){
_local5 = 3;
};
if ((((_local5 == 3)) && (!(isNaN(_arg4))))){
_local5 = 4;
};
switch (_local5){
case 4:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3, _arg4].join(", ")) + " )"));
return (_call("_trackEvent", _arg1, _arg2, _arg3, _arg4));
case 3:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3].join(", ")) + " )"));
return (_call("_trackEvent", _arg1, _arg2, _arg3));
case 2:
default:
_debug.info((("trackEvent( " + [_arg1, _arg2].join(", ")) + " )"));
return (_call("_trackEvent", _arg1, _arg2));
};
}
public function setClientInfo(_arg1:Boolean):void{
_debug.info((("setClientInfo( " + _arg1) + " )"));
_call("_setClientInfo", _arg1);
}
public function trackTrans():void{
_debug.info("trackTrans()");
_call("_trackTrans");
}
public function setCookieTimeout(_arg1:int):void{
_debug.info((("setCookieTimeout( " + _arg1) + " )"));
_call("_setCookieTimeout", _arg1);
}
public function trackPageview(_arg1:String=""):void{
_debug.info((("trackPageview( " + _arg1) + " )"));
_call("_trackPageview", _arg1);
}
public function getClientInfo():Boolean{
_debug.info("getClientInfo()");
return (_call("_getClientInfo"));
}
private function _checkValidTrackingObject(_arg1:String):Boolean{
return (_proxy.call(_checkValidTrackingObject_js, _arg1));
}
private function _checkGAJS():Boolean{
return (_proxy.call(_checkGAJS_js));
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
_debug.warning((((("linkByPost( " + _arg1) + ", ") + _arg2) + " ) not implemented"));
}
private function _call(_arg1:String, ... _args){
_args.unshift(((((("window." + _jsContainer) + "[\"") + _account) + "\"].") + _arg1));
return (_proxy.call.apply(_proxy, _args));
}
public function hasGAJS():Boolean{
return (_checkGAJS());
}
private function _checkTrackingObject(_arg1:String):Boolean{
var _local2:Boolean = _proxy.hasProperty(_arg1);
var _local3:Boolean = _proxy.hasProperty((_arg1 + "._getAccount"));
return (((_local2) && (_local3)));
}
public function resetSession():void{
_debug.warning("resetSession() not implemented");
}
public function getDetectTitle():Boolean{
_debug.info("getDetectTitle()");
return (_call("_getDetectTitle"));
}
public function setCampNameKey(_arg1:String):void{
_debug.info((("setCampNameKey( " + _arg1) + " )"));
_call("_setCampNameKey", _arg1);
}
public function setDetectFlash(_arg1:Boolean):void{
_debug.info((("setDetectFlash( " + _arg1) + " )"));
_call("_setDetectFlash", _arg1);
}
public function createEventTracker(_arg1:String):EventTracker{
_debug.info((("createEventTracker( " + _arg1) + " )"));
return (new EventTracker(_arg1, this));
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
_debug.info((("addItem( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6].join(", ")) + " )"));
_call("_addItem", _arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
public function clearIgnoredOrganic():void{
_debug.info("clearIgnoredOrganic()");
_call("_clearIgnoreOrganic");
}
public function setVar(_arg1:String):void{
_debug.info((("setVar( " + _arg1) + " )"));
_call("_setVar", _arg1);
}
public function setDomainName(_arg1:String):void{
_debug.info((("setDomainName( " + _arg1) + " )"));
_call("_setDomainName", _arg1);
}
public function hasTrackingAccount(_arg1:String):Boolean{
if (Utils.validateAccount(_arg1)){
return (_checkValidTrackingObject(_arg1));
};
return (_checkTrackingObject(_arg1));
}
public function setCampSourceKey(_arg1:String):void{
_debug.info((("setCampSourceKey( " + _arg1) + " )"));
_call("_setCampSourceKey", _arg1);
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object{
_debug.info((("addTrans( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8].join(", ")) + " )"));
_call("_addTrans", _arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
return (null);
}
public function setCampContentKey(_arg1:String):void{
_debug.info((("setCampContentKey( " + _arg1) + " )"));
_call("_setCampContentKey", _arg1);
}
public function setLocalServerMode():void{
_debug.info("setLocalServerMode()");
_call("_setLocalServerMode");
}
public function getLocalGifPath():String{
_debug.info("getLocalGifPath()");
return (_call("_getLocalGifPath"));
}
public function clearIgnoredRef():void{
_debug.info("clearIgnoredRef()");
_call("_clearIgnoreRef");
}
public function setAllowAnchor(_arg1:Boolean):void{
_debug.info((("setAllowAnchor( " + _arg1) + " )"));
_call("_setAllowAnchor", _arg1);
}
public function setLocalGifPath(_arg1:String):void{
_debug.info((("setLocalGifPath( " + _arg1) + " )"));
_call("_setLocalGifPath", _arg1);
}
public function getVersion():String{
_debug.info("getVersion()");
return (_call("_getVersion"));
}
private function _injectTrackingObject():void{
_proxy.executeBlock(_injectTrackingObject_js);
_hasGATracker = true;
}
public function setCookiePath(_arg1:String):void{
_debug.info((("setCookiePath( " + _arg1) + " )"));
_call("_setCookiePath", _arg1);
}
public function setSampleRate(_arg1:Number):void{
_debug.info((("setSampleRate( " + _arg1) + " )"));
_call("_setSampleRate", _arg1);
}
public function setAllowHash(_arg1:Boolean):void{
_debug.info((("setAllowHash( " + _arg1) + " )"));
_call("_setAllowHash", _arg1);
}
public function addIgnoredOrganic(_arg1:String):void{
_debug.info((("addIgnoredOrganic( " + _arg1) + " )"));
_call("_addIgnoredOrganic", _arg1);
}
public function setCampNOKey(_arg1:String):void{
_debug.info((("setCampNOKey( " + _arg1) + " )"));
_call("_setCampNOKey", _arg1);
}
public function cookiePathCopy(_arg1:String):void{
_debug.info((("cookiePathCopy( " + _arg1) + " )"));
_call("_cookiePathCopy", _arg1);
}
public function setLocalRemoteServerMode():void{
_debug.info("setLocalRemoteServerMode()");
_call("_setLocalRemoteServerMode");
}
public function getServiceMode():ServerOperationMode{
_debug.info("getServiceMode()");
return (_call("_getServiceMode"));
}
public function setDetectTitle(_arg1:Boolean):void{
_debug.info((("setDetectTitle( " + _arg1) + " )"));
_call("_setDetectTitle", _arg1);
}
private function _createTrackingObject(_arg1:String):void{
_proxy.call(_createTrackingObject_js, _arg1);
}
public function setCampaignTrack(_arg1:Boolean):void{
_debug.info((("setCampaignTrack( " + _arg1) + " )"));
_call("_setCampaignTrack", _arg1);
}
public function clearOrganic():void{
_debug.info("clearOrganic()");
_call("_clearOrganic");
}
public function setCampTermKey(_arg1:String):void{
_debug.info((("setCampTermKey( " + _arg1) + " )"));
_call("_setCampTermKey", _arg1);
}
public function getDetectFlash():Boolean{
_debug.info("getDetectFlash()");
return (_call("_getDetectFlash"));
}
public function setCampMediumKey(_arg1:String):void{
_debug.info((("setCampMediumKey( " + _arg1) + " )"));
_call("_setCampMediumKey", _arg1);
}
public function addIgnoredRef(_arg1:String):void{
_debug.info((("addIgnoredRef( " + _arg1) + " )"));
_call("_addIgnoredRef", _arg1);
}
public function setSessionTimeout(_arg1:int):void{
_debug.info((("setSessionTimeout( " + _arg1) + " )"));
_call("_setSessionTimeout", _arg1);
}
public function setRemoteServerMode():void{
_debug.info("setRemoteServerMode()");
_call("_setRemoteServerMode");
}
public function getAccount():String{
_debug.info("getAccount()");
return (_call("_getAccount"));
}
}
}//package com.google.analytics.v4
Section 73
//Configuration (com.google.analytics.v4.Configuration)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.utils.*;
import com.google.analytics.campaign.*;
public class Configuration {
public var serverMode:ServerOperationMode;
public var detectFlash:Boolean;// = true
public var allowLocalTracking:Boolean;// = true
public var secureRemoteGIFpath:String;// = "https://ssl.google-analytics.com/__utm.gif"
public var hasSiteOverlay:Boolean;// = false
private var _version:String;// = "4.3as"
public var allowDomainHash:Boolean;// = true
public var detectClientInfo:Boolean;// = true
public var idleLoop:Number;// = 30
public var isTrackOutboundSubdomains:Boolean;// = false
public var cookiePath:String;// = "/"
public var transactionFieldDelim:String;// = "|"
private var _organic:Organic;
private var _cookieName:String;// = "analytics"
public var campaignKey:CampaignKey;
public var google:String;// = "google"
public var googleCsePath:String;// = "cse"
public var bucketCapacity:Number;// = 10
private var _sampleRate:Number;// = 1
public var remoteGIFpath:String;// = "http://www.google-analytics.com/__utm.gif"
public var googleSearchParam:String;// = "q"
public var allowLinker:Boolean;// = false
public var maxOutboundLinkExamined:Number;// = 1000
private var _debug:DebugConfiguration;
private var _trackingLimitPerSession:int;// = 500
private var _domain:Domain;
public var allowAnchor:Boolean;// = false
public var tokenCliff:int;// = 10
public var sessionTimeout:Number;
public var idleTimeout:Number;// = 60
public var campaignTracking:Boolean;// = true
public var domainName:String;// = ""
public var detectTitle:Boolean;// = true
public var tokenRate:Number;// = 0.2
public var conversionTimeout:Number;
public var localGIFpath:String;// = "/__utm.gif"
public function Configuration(_arg1:DebugConfiguration=null){
_version = "4.3as";
_sampleRate = 1;
_trackingLimitPerSession = 500;
_organic = new Organic();
googleCsePath = "cse";
googleSearchParam = "q";
google = "google";
_cookieName = "analytics";
allowDomainHash = true;
allowAnchor = false;
allowLinker = false;
hasSiteOverlay = false;
tokenRate = 0.2;
conversionTimeout = Timespan.sixmonths;
sessionTimeout = Timespan.thirtyminutes;
idleLoop = 30;
idleTimeout = 60;
maxOutboundLinkExamined = 1000;
tokenCliff = 10;
bucketCapacity = 10;
detectClientInfo = true;
detectFlash = true;
detectTitle = true;
campaignKey = new CampaignKey();
campaignTracking = true;
isTrackOutboundSubdomains = false;
serverMode = ServerOperationMode.remote;
localGIFpath = "/__utm.gif";
remoteGIFpath = "http://www.google-analytics.com/__utm.gif";
secureRemoteGIFpath = "https://ssl.google-analytics.com/__utm.gif";
cookiePath = "/";
transactionFieldDelim = "|";
domainName = "";
allowLocalTracking = true;
super();
_debug = _arg1;
_domain = new Domain(DomainNameMode.auto, "", _debug);
serverMode = ServerOperationMode.remote;
_initOrganicSources();
}
public function get organic():Organic{
return (_organic);
}
public function get trackingLimitPerSession():int{
return (_trackingLimitPerSession);
}
private function _initOrganicSources():void{
addOrganicSource(google, googleSearchParam);
addOrganicSource("yahoo", "p");
addOrganicSource("msn", "q");
addOrganicSource("aol", "query");
addOrganicSource("aol", "encquery");
addOrganicSource("lycos", "query");
addOrganicSource("ask", "q");
addOrganicSource("altavista", "q");
addOrganicSource("netscape", "query");
addOrganicSource("cnn", "query");
addOrganicSource("looksmart", "qt");
addOrganicSource("about", "terms");
addOrganicSource("mamma", "query");
addOrganicSource("alltheweb", "q");
addOrganicSource("gigablast", "q");
addOrganicSource("voila", "rdata");
addOrganicSource("virgilio", "qs");
addOrganicSource("live", "q");
addOrganicSource("baidu", "wd");
addOrganicSource("alice", "qs");
addOrganicSource("yandex", "text");
addOrganicSource("najdi", "q");
addOrganicSource("aol", "q");
addOrganicSource("club-internet", "q");
addOrganicSource("mama", "query");
addOrganicSource("seznam", "q");
addOrganicSource("search", "q");
addOrganicSource("wp", "szukaj");
addOrganicSource("onet", "qt");
addOrganicSource("netsprint", "q");
addOrganicSource("google.interia", "q");
addOrganicSource("szukacz", "q");
addOrganicSource("yam", "k");
addOrganicSource("pchome", "q");
addOrganicSource("kvasir", "searchExpr");
addOrganicSource("sesam", "q");
addOrganicSource("ozu", "q");
addOrganicSource("terra", "query");
addOrganicSource("nostrum", "query");
addOrganicSource("mynet", "q");
addOrganicSource("ekolay", "q");
addOrganicSource("search.ilse", "search_for");
}
public function get sampleRate():Number{
return (_sampleRate);
}
public function get cookieName():String{
return (_cookieName);
}
public function addOrganicSource(_arg1:String, _arg2:String):void{
var engine = _arg1;
var keyword = _arg2;
try {
_organic.addSource(engine, keyword);
} catch(e:Error) {
if (((_debug) && (_debug.active))){
_debug.warning(e.message);
};
};
}
public function get domain():Domain{
return (_domain);
}
public function set sampleRate(_arg1:Number):void{
if (_arg1 <= 0){
_arg1 = 0.1;
};
if (_arg1 > 1){
_arg1 = 1;
};
_arg1 = Number(_arg1.toFixed(2));
_sampleRate = _arg1;
}
public function get version():String{
return (_version);
}
}
}//package com.google.analytics.v4
Section 74
//GoogleAnalyticsAPI (com.google.analytics.v4.GoogleAnalyticsAPI)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
public interface GoogleAnalyticsAPI {
function setCampSourceKey(_arg1:String):void;
function getServiceMode():ServerOperationMode;
function resetSession():void;
function setLocalServerMode():void;
function setCampContentKey(_arg1:String):void;
function addOrganic(_arg1:String, _arg2:String):void;
function setDetectFlash(_arg1:Boolean):void;
function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object;
function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean;
function setCampTermKey(_arg1:String):void;
function setCampNameKey(_arg1:String):void;
function addIgnoredOrganic(_arg1:String):void;
function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void;
function setAllowLinker(_arg1:Boolean):void;
function getClientInfo():Boolean;
function getDetectFlash():Boolean;
function setCampaignTrack(_arg1:Boolean):void;
function createEventTracker(_arg1:String):EventTracker;
function setCookieTimeout(_arg1:int):void;
function setAllowAnchor(_arg1:Boolean):void;
function trackTrans():void;
function clearOrganic():void;
function trackPageview(_arg1:String=""):void;
function setLocalGifPath(_arg1:String):void;
function getVersion():String;
function getLocalGifPath():String;
function setVar(_arg1:String):void;
function clearIgnoredOrganic():void;
function setCampMediumKey(_arg1:String):void;
function addIgnoredRef(_arg1:String):void;
function setClientInfo(_arg1:Boolean):void;
function setCookiePath(_arg1:String):void;
function setSampleRate(_arg1:Number):void;
function setSessionTimeout(_arg1:int):void;
function setRemoteServerMode():void;
function clearIgnoredRef():void;
function setDomainName(_arg1:String):void;
function setDetectTitle(_arg1:Boolean):void;
function setAllowHash(_arg1:Boolean):void;
function getAccount():String;
function linkByPost(_arg1:Object, _arg2:Boolean=false):void;
function link(_arg1:String, _arg2:Boolean=false):void;
function setCampNOKey(_arg1:String):void;
function setLocalRemoteServerMode():void;
function cookiePathCopy(_arg1:String):void;
function getDetectTitle():Boolean;
}
}//package com.google.analytics.v4
Section 75
//Tracker (com.google.analytics.v4.Tracker)
package com.google.analytics.v4 {
import com.google.analytics.core.*;
import com.google.analytics.debug.*;
import com.google.analytics.data.*;
import com.google.analytics.utils.*;
import com.google.analytics.external.*;
import com.google.analytics.campaign.*;
public class Tracker implements GoogleAnalyticsAPI {
private const EVENT_TRACKER_LABEL_KEY_NUM:int = 3;
private const EVENT_TRACKER_VALUE_VALUE_NUM:int = 1;
private const EVENT_TRACKER_PROJECT_ID:int = 5;
private const EVENT_TRACKER_OBJECT_NAME_KEY_NUM:int = 1;
private const EVENT_TRACKER_TYPE_KEY_NUM:int = 2;
private var _adSense:AdSenseGlobals;
private var _eventTracker:X10;
private var _noSessionInformation:Boolean;// = false
private var _browserInfo:BrowserInfo;
private var _debug:DebugConfiguration;
private var _isNewVisitor:Boolean;// = false
private var _buffer:Buffer;
private var _config:Configuration;
private var _x10Module:X10;
private var _campaign:CampaignManager;
private var _formatedReferrer:String;
private var _timeStamp:Number;
private var _info:Environment;
private var _domainHash:Number;
private var _campaignInfo:CampaignInfo;
private var _gifRequest:GIFRequest;
private var _hasInitData:Boolean;// = false
private var _account:String;
public function Tracker(_arg1:String, _arg2:Configuration, _arg3:DebugConfiguration, _arg4:Environment, _arg5:Buffer, _arg6:GIFRequest, _arg7:AdSenseGlobals){
var _local8:String;
super();
_account = _arg1;
_config = _arg2;
_debug = _arg3;
_info = _arg4;
_buffer = _arg5;
_gifRequest = _arg6;
_adSense = _arg7;
if (!Utils.validateAccount(_arg1)){
_local8 = (("Account \"" + _arg1) + "\" is not valid.");
_debug.warning(_local8);
throw (new Error(_local8));
};
_initData();
}
private function _doTracking():Boolean{
if (((((!((_info.protocol == Protocols.file))) && (!((_info.protocol == Protocols.none))))) && (_isNotGoogleSearch()))){
return (true);
};
if (_config.allowLocalTracking){
return (true);
};
return (false);
}
public function addOrganic(_arg1:String, _arg2:String):void{
_debug.info((("addOrganic( " + [_arg1, _arg2].join(", ")) + " )"));
_config.organic.addSource(_arg1, _arg2);
}
public function setAllowLinker(_arg1:Boolean):void{
_config.allowLinker = _arg1;
_debug.info((("setAllowLinker( " + _config.allowLinker) + " )"));
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
var _local5:Boolean;
var _local6 = 2;
if (((!((_arg1 == ""))) && (!((_arg2 == ""))))){
_eventTracker.clearKey(EVENT_TRACKER_PROJECT_ID);
_eventTracker.clearValue(EVENT_TRACKER_PROJECT_ID);
_local5 = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_OBJECT_NAME_KEY_NUM, _arg1);
_local5 = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_TYPE_KEY_NUM, _arg2);
if (((_arg3) && (!((_arg3 == ""))))){
_local5 = _eventTracker.setKey(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_LABEL_KEY_NUM, _arg3);
_local6 = 3;
if (!isNaN(_arg4)){
_local5 = _eventTracker.setValue(EVENT_TRACKER_PROJECT_ID, EVENT_TRACKER_VALUE_VALUE_NUM, _arg4);
_local6 = 4;
};
};
if (_local5){
_debug.info(((("valid event tracking call\ncategory: " + _arg1) + "\naction: ") + _arg2), VisualDebugMode.geek);
_sendXEvent(_eventTracker);
};
} else {
_debug.warning(((("event tracking call is not valid, failed!\ncategory: " + _arg1) + "\naction: ") + _arg2), VisualDebugMode.geek);
_local5 = false;
};
switch (_local6){
case 4:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3, _arg4].join(", ")) + " )"));
break;
case 3:
_debug.info((("trackEvent( " + [_arg1, _arg2, _arg3].join(", ")) + " )"));
break;
case 2:
default:
_debug.info((("trackEvent( " + [_arg1, _arg2].join(", ")) + " )"));
};
return (_local5);
}
public function trackPageview(_arg1:String=""):void{
_debug.info((("trackPageview( " + _arg1) + " )"));
if (_doTracking()){
_initData();
_trackMetrics(_arg1);
_noSessionInformation = false;
} else {
_debug.warning((("trackPageview( " + _arg1) + " ) failed"));
};
}
public function setCookieTimeout(_arg1:int):void{
_config.conversionTimeout = _arg1;
_debug.info((("setCookieTimeout( " + _config.conversionTimeout) + " )"));
}
public function trackTrans():void{
_debug.warning("trackTrans() not implemented");
}
public function setClientInfo(_arg1:Boolean):void{
_config.detectClientInfo = _arg1;
_debug.info((("setClientInfo( " + _config.detectClientInfo) + " )"));
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
_debug.warning((("linkByPost( " + [_arg1, _arg2].join(", ")) + " ) not implemented"));
}
private function _initData():void{
var _local1:String;
var _local2:String;
if (!_hasInitData){
_updateDomainName();
_domainHash = _getDomainHash();
_timeStamp = Math.round((new Date().getTime() / 1000));
if (_debug.verbose){
_local1 = "";
_local1 = (_local1 + "_initData 0");
_local1 = (_local1 + ("\ndomain name: " + _config.domainName));
_local1 = (_local1 + ("\ndomain hash: " + _domainHash));
_local1 = (_local1 + (((("\ntimestamp: " + _timeStamp) + " (") + new Date((_timeStamp * 1000))) + ")"));
_debug.info(_local1, VisualDebugMode.geek);
};
};
if (_doTracking()){
_handleCookie();
};
if (!_hasInitData){
if (_doTracking()){
_formatedReferrer = _formatReferrer();
_browserInfo = new BrowserInfo(_config, _info);
_debug.info(("browserInfo: " + _browserInfo.toURLString()), VisualDebugMode.advanced);
if (_config.campaignTracking){
_campaign = new CampaignManager(_config, _debug, _buffer, _domainHash, _formatedReferrer, _timeStamp);
_campaignInfo = _campaign.getCampaignInformation(_info.locationSearch, _noSessionInformation);
_debug.info(("campaignInfo: " + _campaignInfo.toURLString()), VisualDebugMode.advanced);
};
};
_x10Module = new X10();
_eventTracker = new X10();
_hasInitData = true;
};
if (_config.hasSiteOverlay){
_debug.warning("Site Overlay is not supported");
};
if (_debug.verbose){
_local2 = "";
_local2 = (_local2 + "_initData (misc)");
_local2 = (_local2 + ("\nflash version: " + _info.flashVersion.toString(4)));
_local2 = (_local2 + ("\nprotocol: " + _info.protocol));
_local2 = (_local2 + (("\ndefault domain name (auto): \"" + _info.domainName) + "\""));
_local2 = (_local2 + ("\nlanguage: " + _info.language));
_local2 = (_local2 + ("\ndomain hash: " + _getDomainHash()));
_local2 = (_local2 + ("\nuser-agent: " + _info.userAgent));
_debug.info(_local2, VisualDebugMode.geek);
};
}
public function getDetectTitle():Boolean{
_debug.info("getDetectTitle()");
return (_config.detectTitle);
}
public function resetSession():void{
_debug.info("resetSession()");
_buffer.resetCurrentSession();
}
public function getClientInfo():Boolean{
_debug.info("getClientInfo()");
return (_config.detectClientInfo);
}
private function _sendXEvent(_arg1:X10=null):void{
var _local2:Variables;
var _local3:EventInfo;
var _local4:Variables;
var _local5:Variables;
_initData();
if (_takeSample()){
_local2 = new Variables();
_local2.URIencode = true;
_local3 = new EventInfo(true, _x10Module, _arg1);
_local4 = _local3.toVariables();
_local5 = _renderMetricsSearchVariables();
_local2.join(_local4, _local5);
_gifRequest.send(_account, _local2, false, true);
};
}
public function setDetectFlash(_arg1:Boolean):void{
_config.detectFlash = _arg1;
_debug.info((("setDetectFlash( " + _config.detectFlash) + " )"));
}
public function setCampNameKey(_arg1:String):void{
_config.campaignKey.UCCN = _arg1;
var _local2 = (("setCampNameKey( " + _config.campaignKey.UCCN) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCCN]"));
} else {
_debug.info(_local2);
};
}
private function _formatReferrer():String{
var _local2:String;
var _local3:URL;
var _local4:URL;
var _local1:String = _info.referrer;
if ((((_local1 == "")) || ((_local1 == "localhost")))){
_local1 = "-";
} else {
_local2 = _info.domainName;
_local3 = new URL(_local1);
_local4 = new URL(("http://" + _local2));
if (_local3.hostName == _local2){
return ("-");
};
if (_local4.domain == _local3.domain){
if (_local4.subDomain != _local3.subDomain){
_local1 = "0";
};
};
if ((((_local1.charAt(0) == "[")) && (_local1.charAt((_local1.length - 1))))){
_local1 = "-";
};
};
_debug.info(("formated referrer: " + _local1), VisualDebugMode.advanced);
return (_local1);
}
private function _visitCode():Number{
if (_debug.verbose){
_debug.info(("visitCode: " + _buffer.utma.sessionId), VisualDebugMode.geek);
};
return (_buffer.utma.sessionId);
}
public function createEventTracker(_arg1:String):EventTracker{
_debug.info((("createEventTracker( " + _arg1) + " )"));
return (new EventTracker(_arg1, this));
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
_debug.warning((("addItem( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6].join(", ")) + " ) not implemented"));
}
public function clearIgnoredOrganic():void{
_debug.info("clearIgnoredOrganic()");
_config.organic.clearIgnoredKeywords();
}
public function setVar(_arg1:String):void{
var _local2:Variables;
if (((!((_arg1 == ""))) && (_isNotGoogleSearch()))){
_initData();
_buffer.utmv.domainHash = _domainHash;
_buffer.utmv.value = _arg1;
if (_debug.verbose){
_debug.info(_buffer.utmv.toString(), VisualDebugMode.geek);
};
_debug.info((("setVar( " + _arg1) + " )"));
if (_takeSample()){
_local2 = new Variables();
_local2.utmt = "var";
_gifRequest.send(_account, _local2);
};
} else {
_debug.warning((("setVar \"" + _arg1) + "\" is ignored"));
};
}
public function setDomainName(_arg1:String):void{
if (_arg1 == "auto"){
_config.domain.mode = DomainNameMode.auto;
} else {
if (_arg1 == "none"){
_config.domain.mode = DomainNameMode.none;
} else {
_config.domain.mode = DomainNameMode.custom;
_config.domain.name = _arg1;
};
};
_updateDomainName();
_debug.info((("setDomainName( " + _config.domainName) + " )"));
}
private function _updateDomainName():void{
var _local1:String;
if (_config.domain.mode == DomainNameMode.auto){
_local1 = _info.domainName;
if (_local1.substring(0, 4) == "www."){
_local1 = _local1.substring(4);
};
_config.domain.name = _local1;
};
_config.domainName = _config.domain.name.toLowerCase();
_debug.info(("domain name: " + _config.domainName), VisualDebugMode.advanced);
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object{
_debug.warning((("addTrans( " + [_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8].join(", ")) + " ) not implemented"));
return (null);
}
private function _renderMetricsSearchVariables(_arg1:String=""):Variables{
var _local4:Variables;
var _local2:Variables = new Variables();
_local2.URIencode = true;
var _local3:DocumentInfo = new DocumentInfo(_config, _info, _formatedReferrer, _arg1, _adSense);
_debug.info(("docInfo: " + _local3.toURLString()), VisualDebugMode.geek);
if (_config.campaignTracking){
_local4 = _campaignInfo.toVariables();
};
var _local5:Variables = _browserInfo.toVariables();
_local2.join(_local3.toVariables(), _local5, _local4);
return (_local2);
}
public function setCampContentKey(_arg1:String):void{
_config.campaignKey.UCCT = _arg1;
var _local2 = (("setCampContentKey( " + _config.campaignKey.UCCT) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCCT]"));
} else {
_debug.info(_local2);
};
}
private function _handleCookie():void{
var _local1:String;
var _local2:String;
var _local3:Array;
var _local4:String;
if (_config.allowLinker){
};
if (((_buffer.hasUTMA()) && (!(_buffer.utma.isEmpty())))){
if (((!(_buffer.hasUTMB())) || (!(_buffer.hasUTMC())))){
_buffer.updateUTMA(_timeStamp);
_noSessionInformation = true;
};
if (_debug.verbose){
_debug.info(("from cookie " + _buffer.utma.toString()), VisualDebugMode.geek);
};
} else {
_debug.info("create a new utma", VisualDebugMode.advanced);
_buffer.utma.domainHash = _domainHash;
_buffer.utma.sessionId = _getUniqueSessionId();
_buffer.utma.firstTime = _timeStamp;
_buffer.utma.lastTime = _timeStamp;
_buffer.utma.currentTime = _timeStamp;
_buffer.utma.sessionCount = 1;
if (_debug.verbose){
_debug.info(_buffer.utma.toString(), VisualDebugMode.geek);
};
_noSessionInformation = true;
_isNewVisitor = true;
};
if (((_adSense.gaGlobal) && ((_adSense.dh == String(_domainHash))))){
if (_adSense.sid){
_buffer.utma.currentTime = Number(_adSense.sid);
if (_debug.verbose){
_local1 = "";
_local1 = (_local1 + "AdSense sid found\n");
_local1 = (_local1 + (((("Override currentTime(" + _buffer.utma.currentTime) + ") from AdSense sid(") + Number(_adSense.sid)) + ")"));
_debug.info(_local1, VisualDebugMode.geek);
};
};
if (_isNewVisitor){
if (_adSense.sid){
_buffer.utma.lastTime = Number(_adSense.sid);
if (_debug.verbose){
_local2 = "";
_local2 = (_local2 + "AdSense sid found (new visitor)\n");
_local2 = (_local2 + (((("Override lastTime(" + _buffer.utma.lastTime) + ") from AdSense sid(") + Number(_adSense.sid)) + ")"));
_debug.info(_local2, VisualDebugMode.geek);
};
};
if (_adSense.vid){
_local3 = _adSense.vid.split(".");
_buffer.utma.sessionId = Number(_local3[0]);
_buffer.utma.firstTime = Number(_local3[1]);
if (_debug.verbose){
_local4 = "";
_local4 = (_local4 + "AdSense vid found (new visitor)\n");
_local4 = (_local4 + (((("Override sessionId(" + _buffer.utma.sessionId) + ") from AdSense vid(") + Number(_local3[0])) + ")\n"));
_local4 = (_local4 + (((("Override firstTime(" + _buffer.utma.firstTime) + ") from AdSense vid(") + Number(_local3[1])) + ")"));
_debug.info(_local4, VisualDebugMode.geek);
};
};
if (_debug.verbose){
_debug.info(("AdSense modified : " + _buffer.utma.toString()), VisualDebugMode.geek);
};
};
};
_buffer.utmb.domainHash = _domainHash;
if (isNaN(_buffer.utmb.trackCount)){
_buffer.utmb.trackCount = 0;
};
if (isNaN(_buffer.utmb.token)){
_buffer.utmb.token = _config.tokenCliff;
};
if (isNaN(_buffer.utmb.lastTime)){
_buffer.utmb.lastTime = _buffer.utma.currentTime;
};
_buffer.utmc.domainHash = _domainHash;
if (_debug.verbose){
_debug.info(_buffer.utmb.toString(), VisualDebugMode.advanced);
_debug.info(_buffer.utmc.toString(), VisualDebugMode.advanced);
};
}
public function setLocalServerMode():void{
_config.serverMode = ServerOperationMode.local;
_debug.info("setLocalServerMode()");
}
public function clearIgnoredRef():void{
_debug.info("clearIgnoredRef()");
_config.organic.clearIgnoredReferrals();
}
public function setCampSourceKey(_arg1:String):void{
_config.campaignKey.UCSR = _arg1;
var _local2 = (("setCampSourceKey( " + _config.campaignKey.UCSR) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCSR]"));
} else {
_debug.info(_local2);
};
}
public function getLocalGifPath():String{
_debug.info("getLocalGifPath()");
return (_config.localGIFpath);
}
public function setLocalGifPath(_arg1:String):void{
_config.localGIFpath = _arg1;
_debug.info((("setLocalGifPath( " + _config.localGIFpath) + " )"));
}
public function getVersion():String{
_debug.info("getVersion()");
return (_config.version);
}
public function setAllowAnchor(_arg1:Boolean):void{
_config.allowAnchor = _arg1;
_debug.info((("setAllowAnchor( " + _config.allowAnchor) + " )"));
}
private function _isNotGoogleSearch():Boolean{
var _local1:String = _config.domainName;
var _local2 = (_local1.indexOf("www.google.") < 0);
var _local3 = (_local1.indexOf(".google.") < 0);
var _local4 = (_local1.indexOf("google.") < 0);
var _local5 = (_local1.indexOf("google.org") > -1);
return (((((((((_local2) || (_local3))) || (_local4))) || (!((_config.cookiePath == "/"))))) || (_local5)));
}
public function setSampleRate(_arg1:Number):void{
if (_arg1 < 0){
_debug.warning("sample rate can not be negative, ignoring value.");
} else {
_config.sampleRate = _arg1;
};
_debug.info((("setSampleRate( " + _config.sampleRate) + " )"));
}
private function _takeSample():Boolean{
if (_debug.verbose){
_debug.info((((("takeSample: (" + (_visitCode() % 10000)) + ") < (") + (_config.sampleRate * 10000)) + ")"), VisualDebugMode.geek);
};
return (((_visitCode() % 10000) < (_config.sampleRate * 10000)));
}
public function setCookiePath(_arg1:String):void{
_config.cookiePath = _arg1;
_debug.info((("setCookiePath( " + _config.cookiePath) + " )"));
}
public function setAllowHash(_arg1:Boolean):void{
_config.allowDomainHash = _arg1;
_debug.info((("setAllowHash( " + _config.allowDomainHash) + " )"));
}
private function _generateUserDataHash():Number{
var _local1 = "";
_local1 = (_local1 + _info.appName);
_local1 = (_local1 + _info.appVersion);
_local1 = (_local1 + _info.language);
_local1 = (_local1 + _info.platform);
_local1 = (_local1 + _info.userAgent.toString());
_local1 = (_local1 + (((_info.screenWidth + "x") + _info.screenHeight) + _info.screenColorDepth));
_local1 = (_local1 + _info.referrer);
return (Utils.generateHash(_local1));
}
public function setCampNOKey(_arg1:String):void{
_config.campaignKey.UCNO = _arg1;
var _local2 = (("setCampNOKey( " + _config.campaignKey.UCNO) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCNO]"));
} else {
_debug.info(_local2);
};
}
public function addIgnoredOrganic(_arg1:String):void{
_debug.info((("addIgnoredOrganic( " + _arg1) + " )"));
_config.organic.addIgnoredKeyword(_arg1);
}
public function setLocalRemoteServerMode():void{
_config.serverMode = ServerOperationMode.both;
_debug.info("setLocalRemoteServerMode()");
}
public function cookiePathCopy(_arg1:String):void{
_debug.warning((("cookiePathCopy( " + _arg1) + " ) not implemented"));
}
public function setDetectTitle(_arg1:Boolean):void{
_config.detectTitle = _arg1;
_debug.info((("setDetectTitle( " + _config.detectTitle) + " )"));
}
public function setCampTermKey(_arg1:String):void{
_config.campaignKey.UCTR = _arg1;
var _local2 = (("setCampTermKey( " + _config.campaignKey.UCTR) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCTR]"));
} else {
_debug.info(_local2);
};
}
public function getServiceMode():ServerOperationMode{
_debug.info("getServiceMode()");
return (_config.serverMode);
}
private function _trackMetrics(_arg1:String=""):void{
var _local2:Variables;
var _local3:Variables;
var _local4:Variables;
var _local5:EventInfo;
if (_takeSample()){
_local2 = new Variables();
_local2.URIencode = true;
if (((_x10Module) && (_x10Module.hasData()))){
_local5 = new EventInfo(false, _x10Module);
_local3 = _local5.toVariables();
};
_local4 = _renderMetricsSearchVariables(_arg1);
_local2.join(_local3, _local4);
_gifRequest.send(_account, _local2);
};
}
public function setCampaignTrack(_arg1:Boolean):void{
_config.campaignTracking = _arg1;
_debug.info((("setCampaignTrack( " + _config.campaignTracking) + " )"));
}
public function addIgnoredRef(_arg1:String):void{
_debug.info((("addIgnoredRef( " + _arg1) + " )"));
_config.organic.addIgnoredReferral(_arg1);
}
public function clearOrganic():void{
_debug.info("clearOrganic()");
_config.organic.clearEngines();
}
public function getDetectFlash():Boolean{
_debug.info("getDetectFlash()");
return (_config.detectFlash);
}
public function setCampMediumKey(_arg1:String):void{
_config.campaignKey.UCMD = _arg1;
var _local2 = (("setCampMediumKey( " + _config.campaignKey.UCMD) + " )");
if (_debug.mode == VisualDebugMode.geek){
_debug.info((_local2 + " [UCMD]"));
} else {
_debug.info(_local2);
};
}
private function _getUniqueSessionId():Number{
var _local1:Number = ((Utils.generate32bitRandom() ^ _generateUserDataHash()) * 2147483647);
_debug.info(("Session ID: " + _local1), VisualDebugMode.geek);
return (_local1);
}
private function _getDomainHash():Number{
if (((((!(_config.domainName)) || ((_config.domainName == "")))) || ((_config.domain.mode == DomainNameMode.none)))){
_config.domainName = "";
return (1);
};
_updateDomainName();
if (_config.allowDomainHash){
return (Utils.generateHash(_config.domainName));
};
return (1);
}
public function setSessionTimeout(_arg1:int):void{
_config.sessionTimeout = _arg1;
_debug.info((("setSessionTimeout( " + _config.sessionTimeout) + " )"));
}
public function getAccount():String{
_debug.info("getAccount()");
return (_account);
}
public function link(_arg1:String, _arg2:Boolean=false):void{
_debug.warning((("link( " + [_arg1, _arg2].join(", ")) + " ) not implemented"));
}
public function setRemoteServerMode():void{
_config.serverMode = ServerOperationMode.remote;
_debug.info("setRemoteServerMode()");
}
}
}//package com.google.analytics.v4
Section 76
//AnalyticsTracker (com.google.analytics.AnalyticsTracker)
package com.google.analytics {
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import flash.events.*;
public interface AnalyticsTracker extends GoogleAnalyticsAPI, IEventDispatcher {
function set config(_arg1:Configuration):void;
function isReady():Boolean;
function get mode():String;
function set debug(_arg1:DebugConfiguration):void;
function get account():String;
function set mode(_arg1:String):void;
function get config():Configuration;
function get debug():DebugConfiguration;
function set account(_arg1:String):void;
function get visualDebug():Boolean;
function set visualDebug(_arg1:Boolean):void;
}
}//package com.google.analytics
Section 77
//API (com.google.analytics.API)
package com.google.analytics {
import com.google.analytics.utils.*;
public class API {
public static var version:Version = new Version();
version.major = 1;
version.minor = 0;
version.build = 1;
version.revision = "$Rev: 319 $ ".split(" ")[1];
}
}//package com.google.analytics
Section 78
//GATracker (com.google.analytics.GATracker)
package com.google.analytics {
import com.google.analytics.core.*;
import com.google.analytics.v4.*;
import com.google.analytics.debug.*;
import flash.events.*;
import flash.display.*;
import com.google.analytics.utils.*;
import com.google.analytics.external.*;
import com.google.analytics.events.*;
public class GATracker implements AnalyticsTracker {
private var _adSense:AdSenseGlobals;
private var _env:Environment;
private var _visualDebug:Boolean;
private var _idleTimer:IdleTimer;
private var _debug:DebugConfiguration;
private var _buffer:Buffer;
private var _config:Configuration;
private var _mode:String;
private var _display:DisplayObject;
private var _jsproxy:JavascriptProxy;
private var _dom:HTMLDOM;
private var _eventDispatcher:EventDispatcher;
private var _ready:Boolean;// = false
private var _gifRequest:GIFRequest;
private var _account:String;
private var _tracker:GoogleAnalyticsAPI;
public static var version:Version = API.version;
public static var autobuild:Boolean = true;
public function GATracker(_arg1:DisplayObject, _arg2:String, _arg3:String="AS3", _arg4:Boolean=false, _arg5:Configuration=null, _arg6:DebugConfiguration=null){
_ready = false;
super();
_display = _arg1;
_eventDispatcher = new EventDispatcher(this);
_tracker = new TrackerCache();
this.account = _arg2;
this.mode = _arg3;
this.visualDebug = _arg4;
if (!_arg6){
this.debug = new DebugConfiguration();
};
if (!_arg5){
this.config = new Configuration(_arg6);
};
if (autobuild){
_factory();
};
}
public function link(_arg1:String, _arg2:Boolean=false):void{
_tracker.link(_arg1, _arg2);
}
public function addOrganic(_arg1:String, _arg2:String):void{
_tracker.addOrganic(_arg1, _arg2);
}
public function setAllowLinker(_arg1:Boolean):void{
_tracker.setAllowLinker(_arg1);
}
public function trackEvent(_arg1:String, _arg2:String, _arg3:String=null, _arg4:Number=NaN):Boolean{
return (_tracker.trackEvent(_arg1, _arg2, _arg3, _arg4));
}
public function setCookieTimeout(_arg1:int):void{
_tracker.setCookieTimeout(_arg1);
}
public function trackTrans():void{
_tracker.trackTrans();
}
public function trackPageview(_arg1:String=""):void{
_tracker.trackPageview(_arg1);
}
public function getClientInfo():Boolean{
return (_tracker.getClientInfo());
}
public function setClientInfo(_arg1:Boolean):void{
_tracker.setClientInfo(_arg1);
}
public function get account():String{
return (_account);
}
public function linkByPost(_arg1:Object, _arg2:Boolean=false):void{
_tracker.linkByPost(_arg1, _arg2);
}
public function getDetectTitle():Boolean{
return (_tracker.getDetectTitle());
}
public function dispatchEvent(_arg1:Event):Boolean{
return (_eventDispatcher.dispatchEvent(_arg1));
}
public function get config():Configuration{
return (_config);
}
public function set mode(_arg1:String):void{
_mode = _arg1;
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
_eventDispatcher.removeEventListener(_arg1, _arg2, _arg3);
}
public function setDetectFlash(_arg1:Boolean):void{
_tracker.setDetectFlash(_arg1);
}
public function resetSession():void{
_tracker.resetSession();
}
public function setCampNameKey(_arg1:String):void{
_tracker.setCampNameKey(_arg1);
}
public function get debug():DebugConfiguration{
return (_debug);
}
public function addItem(_arg1:String, _arg2:String, _arg3:String, _arg4:String, _arg5:Number, _arg6:int):void{
_tracker.addItem(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
}
private function _bridgeFactory():GoogleAnalyticsAPI{
debug.info(((("GATracker (Bridge) v" + version) + "\naccount: ") + account));
return (new Bridge(account, _debug, _jsproxy));
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
_eventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function clearIgnoredOrganic():void{
_tracker.clearIgnoredOrganic();
}
public function set account(_arg1:String):void{
_account = _arg1;
}
public function setVar(_arg1:String):void{
_tracker.setVar(_arg1);
}
public function build():void{
if (!isReady()){
_factory();
};
}
public function setDomainName(_arg1:String):void{
_tracker.setDomainName(_arg1);
}
public function createEventTracker(_arg1:String):EventTracker{
return (_tracker.createEventTracker(_arg1));
}
public function set config(_arg1:Configuration):void{
_config = _arg1;
}
public function addTrans(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:String, _arg7:String, _arg8:String):Object{
return (_tracker.addTrans(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8));
}
public function setCampSourceKey(_arg1:String):void{
_tracker.setCampSourceKey(_arg1);
}
public function setCampContentKey(_arg1:String):void{
_tracker.setCampContentKey(_arg1);
}
public function willTrigger(_arg1:String):Boolean{
return (_eventDispatcher.willTrigger(_arg1));
}
public function setLocalServerMode():void{
_tracker.setLocalServerMode();
}
public function isReady():Boolean{
return (_ready);
}
public function getLocalGifPath():String{
return (_tracker.getLocalGifPath());
}
public function setAllowAnchor(_arg1:Boolean):void{
_tracker.setAllowAnchor(_arg1);
}
public function clearIgnoredRef():void{
_tracker.clearIgnoredRef();
}
public function get mode():String{
return (_mode);
}
public function set debug(_arg1:DebugConfiguration):void{
_debug = _arg1;
}
public function setLocalGifPath(_arg1:String):void{
_tracker.setLocalGifPath(_arg1);
}
public function getVersion():String{
return (_tracker.getVersion());
}
public function setSampleRate(_arg1:Number):void{
_tracker.setSampleRate(_arg1);
}
public function setCookiePath(_arg1:String):void{
_tracker.setCookiePath(_arg1);
}
public function setAllowHash(_arg1:Boolean):void{
_tracker.setAllowHash(_arg1);
}
public function setCampNOKey(_arg1:String):void{
_tracker.setCampNOKey(_arg1);
}
public function addIgnoredOrganic(_arg1:String):void{
_tracker.addIgnoredOrganic(_arg1);
}
public function setLocalRemoteServerMode():void{
_tracker.setLocalRemoteServerMode();
}
public function cookiePathCopy(_arg1:String):void{
_tracker.cookiePathCopy(_arg1);
}
private function _factory():void{
var _local1:GoogleAnalyticsAPI;
var _local2:TrackerCache;
_jsproxy = new JavascriptProxy(debug);
if (visualDebug){
debug.layout = new Layout(debug, _display);
debug.active = visualDebug;
};
_local2 = (_tracker as TrackerCache);
switch (mode){
case TrackerMode.BRIDGE:
_local1 = _bridgeFactory();
break;
case TrackerMode.AS3:
default:
_local1 = _trackerFactory();
};
if (!_local2.isEmpty()){
_local2.tracker = _local1;
_local2.flush();
};
_tracker = _local1;
_ready = true;
dispatchEvent(new AnalyticsEvent(AnalyticsEvent.READY, this));
}
public function setCampTermKey(_arg1:String):void{
_tracker.setCampTermKey(_arg1);
}
private function _trackerFactory():GoogleAnalyticsAPI{
debug.info(((("GATracker (AS3) v" + version) + "\naccount: ") + account));
_adSense = new AdSenseGlobals(debug);
_dom = new HTMLDOM(debug);
_dom.cacheProperties();
_env = new Environment("", "", "", debug, _dom);
_buffer = new Buffer(config, debug, false);
_gifRequest = new GIFRequest(config, debug, _buffer, _env);
_idleTimer = new IdleTimer(config, debug, _display, _buffer);
_env.url = _display.stage.loaderInfo.url;
return (new Tracker(account, config, debug, _env, _buffer, _gifRequest, _adSense));
}
public function setDetectTitle(_arg1:Boolean):void{
_tracker.setDetectTitle(_arg1);
}
public function getServiceMode():ServerOperationMode{
return (_tracker.getServiceMode());
}
public function clearOrganic():void{
_tracker.clearOrganic();
}
public function setCampaignTrack(_arg1:Boolean):void{
_tracker.setCampaignTrack(_arg1);
}
public function addIgnoredRef(_arg1:String):void{
_tracker.addIgnoredRef(_arg1);
}
public function set visualDebug(_arg1:Boolean):void{
_visualDebug = _arg1;
}
public function setCampMediumKey(_arg1:String):void{
_tracker.setCampMediumKey(_arg1);
}
public function setSessionTimeout(_arg1:int):void{
_tracker.setSessionTimeout(_arg1);
}
public function getDetectFlash():Boolean{
return (_tracker.getDetectFlash());
}
public function get visualDebug():Boolean{
return (_visualDebug);
}
public function getAccount():String{
return (_tracker.getAccount());
}
public function hasEventListener(_arg1:String):Boolean{
return (_eventDispatcher.hasEventListener(_arg1));
}
public function setRemoteServerMode():void{
_tracker.setRemoteServerMode();
}
}
var _local1:* = ServerOperationMode;
return (_local1);
}//package com.google.analytics
Section 79
//AutoLayoutEvent (fl.video.AutoLayoutEvent)
package fl.video {
import flash.events.*;
import flash.geom.*;
public class AutoLayoutEvent extends LayoutEvent implements IVPEvent {
private var _vp:uint;
public static const AUTO_LAYOUT:String = "autoLayout";
public function AutoLayoutEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:Rectangle=null, _arg5:Rectangle=null, _arg6:uint=0){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
_vp = _arg6;
}
override public function clone():Event{
return (new AutoLayoutEvent(type, bubbles, cancelable, Rectangle(oldBounds.clone()), Rectangle(oldRegistrationBounds.clone()), vp));
}
public function set vp(_arg1:uint):void{
_vp = _arg1;
}
public function get vp():uint{
return (_vp);
}
}
}//package fl.video
Section 80
//ConnectClient (fl.video.ConnectClient)
package fl.video {
import flash.net.*;
public class ConnectClient {
public var connIndex:uint;
public var nc:NetConnection;
public var pending:Boolean;
public var owner:NCManager;
public function ConnectClient(_arg1:NCManager, _arg2:NetConnection, _arg3:uint=0){
this.owner = _arg1;
this.nc = _arg2;
this.connIndex = _arg3;
this.pending = false;
}
public function onBWCheck(... _args):Number{
return (++owner._payload);
}
public function onBWDone(... _args):void{
var _local2:Number;
if (_args.length > 0){
_local2 = _args[0];
};
owner.onConnected(nc, _local2);
}
public function close():void{
}
}
}//package fl.video
Section 81
//ControlData (fl.video.ControlData)
package fl.video {
import flash.display.*;
public class ControlData {
public var state_mc:Array;
public var origWidth:Number;
public var handle_mc:Sprite;
public var state:uint;
public var leftMargin:Number;
public var fullness_mc:DisplayObject;
public var isDragging:Boolean;
public var currentState_mc:DisplayObject;
public var percentage:Number;
public var owner:DisplayObject;
public var origX:Number;
public var origY:Number;
public var bottomMargin:Number;
public var disabled_mc:DisplayObject;
public var enabled:Boolean;
public var hit_mc:Sprite;
public var origHeight:Number;
public var index:int;
public var mask_mc:DisplayObject;
public var avatar:DisplayObject;
public var fill_mc:DisplayObject;
public var topMargin:Number;
public var uiMgr:UIManager;
public var progress_mc:DisplayObject;
public var rightMargin:Number;
public var ctrl:DisplayObject;
public var origScaleX:Number;
public var origScaleY:Number;
public function ControlData(_arg1:UIManager, _arg2:DisplayObject, _arg3:DisplayObject, _arg4:int){
var uiMgr = _arg1;
var ctrl = _arg2;
var owner = _arg3;
var index = _arg4;
super();
this.uiMgr = uiMgr;
this.index = index;
this.ctrl = ctrl;
this.owner = owner;
try {
ctrl["uiMgr"] = uiMgr;
} catch(re:ReferenceError) {
};
}
}
}//package fl.video
Section 82
//CuePointManager (fl.video.CuePointManager)
package fl.video {
public class CuePointManager {
flvplayback_internal var _disabledCuePointsByNameOnly:Object;
flvplayback_internal var navCuePoints:Array;
flvplayback_internal var allCuePoints:Array;
flvplayback_internal var _disabledCuePoints:Array;
flvplayback_internal var _asCuePointTolerance:Number;
flvplayback_internal var _linearSearchTolerance:Number;
flvplayback_internal var _asCuePointIndex:int;
flvplayback_internal var asCuePoints:Array;
flvplayback_internal var flvCuePoints:Array;
flvplayback_internal var _metadataLoaded:Boolean;
flvplayback_internal var _id:uint;
private var _owner:FLVPlayback;
flvplayback_internal var eventCuePoints:Array;
public static const SHORT_VERSION:String = "2.0";
public static const VERSION:String = "2.0.0.37";
flvplayback_internal static const DEFAULT_LINEAR_SEARCH_TOLERANCE:Number = 50;
flvplayback_internal static var cuePointsReplace:Array = [""", "\"", "'", "'", ",", ",", "&", "&"];
public function CuePointManager(_arg1:FLVPlayback, _arg2:uint){
_owner = _arg1;
_id = _arg2;
reset();
_asCuePointTolerance = (_owner.getVideoPlayer(_id).playheadUpdateInterval / 2000);
_linearSearchTolerance = DEFAULT_LINEAR_SEARCH_TOLERANCE;
}
flvplayback_internal function getCuePoint(_arg1:Array, _arg2:Boolean, _arg3):Object{
var _local4:Object;
var _local5:int;
switch (typeof(_arg3)){
case "string":
_local4 = {name:_arg3};
break;
case "number":
_local4 = {time:_arg3};
break;
case "object":
_local4 = _arg3;
break;
};
_local5 = getCuePointIndex(_arg1, _arg2, _local4.time, _local4.name);
if (_local5 < 0){
return (null);
};
_local4 = deepCopyObject(_arg1[_local5]);
_local4.array = _arg1;
_local4.index = _local5;
return (_local4);
}
public function resetASCuePointIndex(_arg1:Number):void{
var _local2:int;
if ((((_arg1 <= 0)) || ((asCuePoints == null)))){
_asCuePointIndex = 0;
return;
};
_local2 = getCuePointIndex(asCuePoints, true, _arg1);
_asCuePointIndex = ((asCuePoints[_local2].time)<_arg1) ? (_local2 + 1) : _local2;
}
public function set playheadUpdateInterval(_arg1:Number):void{
_asCuePointTolerance = (_arg1 / 2000);
}
flvplayback_internal function addOrDisable(_arg1:Boolean, _arg2:Object):void{
if (_arg1){
if (_arg2.type == CuePointType.ACTIONSCRIPT){
throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "Cannot disable actionscript cue points"));
};
setFLVCuePointEnabled(false, _arg2);
} else {
if (_arg2.type == CuePointType.ACTIONSCRIPT){
addASCuePoint(_arg2);
};
};
}
public function processFLVCuePoints(_arg1:Array):void{
var _local2:int;
var _local3:Number;
var _local4:Object;
var _local5:Array;
var _local6:Number;
var _local7:int;
_metadataLoaded = true;
if ((((_arg1 == null)) || ((_arg1.length < 1)))){
flvCuePoints = null;
navCuePoints = null;
eventCuePoints = null;
return;
};
flvCuePoints = _arg1;
navCuePoints = new Array();
eventCuePoints = new Array();
_local3 = -1;
_local5 = _disabledCuePoints;
_local6 = 0;
_disabledCuePoints = new Array();
_local7 = 0;
while ((_local4 = flvCuePoints[_local7++]) != undefined) {
if ((((_local3 > 0)) && ((_local3 >= _local4.time)))){
flvCuePoints = null;
navCuePoints = null;
eventCuePoints = null;
_disabledCuePoints = new Array();
_disabledCuePointsByNameOnly = new Object();
throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, ("Unsorted cuePoint found after time: " + _local3)));
};
_local3 = _local4.time;
while ((((_local6 < _local5.length)) && ((cuePointCompare(_local5[_local6].time, null, _local4) < 0)))) {
_local6++;
};
if (((!((_disabledCuePointsByNameOnly[_local4.name] == undefined))) || ((((_local6 < _local5.length)) && ((cuePointCompare(_local5[_local6].time, _local5[_local6].name, _local4) == 0)))))){
_disabledCuePoints.push({time:_local4.time, name:_local4.name});
};
if (_local4.type == CuePointType.NAVIGATION){
navCuePoints.push(_local4);
} else {
if (_local4.type == CuePointType.EVENT){
eventCuePoints.push(_local4);
};
};
if ((((allCuePoints == null)) || ((allCuePoints.length < 1)))){
allCuePoints = new Array();
allCuePoints.push(_local4);
} else {
_local2 = getCuePointIndex(allCuePoints, true, _local4.time);
_local2 = ((allCuePoints[_local2].time)>_local4.time) ? 0 : (_local2 + 1);
allCuePoints.splice(_local2, 0, _local4);
};
};
_disabledCuePointsByNameOnly = new Object();
}
public function addASCuePoint(_arg1, _arg2:String=null, _arg3:Object=null):Object{
var _local4:Object;
var _local5:Boolean;
var _local6:Boolean;
var _local7:int;
var _local8:Number;
var _local9:Object;
var _local10:int;
if (typeof(_arg1) == "object"){
_local4 = deepCopyObject(_arg1);
} else {
_local4 = {time:_arg1, name:_arg2, parameters:deepCopyObject(_arg3)};
};
if (_local4.parameters == null){
delete _local4.parameters;
};
_local5 = ((isNaN(_local4.time)) || ((_local4.time < 0)));
if (_local5){
throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "time must be number"));
};
_local6 = (_local4.name == null);
if (_local6){
throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "name cannot be undefined or null"));
};
_local4.type = CuePointType.ACTIONSCRIPT;
if ((((asCuePoints == null)) || ((asCuePoints.length < 1)))){
_local7 = 0;
asCuePoints = new Array();
asCuePoints.push(_local4);
} else {
_local7 = getCuePointIndex(asCuePoints, true, _local4.time);
_local7 = ((asCuePoints[_local7].time)>_local4.time) ? 0 : (_local7 + 1);
asCuePoints.splice(_local7, 0, _local4);
};
if ((((allCuePoints == null)) || ((allCuePoints.length < 1)))){
allCuePoints = new Array();
allCuePoints.push(_local4);
} else {
_local10 = getCuePointIndex(allCuePoints, true, _local4.time);
_local10 = ((allCuePoints[_local10].time)>_local4.time) ? 0 : (_local10 + 1);
allCuePoints.splice(_local10, 0, _local4);
};
_local8 = _owner.getVideoPlayer(_id).playheadTime;
if (_local8 > 0){
if (_asCuePointIndex == _local7){
if (_local8 > asCuePoints[_local7].time){
_asCuePointIndex++;
};
} else {
if (_asCuePointIndex > _local7){
_asCuePointIndex++;
};
};
} else {
_asCuePointIndex = 0;
};
_local9 = deepCopyObject(asCuePoints[_local7]);
_local9.array = asCuePoints;
_local9.index = _local7;
return (_local9);
}
public function get metadataLoaded():Boolean{
return (_metadataLoaded);
}
public function reset():void{
_metadataLoaded = false;
allCuePoints = null;
asCuePoints = null;
_disabledCuePoints = new Array();
_disabledCuePointsByNameOnly = new Object();
flvCuePoints = null;
navCuePoints = null;
eventCuePoints = null;
_asCuePointIndex = 0;
}
public function removeCuePoints(_arg1:Array, _arg2:Object):Number{
var _local3:int;
var _local4:Object;
var _local5:int;
_local5 = 0;
_local3 = getCuePointIndex(_arg1, true, -1, _arg2.name);
while (_local3 >= 0) {
_local4 = _arg1[_local3];
_arg1.splice(_local3, 1);
_local3--;
_local5++;
_local3 = getNextCuePointIndexWithName(_local4.name, _arg1, _local3);
};
return (_local5);
}
flvplayback_internal function unescape(_arg1:String):String{
var _local2:String;
var _local3:int;
_local2 = _arg1;
_local3 = 0;
while (_local3 < cuePointsReplace.length) {
var _temp1 = _local3;
_local3 = (_local3 + 1);
var _temp2 = _local3;
_local3 = (_local3 + 1);
_local2 = _local2.replace(cuePointsReplace[_temp1], cuePointsReplace[_temp2]);
};
return (_local2);
}
public function setFLVCuePointEnabled(_arg1:Boolean, _arg2):int{
var _local3:Object;
var _local4:Boolean;
var _local5:Boolean;
var _local6:uint;
var _local7:int;
var _local8:int;
var _local9:Object;
switch (typeof(_arg2)){
case "string":
_local3 = {name:_arg2};
break;
case "number":
_local3 = {time:_arg2};
break;
case "object":
_local3 = _arg2;
break;
};
_local4 = ((isNaN(_local3.time)) || ((_local3.time < 0)));
_local5 = (_local3.name == null);
if (((_local4) && (_local5))){
throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "time must be number and/or name must not be undefined or null"));
};
_local6 = 0;
if (_local4){
if (!_metadataLoaded){
if (_disabledCuePointsByNameOnly[_local3.name] == undefined){
if (!_arg1){
_disabledCuePointsByNameOnly[_local3.name] = new Array();
};
} else {
if (_arg1){
delete _disabledCuePointsByNameOnly[_local3.name];
};
return (-1);
};
removeCuePoints(_disabledCuePoints, _local3);
return (-1);
};
if (_arg1){
_local6 = removeCuePoints(_disabledCuePoints, _local3);
} else {
_local7 = getCuePointIndex(flvCuePoints, true, -1, _local3.name);
while (_local7 >= 0) {
_local9 = flvCuePoints[_local7];
_local8 = getCuePointIndex(_disabledCuePoints, true, _local9.time);
if ((((_local8 < 0)) || (!((_disabledCuePoints[_local8].time == _local9.time))))){
_disabledCuePoints = insertCuePoint(_local8, _disabledCuePoints, {name:_local9.name, time:_local9.time});
_local6 = (_local6 + 1);
};
_local7 = getNextCuePointIndexWithName(_local9.name, flvCuePoints, _local7);
};
};
return (_local6);
};
_local7 = getCuePointIndex(_disabledCuePoints, false, _local3.time, _local3.name);
if (_local7 < 0){
if (_arg1){
if (!_metadataLoaded){
_local7 = getCuePointIndex(_disabledCuePoints, false, _local3.time);
if (_local7 < 0){
_local8 = getCuePointIndex(_disabledCuePointsByNameOnly[_local3.name], true, _local3.time);
if (cuePointCompare(_local3.time, null, _disabledCuePointsByNameOnly[_local3.name]) != 0){
_disabledCuePointsByNameOnly[_local3.name] = insertCuePoint(_local8, _disabledCuePointsByNameOnly[_local3.name], _local3);
};
} else {
_disabledCuePoints.splice(_local7, 1);
};
};
return ((_metadataLoaded) ? 0 : -1);
};
} else {
if (_arg1){
_disabledCuePoints.splice(_local7, 1);
_local6 = 1;
} else {
_local6 = 0;
};
return ((_metadataLoaded) ? _local6 : -1);
};
if (_metadataLoaded){
_local7 = getCuePointIndex(flvCuePoints, false, _local3.time, _local3.name);
if (_local7 < 0){
return (0);
};
if (_local5){
_local3.name = flvCuePoints[_local7].name;
};
};
_local8 = getCuePointIndex(_disabledCuePoints, true, _local3.time);
_disabledCuePoints = insertCuePoint(_local8, _disabledCuePoints, _local3);
_local6 = 1;
return ((_metadataLoaded) ? _local6 : -1);
}
public function isFLVCuePointEnabled(_arg1):Boolean{
var _local2:Object;
var _local3:Boolean;
var _local4:Boolean;
var _local5:int;
if (!_metadataLoaded){
return (true);
};
switch (typeof(_arg1)){
case "string":
_local2 = {name:_arg1};
break;
case "number":
_local2 = {time:_arg1};
break;
case "object":
_local2 = _arg1;
break;
};
_local3 = ((isNaN(_local2.time)) || ((_local2.time < 0)));
_local4 = (_local2.name == null);
if (((_local3) && (_local4))){
throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "time must be number and/or name must not be undefined or null"));
};
if (_local3){
_local5 = getCuePointIndex(flvCuePoints, true, -1, _local2.name);
if (_local5 < 0){
return (true);
};
while (_local5 >= 0) {
if (getCuePointIndex(_disabledCuePoints, false, flvCuePoints[_local5].time, flvCuePoints[_local5].name) < 0){
return (true);
};
_local5 = getNextCuePointIndexWithName(_local2.name, flvCuePoints, _local5);
};
return (false);
};
return ((getCuePointIndex(_disabledCuePoints, false, _local2.time, _local2.name) < 0));
}
public function removeASCuePoint(_arg1):Object{
var _local2:Object;
var _local3:int;
if ((((asCuePoints == null)) || ((asCuePoints.length < 1)))){
return (null);
};
switch (typeof(_arg1)){
case "string":
_local2 = {name:_arg1};
break;
case "number":
_local2 = {time:_arg1};
break;
case "object":
_local2 = _arg1;
break;
};
_local3 = getCuePointIndex(asCuePoints, false, _local2.time, _local2.name);
if (_local3 < 0){
return (null);
};
_local2 = asCuePoints[_local3];
asCuePoints.splice(_local3, 1);
_local3 = getCuePointIndex(allCuePoints, false, _local2.time, _local2.name);
if (_local3 > 0){
allCuePoints.splice(_local3, 1);
};
if (_owner.getVideoPlayer(_id).playheadTime > 0){
if (_asCuePointIndex > _local3){
_asCuePointIndex--;
};
} else {
_asCuePointIndex = 0;
};
return (_local2);
}
public function get id():uint{
return (_id);
}
public function processCuePointsProperty(_arg1:Array):void{
var _local2:uint;
var _local3:uint;
var _local4:String;
var _local5:String;
var _local6:Object;
var _local7:Boolean;
var _local8:int;
if ((((_arg1 == null)) || ((_arg1.length == 0)))){
return;
};
_local2 = 0;
_local8 = 0;
while (_local8 < (_arg1.length - 1)) {
switch (_local2){
case 6:
addOrDisable(_local7, _local6);
_local2 = 0;
case 0:
var _temp1 = _local8;
_local8 = (_local8 + 1);
if (_arg1[_temp1] != "t"){
throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "unexpected cuePoint parameter format"));
};
if (isNaN(_arg1[_local8])){
throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "time must be number"));
};
_local6 = new Object();
_local6.time = (_arg1[_local8] / 1000);
_local2++;
break;
case 1:
var _temp2 = _local8;
_local8 = (_local8 + 1);
if (_arg1[_temp2] != "n"){
throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "unexpected cuePoint parameter format"));
};
if (_arg1[_local8] == undefined){
throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "name cannot be null or undefined"));
};
_local6.name = unescape(_arg1[_local8]);
_local2++;
break;
case 2:
var _temp3 = _local8;
_local8 = (_local8 + 1);
if (_arg1[_temp3] != "t"){
throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "unexpected cuePoint parameter format"));
};
if (isNaN(_arg1[_local8])){
throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "type must be number"));
};
switch (_arg1[_local8]){
case 0:
_local6.type = CuePointType.EVENT;
break;
case 1:
_local6.type = CuePointType.NAVIGATION;
break;
case 2:
_local6.type = CuePointType.ACTIONSCRIPT;
break;
default:
throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "type must be 0, 1 or 2"));
};
_local2++;
break;
case 3:
var _temp4 = _local8;
_local8 = (_local8 + 1);
if (_arg1[_temp4] != "d"){
throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "unexpected cuePoint parameter format"));
};
if (isNaN(_arg1[_local8])){
throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "disabled must be number"));
};
_local7 = !((_arg1[_local8] == 0));
_local2++;
break;
case 4:
var _temp5 = _local8;
_local8 = (_local8 + 1);
if (_arg1[_temp5] != "p"){
throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "unexpected cuePoint parameter format"));
};
if (isNaN(_arg1[_local8])){
throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "num params must be number"));
};
_local3 = _arg1[_local8];
_local2++;
if (_local3 == 0){
_local2++;
} else {
_local6.parameters = new Object();
};
break;
case 5:
var _temp6 = _local8;
_local8 = (_local8 + 1);
_local4 = _arg1[_temp6];
_local5 = _arg1[_local8];
if ((_local4 is String)){
_local4 = unescape(_local4);
};
if ((_local5 is String)){
_local5 = unescape(_local5);
};
_local6.parameters[_local4] = _local5;
_local3--;
if (_local3 == 0){
_local2++;
};
break;
};
_local8++;
};
if (_local2 == 6){
addOrDisable(_local7, _local6);
} else {
throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "unexpected end of cuePoint param string"));
};
}
flvplayback_internal function getNextCuePointIndexWithName(_arg1:String, _arg2:Array, _arg3:int):int{
var _local4:int;
if (_arg1 == null){
throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "name cannot be undefined or null"));
};
if (_arg2 == null){
throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "cuePoint.array undefined"));
};
if (((((isNaN(_arg3)) || ((_arg3 < -1)))) || ((_arg3 >= _arg2.length)))){
throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "cuePoint.index must be number between -1 and cuePoint.array.length"));
};
_local4 = (_arg3 + 1);
while (_local4 < _arg2.length) {
if (_arg2[_local4].name == _arg1){
break;
};
_local4++;
};
if (_local4 < _arg2.length){
return (_local4);
};
return (-1);
}
public function dispatchASCuePoints():void{
var _local1:Number;
_local1 = _owner.getVideoPlayer(_id).playheadTime;
if (((_owner.getVideoPlayer(_id).stateResponsive) && (!((asCuePoints == null))))){
while ((((_asCuePointIndex < asCuePoints.length)) && ((asCuePoints[_asCuePointIndex].time <= (_local1 + _asCuePointTolerance))))) {
_owner.dispatchEvent(new MetadataEvent(MetadataEvent.CUE_POINT, false, false, deepCopyObject(asCuePoints[_asCuePointIndex++]), _id));
};
};
}
flvplayback_internal function getNextCuePointWithName(_arg1:Object):Object{
var _local2:int;
var _local3:Object;
if (_arg1 == null){
throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "cuePoint parameter undefined"));
};
if (((isNaN(_arg1.time)) || ((_arg1.time < 0)))){
throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "time must be number"));
};
_local2 = getNextCuePointIndexWithName(_arg1.name, _arg1.array, _arg1.index);
if (_local2 < 0){
return (null);
};
_local3 = deepCopyObject(_arg1.array[_local2]);
_local3.array = _arg1.array;
_local3.index = _local2;
return (_local3);
}
public function insertCuePoint(_arg1:int, _arg2:Array, _arg3:Object):Array{
if (_arg1 < 0){
_arg2 = new Array();
_arg2.push(_arg3);
} else {
if (_arg2[_arg1].time > _arg3.time){
_arg1 = 0;
} else {
_arg1++;
};
_arg2.splice(_arg1, 0, _arg3);
};
return (_arg2);
}
flvplayback_internal function getCuePointIndex(_arg1:Array, _arg2:Boolean, _arg3:Number=NaN, _arg4:String=null, _arg5:int=-1, _arg6:int=-1):int{
var _local7:Boolean;
var _local8:Boolean;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
var _local13:int;
var _local14:int;
var _local15:int;
if ((((_arg1 == null)) || ((_arg1.length < 1)))){
return (-1);
};
_local7 = ((isNaN(_arg3)) || ((_arg3 < 0)));
_local8 = (_arg4 == null);
if (((_local7) && (_local8))){
throw (new VideoError(VideoError.ILLEGAL_CUE_POINT, "time must be number and/or name must not be undefined or null"));
};
if (_arg5 < 0){
_arg5 = 0;
};
if (_arg6 < 0){
_arg6 = _arg1.length;
};
if (((!(_local8)) && (((_arg2) || (_local7))))){
if (_local7){
_local12 = _arg5;
} else {
_local12 = getCuePointIndex(_arg1, _arg2, _arg3);
};
_local13 = _local12;
while (_local13 >= _arg5) {
if (_arg1[_local13].name == _arg4){
break;
};
_local13--;
};
if (_local13 >= _arg5){
return (_local13);
};
_local13 = (_local12 + 1);
while (_local13 < _arg6) {
if (_arg1[_local13].name == _arg4){
break;
};
_local13++;
};
if (_local13 < _arg6){
return (_local13);
};
return (-1);
};
if (_arg6 <= _linearSearchTolerance){
_local14 = (_arg5 + _arg6);
_local15 = _arg5;
while (_local15 < _local14) {
_local9 = cuePointCompare(_arg3, _arg4, _arg1[_local15]);
if (_local9 == 0){
return (_local15);
};
if (_local9 < 0){
break;
};
_local15++;
};
if (_arg2){
if (_local15 > 0){
return ((_local15 - 1));
};
return (0);
};
return (-1);
};
_local10 = int((_arg6 / 2));
_local11 = (_arg5 + _local10);
_local9 = cuePointCompare(_arg3, _arg4, _arg1[_local11]);
if (_local9 < 0){
return (getCuePointIndex(_arg1, _arg2, _arg3, _arg4, _arg5, _local10));
};
if (_local9 > 0){
return (getCuePointIndex(_arg1, _arg2, _arg3, _arg4, (_local11 + 1), ((_local10 - 1) + (_arg6 % 2))));
};
return (_local11);
}
flvplayback_internal static function deepCopyObject(_arg1:Object, _arg2:uint=0):Object{
var _local3:Object;
var _local4:*;
if (_arg1 == null){
return (_arg1);
};
_local3 = new Object();
for (_local4 in _arg1) {
if ((((_arg2 == 0)) && ((((_local4 == "array")) || ((_local4 == "index")))))){
} else {
if (typeof(_arg1[_local4]) == "object"){
_local3[_local4] = deepCopyObject(_arg1[_local4], (_arg2 + 1));
} else {
_local3[_local4] = _arg1[_local4];
};
};
};
return (_local3);
}
flvplayback_internal static function cuePointCompare(_arg1:Number, _arg2:String, _arg3:Object):int{
var _local4:Number;
var _local5:Number;
_local4 = Math.round((_arg1 * 1000));
_local5 = Math.round((_arg3.time * 1000));
if (_local4 < _local5){
return (-1);
};
if (_local4 > _local5){
return (1);
};
if (_arg2 != null){
if (_arg2 == _arg3.name){
return (0);
};
if (_arg2 < _arg3.name){
return (-1);
};
return (1);
};
return (0);
}
}
}//package fl.video
Section 83
//CuePointType (fl.video.CuePointType)
package fl.video {
public final class CuePointType {
public static const FLV:String = "flv";
public static const ALL:String = "all";
public static const ACTIONSCRIPT:String = "actionscript";
public static const EVENT:String = "event";
public static const NAVIGATION:String = "navigation";
}
}//package fl.video
Section 84
//FLVPlayback (fl.video.FLVPlayback)
package fl.video {
import flash.net.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
public class FLVPlayback extends Sprite {
private var _playheadUpdateInterval:Number;
private var _align:String;
flvplayback_internal var videoPlayerStateDict:Dictionary;
flvplayback_internal var cuePointMgrs:Array;
private var _volume:Number;
private var _origHeight:Number;
flvplayback_internal var videoPlayerStates:Array;
private var _progressInterval:Number;
private var _seekToPrevOffset:Number;
private var _origWidth:Number;
private var _scaleMode:String;
flvplayback_internal var resizingNow:Boolean;
flvplayback_internal var videoPlayers:Array;
private var _bufferTime:Number;
private var _aspectRatio:Boolean;
private var _autoRewind:Boolean;
flvplayback_internal var uiMgr:UIManager;
private var previewImage_mc:Loader;
private var _componentInspectorSetting:Boolean;
flvplayback_internal var _firstStreamShown:Boolean;
private var _visibleVP:uint;
private var _idleTimeout:Number;
private var _soundTransform:SoundTransform;
public var boundingBox_mc:DisplayObject;
flvplayback_internal var skinShowTimer:Timer;
private var preview_mc:MovieClip;
private var livePreviewHeight:Number;
flvplayback_internal var _firstStreamReady:Boolean;
private var _activeVP:uint;
private var isLivePreview:Boolean;
private var _topVP:uint;
private var livePreviewWidth:Number;
private var __forceNCMgr:NCManager;
private var previewImageUrl:String;
public static const SEEK_TO_PREV_OFFSET_DEFAULT:Number = 1;
public static const SHORT_VERSION:String = "2.0";
flvplayback_internal static const skinShowTimerInterval:Number = 2000;
public static const VERSION:String = "2.0.0.37";
flvplayback_internal static const DEFAULT_SKIN_SHOW_TIMER_INTERVAL:Number = 2000;
public function FLVPlayback(){
var _local1:VideoPlayer;
super();
isLivePreview = ((!((parent == null))) && ((getQualifiedClassName(parent) == "fl.livepreview::LivePreviewParent")));
_componentInspectorSetting = false;
_origWidth = super.width;
_origHeight = super.height;
super.scaleX = 1;
super.scaleY = 1;
_local1 = new VideoPlayer(0, 0);
_local1.setSize(_origWidth, _origHeight);
videoPlayers = new Array();
videoPlayers[0] = _local1;
_align = _local1.align;
_autoRewind = _local1.autoRewind;
_scaleMode = _local1.scaleMode;
_bufferTime = _local1.bufferTime;
_idleTimeout = _local1.idleTimeout;
_playheadUpdateInterval = _local1.playheadUpdateInterval;
_progressInterval = _local1.progressInterval;
_soundTransform = _local1.soundTransform;
_volume = _local1.volume;
_seekToPrevOffset = SEEK_TO_PREV_OFFSET_DEFAULT;
_firstStreamReady = false;
_firstStreamShown = false;
resizingNow = false;
uiMgr = new UIManager(this);
if (isLivePreview){
uiMgr.visible = true;
};
_activeVP = 0;
_visibleVP = 0;
_topVP = 0;
videoPlayerStates = new Array();
videoPlayerStateDict = new Dictionary(true);
cuePointMgrs = new Array();
createVideoPlayer(0);
boundingBox_mc.visible = false;
removeChild(boundingBox_mc);
boundingBox_mc = null;
if (isLivePreview){
previewImageUrl = "";
createLivePreviewMovieClip();
setSize(_origWidth, _origHeight);
};
}
public function set fullScreenTakeOver(_arg1:Boolean):void{
uiMgr.fullScreenTakeOver = _arg1;
}
public function pause():void{
var _local1:VideoPlayerState;
var _local2:VideoPlayer;
if (!_firstStreamShown){
_local1 = videoPlayerStates[_activeVP];
queueCmd(_local1, QueuedCommand.PAUSE);
} else {
_local2 = videoPlayers[_activeVP];
_local2.pause();
};
}
public function setScale(_arg1:Number, _arg2:Number):void{
var _local3:Rectangle;
var _local4:Rectangle;
var _local5:int;
var _local6:VideoPlayer;
_local3 = new Rectangle(x, y, width, height);
_local4 = new Rectangle(registrationX, registrationY, registrationWidth, registrationHeight);
resizingNow = true;
_local5 = 0;
while (_local5 < videoPlayers.length) {
_local6 = videoPlayers[_local5];
if (_local6 !== null){
_local6.setSize((_origWidth * _arg1), (_origWidth * _arg2));
};
_local5++;
};
resizingNow = false;
dispatchEvent(new LayoutEvent(LayoutEvent.LAYOUT, false, false, _local3, _local4));
}
public function stop():void{
var _local1:VideoPlayerState;
var _local2:VideoPlayer;
if (!_firstStreamShown){
_local1 = videoPlayerStates[_activeVP];
queueCmd(_local1, QueuedCommand.STOP);
} else {
_local2 = videoPlayers[_activeVP];
_local2.stop();
};
}
public function set align(_arg1:String):void{
var _local2:VideoPlayer;
if (_activeVP == 0){
_align = _arg1;
};
_local2 = videoPlayers[_activeVP];
_local2.align = _arg1;
}
public function getVideoPlayer(_arg1:Number):VideoPlayer{
return (videoPlayers[_arg1]);
}
public function get playheadTime():Number{
var _local1:VideoPlayer;
_local1 = videoPlayers[_activeVP];
return (_local1.playheadTime);
}
public function get progressInterval():Number{
var _local1:VideoPlayer;
_local1 = videoPlayers[_activeVP];
return (_local1.progressInterval);
}
public function set skinFadeTime(_arg1:int):void{
uiMgr.skinFadeTime = _arg1;
}
public function get seekToPrevOffset():Number{
return (_seekToPrevOffset);
}
public function set playheadTime(_arg1:Number):void{
seek(_arg1);
}
public function get source():String{
var _local1:VideoPlayerState;
var _local2:VideoPlayer;
_local1 = videoPlayerStates[_activeVP];
if (_local1.isWaiting){
return (_local1.url);
};
_local2 = videoPlayers[_activeVP];
return (_local2.source);
}
public function get activeVideoPlayerIndex():uint{
return (_activeVP);
}
public function get skinFadeTime():int{
return (uiMgr.skinFadeTime);
}
public function set scaleMode(_arg1:String):void{
var _local2:VideoPlayer;
if (_activeVP == 0){
_scaleMode = _arg1;
};
_local2 = videoPlayers[_activeVP];
_local2.scaleMode = _arg1;
}
public function set bufferingBar(_arg1:Sprite):void{
uiMgr.setControl(UIManager.BUFFERING_BAR, _arg1);
}
public function get metadataLoaded():Boolean{
var _local1:CuePointManager;
_local1 = cuePointMgrs[_activeVP];
return (_local1.metadataLoaded);
}
public function closeVideoPlayer(_arg1:uint):void{
var _local2:VideoPlayer;
if (_arg1 == 0){
throw (new VideoError(VideoError.DELETE_DEFAULT_PLAYER));
};
if (videoPlayers[_arg1] == undefined){
return;
};
_local2 = videoPlayers[_arg1];
if (_visibleVP == _arg1){
visibleVideoPlayerIndex = 0;
};
if (_activeVP == _arg1){
activeVideoPlayerIndex = 0;
};
removeChild(_local2);
_local2.close();
delete videoPlayers[_arg1];
delete videoPlayerStates[_arg1];
delete videoPlayerStateDict[_local2];
}
public function get scaleMode():String{
var _local1:VideoPlayer;
_local1 = videoPlayers[_activeVP];
return (_local1.scaleMode);
}
public function set progressInterval(_arg1:Number):void{
var _local2:VideoPlayer;
if (_activeVP == 0){
_progressInterval = _arg1;
};
_local2 = videoPlayers[_activeVP];
_local2.progressInterval = _arg1;
}
public function get playing():Boolean{
return ((state == VideoState.PLAYING));
}
public function get totalTime():Number{
var _local1:VideoPlayerState;
var _local2:VideoPlayer;
if (isLivePreview){
return (1);
};
_local1 = videoPlayerStates[_activeVP];
if (_local1.totalTimeSet){
return (_local1.totalTime);
};
_local2 = videoPlayers[_activeVP];
return (_local2.totalTime);
}
public function get ncMgr():INCManager{
var _local1:VideoPlayer;
_local1 = videoPlayers[_activeVP];
return (_local1.ncMgr);
}
public function set volume(_arg1:Number):void{
var _local2:VideoPlayer;
if (_volume == _arg1){
return;
};
_volume = _arg1;
if (!scrubbing){
_local2 = videoPlayers[_visibleVP];
_local2.volume = _volume;
};
dispatchEvent(new SoundEvent(SoundEvent.SOUND_UPDATE, false, false, _local2.soundTransform));
}
public function get skinAutoHide():Boolean{
return (uiMgr.skinAutoHide);
}
public function set source(_arg1:String):void{
var _local2:VideoPlayerState;
var _local3:CuePointManager;
if (isLivePreview){
return;
};
if (_arg1 == null){
_arg1 = "";
};
if (_componentInspectorSetting){
_local2 = videoPlayerStates[_activeVP];
_local2.url = _arg1;
if (_arg1.length > 0){
_local2.isWaiting = true;
addEventListener(Event.ENTER_FRAME, doContentPathConnect);
};
} else {
if (source == _arg1){
return;
};
_local3 = cuePointMgrs[_activeVP];
_local3.reset();
_local2 = videoPlayerStates[_activeVP];
_local2.url = _arg1;
_local2.isWaiting = true;
doContentPathConnect(_activeVP);
};
}
public function set activeVideoPlayerIndex(_arg1:uint):void{
if (_activeVP == _arg1){
return;
};
_activeVP = _arg1;
if (videoPlayers[_activeVP] == undefined){
createVideoPlayer(_activeVP);
};
}
override public function set soundTransform(_arg1:SoundTransform):void{
var _local2:VideoPlayer;
if (_arg1 == null){
return;
};
_volume = _arg1.volume;
_soundTransform.volume = (scrubbing) ? 0 : _arg1.volume;
_soundTransform.leftToLeft = _arg1.leftToLeft;
_soundTransform.leftToRight = _arg1.leftToRight;
_soundTransform.rightToLeft = _arg1.rightToLeft;
_soundTransform.rightToRight = _arg1.rightToRight;
_local2 = videoPlayers[_activeVP];
_local2.soundTransform = _soundTransform;
dispatchEvent(new SoundEvent(SoundEvent.SOUND_UPDATE, false, false, _local2.soundTransform));
}
public function set seekToPrevOffset(_arg1:Number):void{
_seekToPrevOffset = _arg1;
}
public function set seekBarScrubTolerance(_arg1:Number):void{
uiMgr.seekBarScrubTolerance = _arg1;
}
override public function get scaleX():Number{
var _local1:VideoPlayer;
_local1 = videoPlayers[_visibleVP];
return ((_local1.width / _origWidth));
}
override public function get scaleY():Number{
var _local1:VideoPlayer;
_local1 = videoPlayers[_visibleVP];
return ((_local1.height / _origHeight));
}
public function get bytesLoaded():uint{
var _local1:VideoPlayer;
_local1 = videoPlayers[_activeVP];
return (_local1.bytesLoaded);
}
override public function set height(_arg1:Number):void{
var _local2:Rectangle;
var _local3:Rectangle;
var _local4:int;
var _local5:VideoPlayer;
if (isLivePreview){
setSize(this.width, _arg1);
return;
};
_local2 = new Rectangle(x, y, width, height);
_local3 = new Rectangle(registrationX, registrationY, registrationWidth, registrationHeight);
resizingNow = true;
_local4 = 0;
while (_local4 < videoPlayers.length) {
_local5 = videoPlayers[_local4];
if (_local5 != null){
_local5.height = _arg1;
};
_local4++;
};
resizingNow = false;
dispatchEvent(new LayoutEvent(LayoutEvent.LAYOUT, false, false, _local2, _local3));
}
public function get forwardButton():Sprite{
return (uiMgr.getControl(UIManager.FORWARD_BUTTON));
}
public function get seekBarInterval():Number{
return (uiMgr.seekBarInterval);
}
public function set totalTime(_arg1:Number):void{
var _local2:VideoPlayerState;
_local2 = videoPlayerStates[_activeVP];
_local2.totalTime = _arg1;
_local2.totalTimeSet = true;
}
public function set skinAutoHide(_arg1:Boolean):void{
if (isLivePreview){
return;
};
uiMgr.skinAutoHide = _arg1;
}
public function set bufferTime(_arg1:Number):void{
var _local2:VideoPlayer;
_local2 = videoPlayers[_activeVP];
_local2.bufferTime = _arg1;
}
public function get fullScreenSkinDelay():int{
return (uiMgr.fullScreenSkinDelay);
}
public function seekToNavCuePoint(_arg1):void{
var _local2:Object;
var _local3:Object;
if ((_arg1 is String)){
_local2 = {name:String(_arg1)};
} else {
if ((_arg1 is Number)){
_local2 = {time:Number(_arg1)};
} else {
_local2 = _arg1;
};
};
if (_local2.name == undefined){
seekToNextNavCuePoint(_local2.time);
return;
};
if (isNaN(_local2.time)){
_local2.time = 0;
};
_local3 = findNearestCuePoint(_arg1, CuePointType.NAVIGATION);
while (((!((_local3 == null))) && ((((_local3.time < _local2.time)) || (!(isFLVCuePointEnabled(_local3))))))) {
_local3 = findNextCuePointWithName(_local3);
};
if (_local3 == null){
throw (new VideoError(VideoError.INVALID_SEEK));
};
seek(_local3.time);
}
private function onCompletePreview(_arg1:Event):void{
var e = _arg1;
try {
previewImage_mc.width = livePreviewWidth;
previewImage_mc.height = livePreviewHeight;
} catch(e:Error) {
};
}
public function set isLive(_arg1:Boolean):void{
var _local2:VideoPlayerState;
_local2 = videoPlayerStates[_activeVP];
_local2.isLive = _arg1;
_local2.isLiveSet = true;
}
flvplayback_internal function showSkinNow(_arg1:TimerEvent):void{
skinShowTimer = null;
uiMgr.visible = true;
}
override public function get x():Number{
var _local1:VideoPlayer;
_local1 = videoPlayers[_visibleVP];
return ((super.x + _local1.x));
}
override public function get y():Number{
var _local1:VideoPlayer;
_local1 = videoPlayers[_visibleVP];
return ((super.y + _local1.y));
}
public function get seekBar():Sprite{
return (uiMgr.getControl(UIManager.SEEK_BAR));
}
public function get volumeBarInterval():Number{
return (uiMgr.volumeBarInterval);
}
public function set registrationHeight(_arg1:Number):void{
height = _arg1;
}
public function get bufferingBarHidesAndDisablesOthers():Boolean{
return (uiMgr.bufferingBarHidesAndDisablesOthers);
}
public function seek(_arg1:Number):void{
var _local2:VideoPlayerState;
var _local3:VideoPlayer;
_local2 = videoPlayerStates[_activeVP];
if (!_firstStreamShown){
_local2.preSeekTime = 0;
queueCmd(_local2, QueuedCommand.SEEK, _arg1);
} else {
_local2.preSeekTime = playheadTime;
_local3 = videoPlayers[_activeVP];
_local3.seek(_arg1);
};
}
public function get state():String{
var _local1:VideoPlayer;
var _local2:String;
var _local3:VideoPlayerState;
if (isLivePreview){
return (VideoState.STOPPED);
};
_local1 = videoPlayers[_activeVP];
if ((((_activeVP == _visibleVP)) && (scrubbing))){
return (VideoState.SEEKING);
};
_local2 = _local1.state;
if (_local2 == VideoState.RESIZING){
return (VideoState.LOADING);
};
_local3 = videoPlayerStates[_activeVP];
if ((((((_local3.prevState == VideoState.LOADING)) && (_local3.autoPlay))) && ((_local2 == VideoState.STOPPED)))){
return (VideoState.LOADING);
};
return (_local2);
}
public function set autoRewind(_arg1:Boolean):void{
var _local2:VideoPlayer;
if (_activeVP == 0){
_autoRewind = _arg1;
};
_local2 = videoPlayers[_activeVP];
_local2.autoRewind = _arg1;
}
public function get volumeBar():Sprite{
return (uiMgr.getControl(UIManager.VOLUME_BAR));
}
flvplayback_internal function skinError(_arg1:String):void{
if (isLivePreview){
return;
};
if (((_firstStreamReady) && (!(_firstStreamShown)))){
showFirstStream();
};
dispatchEvent(new SkinErrorEvent(SkinErrorEvent.SKIN_ERROR, false, false, _arg1));
}
override public function set scaleX(_arg1:Number):void{
var _local2:Rectangle;
var _local3:Rectangle;
var _local4:int;
var _local5:VideoPlayer;
_local2 = new Rectangle(x, y, width, height);
_local3 = new Rectangle(registrationX, registrationY, registrationWidth, registrationHeight);
resizingNow = true;
_local4 = 0;
while (_local4 < videoPlayers.length) {
_local5 = videoPlayers[_local4];
if (_local5 !== null){
_local5.width = (_origWidth * _arg1);
};
_local4++;
};
resizingNow = false;
dispatchEvent(new LayoutEvent(LayoutEvent.LAYOUT, false, false, _local2, _local3));
}
override public function set scaleY(_arg1:Number):void{
var _local2:Rectangle;
var _local3:Rectangle;
var _local4:int;
var _local5:VideoPlayer;
_local2 = new Rectangle(x, y, width, height);
_local3 = new Rectangle(registrationX, registrationY, registrationWidth, registrationHeight);
resizingNow = true;
_local4 = 0;
while (_local4 < videoPlayers.length) {
_local5 = videoPlayers[_local4];
if (_local5 !== null){
_local5.height = (_origHeight * _arg1);
};
_local4++;
};
resizingNow = false;
dispatchEvent(new LayoutEvent(LayoutEvent.LAYOUT, false, false, _local2, _local3));
}
flvplayback_internal function createVideoPlayer(_arg1:Number):void{
var vp:VideoPlayer;
var added:Boolean;
var vpState:VideoPlayerState;
var cpMgr:CuePointManager;
var skinDepth:int;
var index = _arg1;
if (isLivePreview){
return;
};
vp = videoPlayers[index];
if (vp == null){
var _local3 = new VideoPlayer(0, 0);
vp = _local3;
videoPlayers[index] = _local3;
vp.setSize(registrationWidth, registrationHeight);
};
vp.visible = false;
vp.volume = 0;
vp.name = String(index);
added = false;
if (uiMgr.skin_mc != null){
try {
skinDepth = getChildIndex(uiMgr.skin_mc);
if (skinDepth > 0){
addChildAt(vp, skinDepth);
added = true;
};
} catch(err:Error) {
};
};
if (!added){
addChild(vp);
};
_topVP = index;
vp.autoRewind = _autoRewind;
vp.scaleMode = _scaleMode;
vp.bufferTime = _bufferTime;
vp.idleTimeout = _idleTimeout;
vp.playheadUpdateInterval = _playheadUpdateInterval;
vp.progressInterval = _progressInterval;
vp.soundTransform = _soundTransform;
vpState = new VideoPlayerState(vp, index);
videoPlayerStates[index] = vpState;
videoPlayerStateDict[vp] = vpState;
vp.addEventListener(AutoLayoutEvent.AUTO_LAYOUT, handleAutoLayoutEvent);
vp.addEventListener(MetadataEvent.CUE_POINT, handleMetadataEvent);
vp.addEventListener(MetadataEvent.METADATA_RECEIVED, handleMetadataEvent);
vp.addEventListener(VideoProgressEvent.PROGRESS, handleVideoProgressEvent);
vp.addEventListener(VideoEvent.AUTO_REWOUND, handleVideoEvent);
vp.addEventListener(VideoEvent.CLOSE, handleVideoEvent);
vp.addEventListener(VideoEvent.COMPLETE, handleVideoEvent);
vp.addEventListener(VideoEvent.PLAYHEAD_UPDATE, handleVideoEvent);
vp.addEventListener(VideoEvent.STATE_CHANGE, handleVideoEvent);
vp.addEventListener(VideoEvent.READY, handleVideoEvent);
cpMgr = new CuePointManager(this, index);
cuePointMgrs[index] = cpMgr;
cpMgr.playheadUpdateInterval = _playheadUpdateInterval;
}
public function findNearestCuePoint(_arg1, _arg2:String="all"):Object{
var _local3:CuePointManager;
_local3 = cuePointMgrs[_activeVP];
switch (_arg2){
case "event":
return (_local3.getCuePoint(_local3.eventCuePoints, true, _arg1));
case "navigation":
return (_local3.getCuePoint(_local3.navCuePoints, true, _arg1));
case "flv":
return (_local3.getCuePoint(_local3.flvCuePoints, true, _arg1));
case "actionscript":
return (_local3.getCuePoint(_local3.asCuePoints, true, _arg1));
case "all":
default:
return (_local3.getCuePoint(_local3.allCuePoints, true, _arg1));
};
}
public function get muteButton():Sprite{
return (uiMgr.getControl(UIManager.MUTE_BUTTON));
}
public function seekPercent(_arg1:Number):void{
var _local2:VideoPlayer;
_local2 = videoPlayers[_activeVP];
if (((((((((isNaN(_arg1)) || ((_arg1 < 0)))) || ((_arg1 > 100)))) || (isNaN(_local2.totalTime)))) || ((_local2.totalTime <= 0)))){
throw (new VideoError(VideoError.INVALID_SEEK));
};
seek(((_local2.totalTime * _arg1) / 100));
}
public function set forwardButton(_arg1:Sprite):void{
uiMgr.setControl(UIManager.FORWARD_BUTTON, _arg1);
}
public function get registrationWidth():Number{
var _local1:VideoPlayer;
_local1 = videoPlayers[_visibleVP];
return (_local1.registrationWidth);
}
flvplayback_internal function queueCmd(_arg1:VideoPlayerState, _arg2:Number, _arg3:Number=NaN):void{
if (_arg1.cmdQueue == null){
_arg1.cmdQueue = new Array();
};
_arg1.cmdQueue.push(new QueuedCommand(_arg2, null, false, _arg3));
}
private function doContentPathConnect(_arg1):void{
var _local2:int;
var _local3:VideoPlayer;
var _local4:VideoPlayerState;
if (isLivePreview){
return;
};
_local2 = 0;
if ((_arg1 is int)){
_local2 = int(_arg1);
} else {
removeEventListener(Event.ENTER_FRAME, doContentPathConnect);
};
_local3 = videoPlayers[_local2];
_local4 = videoPlayerStates[_local2];
if (!_local4.isWaiting){
return;
};
if (((_local4.autoPlay) && (_firstStreamShown))){
_local3.play(_local4.url, _local4.totalTime, _local4.isLive);
} else {
_local3.load(_local4.url, _local4.totalTime, _local4.isLive);
};
_local4.isLiveSet = false;
_local4.totalTimeSet = false;
_local4.isWaiting = false;
}
public function get registrationX():Number{
return (super.x);
}
public function bringVideoPlayerToFront(_arg1:uint):void{
var vp:VideoPlayer;
var moved:Boolean;
var skinDepth:int;
var index = _arg1;
if (index == _topVP){
return;
};
vp = videoPlayers[index];
if (vp == null){
createVideoPlayer(index);
vp = videoPlayers[index];
};
moved = false;
if (uiMgr.skin_mc != null){
try {
skinDepth = getChildIndex(uiMgr.skin_mc);
if (skinDepth > 0){
setChildIndex(vp, (skinDepth - 1));
moved = true;
};
} catch(err:Error) {
};
};
if (!moved){
setChildIndex(vp, (numChildren - 1));
};
_topVP = index;
}
public function get registrationY():Number{
return (super.y);
}
public function get pauseButton():Sprite{
return (uiMgr.getControl(UIManager.PAUSE_BUTTON));
}
public function set seekBarInterval(_arg1:Number):void{
uiMgr.seekBarInterval = _arg1;
}
public function addASCuePoint(_arg1, _arg2:String=null, _arg3:Object=null):Object{
var _local4:CuePointManager;
_local4 = cuePointMgrs[_activeVP];
return (_local4.addASCuePoint(_arg1, _arg2, _arg3));
}
public function get playheadPercentage():Number{
var _local1:VideoPlayer;
_local1 = videoPlayers[_activeVP];
if (isNaN(_local1.totalTime)){
return (NaN);
};
return (((_local1.playheadTime / _local1.totalTime) * 100));
}
public function setFLVCuePointEnabled(_arg1:Boolean, _arg2):Number{
var _local3:CuePointManager;
_local3 = cuePointMgrs[_activeVP];
return (_local3.setFLVCuePointEnabled(_arg1, _arg2));
}
public function set fullScreenSkinDelay(_arg1:int):void{
uiMgr.fullScreenSkinDelay = _arg1;
}
public function seekToNextNavCuePoint(_arg1:Number=NaN):void{
var _local2:VideoPlayer;
var _local3:Object;
var _local4:Number;
_local2 = videoPlayers[_activeVP];
if (((isNaN(_arg1)) || ((_arg1 < 0)))){
_arg1 = (_local2.playheadTime + 0.001);
};
_local3 = findNearestCuePoint(_arg1, CuePointType.NAVIGATION);
if (_local3 == null){
seek(_local2.totalTime);
return;
};
_local4 = _local3.index;
if (_local3.time < _arg1){
_local4++;
};
while ((((_local4 < _local3.array.length)) && (!(isFLVCuePointEnabled(_local3.array[_local4]))))) {
_local4++;
};
if (_local4 >= _local3.array.length){
_arg1 = _local2.totalTime;
if (_local3.array[(_local3.array.length - 1)].time > _arg1){
_arg1 = _local3.array[(_local3.array.length - 1)];
};
seek(_arg1);
} else {
seek(_local3.array[_local4].time);
};
}
public function load(_arg1:String, _arg2:Number=NaN, _arg3:Boolean=false):void{
if ((((_arg1 == null)) || ((_arg1.length == 0)))){
return;
};
if (_arg1 == this.source){
return;
};
this.autoPlay = false;
this.totalTime = _arg2;
this.isLive = _arg3;
this.source = _arg1;
}
public function seekSeconds(_arg1:Number):void{
seek(_arg1);
}
public function get fullScreenButton():Sprite{
return (uiMgr.getControl(UIManager.FULL_SCREEN_BUTTON));
}
public function get scrubbing():Boolean{
var _local1:Sprite;
var _local2:ControlData;
_local1 = seekBar;
if (_local1 != null){
_local2 = uiMgr.ctrlDataDict[_local1];
return (_local2.isDragging);
};
return (false);
}
override public function set y(_arg1:Number):void{
var _local2:VideoPlayer;
_local2 = videoPlayers[_visibleVP];
super.y = (_arg1 - _local2.y);
}
public function removeASCuePoint(_arg1):Object{
var _local2:CuePointManager;
_local2 = cuePointMgrs[_activeVP];
return (_local2.removeASCuePoint(_arg1));
}
public function get fullScreenTakeOver():Boolean{
return (uiMgr.fullScreenTakeOver);
}
override public function set x(_arg1:Number):void{
var _local2:VideoPlayer;
_local2 = videoPlayers[_visibleVP];
super.x = (_arg1 - _local2.x);
}
public function get backButton():Sprite{
return (uiMgr.getControl(UIManager.BACK_BUTTON));
}
public function set seekBar(_arg1:Sprite):void{
uiMgr.setControl(UIManager.SEEK_BAR, _arg1);
}
public function set skin(_arg1:String):void{
uiMgr.skin = _arg1;
}
public function set componentInspectorSetting(_arg1:Boolean):void{
_componentInspectorSetting = _arg1;
}
public function get preferredHeight():int{
var _local1:VideoPlayer;
_local1 = videoPlayers[_activeVP];
return (_local1.videoHeight);
}
public function set volumeBarInterval(_arg1:Number):void{
uiMgr.volumeBarInterval = _arg1;
}
public function set autoPlay(_arg1:Boolean):void{
var _local2:VideoPlayerState;
_local2 = videoPlayerStates[_activeVP];
_local2.autoPlay = _arg1;
}
public function set visibleVideoPlayerIndex(_arg1:uint):void{
var _local2:VideoPlayer;
var _local3:VideoPlayer;
var _local4:uint;
var _local5:Rectangle;
var _local6:Rectangle;
if (_visibleVP == _arg1){
return;
};
if (videoPlayers[_arg1] == undefined){
createVideoPlayer(_arg1);
};
_local2 = videoPlayers[_arg1];
_local3 = videoPlayers[_visibleVP];
_local3.visible = false;
_local3.volume = 0;
_visibleVP = _arg1;
if (_firstStreamShown){
uiMgr.setupSkinAutoHide(false);
_local2.visible = true;
_soundTransform.volume = (scrubbing) ? _volume : 0;
_local2.soundTransform = _soundTransform;
} else {
if (((((((_local2.stateResponsive) || ((_local2.state == VideoState.CONNECTION_ERROR)))) || ((_local2.state == VideoState.DISCONNECTED)))) && (uiMgr.skinReady))){
uiMgr.visible = true;
uiMgr.setupSkinAutoHide(false);
_firstStreamReady = true;
if (uiMgr.skin == ""){
uiMgr.hookUpCustomComponents();
};
showFirstStream();
};
};
if (((!((_local2.height == _local3.height))) || (!((_local2.width == _local3.width))))){
_local5 = new Rectangle((_local3.x + super.x), (_local3.y + super.y), _local3.width, _local3.height);
_local6 = new Rectangle((_local3.registrationX + super.x), (_local3.registrationY + super.y), _local3.registrationWidth, _local3.registrationHeight);
dispatchEvent(new LayoutEvent(LayoutEvent.LAYOUT, false, false, _local5, _local6));
};
_local4 = _activeVP;
_activeVP = _visibleVP;
uiMgr.handleIVPEvent(new VideoEvent(VideoEvent.STATE_CHANGE, false, false, state, playheadTime, _visibleVP));
uiMgr.handleIVPEvent(new VideoEvent(VideoEvent.PLAYHEAD_UPDATE, false, false, state, playheadTime, _visibleVP));
if (_local2.isRTMP){
uiMgr.handleIVPEvent(new VideoEvent(VideoEvent.READY, false, false, state, playheadTime, _visibleVP));
} else {
uiMgr.handleIVPEvent(new VideoProgressEvent(VideoProgressEvent.PROGRESS, false, false, bytesLoaded, bytesTotal, _visibleVP));
};
_activeVP = _local4;
}
public function get bufferingBar():Sprite{
return (uiMgr.getControl(UIManager.BUFFERING_BAR));
}
flvplayback_internal function _scrubStart():void{
var _local1:Number;
var _local2:VideoPlayer;
_local1 = playheadTime;
_local2 = videoPlayers[_visibleVP];
_volume = _local2.volume;
_local2.volume = 0;
dispatchEvent(new VideoEvent(VideoEvent.STATE_CHANGE, false, false, VideoState.SEEKING, _local1, _visibleVP));
dispatchEvent(new VideoEvent(VideoEvent.SCRUB_START, false, false, VideoState.SEEKING, _local1, _visibleVP));
}
public function get align():String{
var _local1:VideoPlayer;
_local1 = videoPlayers[_activeVP];
return (_local1.align);
}
flvplayback_internal function handleAutoLayoutEvent(_arg1:AutoLayoutEvent):void{
var _local2:VideoPlayerState;
var _local3:AutoLayoutEvent;
var _local4:Rectangle;
var _local5:Rectangle;
_local2 = videoPlayerStateDict[_arg1.currentTarget];
_local3 = AutoLayoutEvent(_arg1.clone());
_local3.oldBounds.x = (_local3.oldBounds.x + super.x);
_local3.oldBounds.y = (_local3.oldBounds.y + super.y);
_local3.oldRegistrationBounds.x = (_local3.oldRegistrationBounds.x + super.y);
_local3.oldRegistrationBounds.y = (_local3.oldRegistrationBounds.y + super.y);
_local3.vp = _local2.index;
dispatchEvent(_local3);
if (((!(resizingNow)) && ((_local2.index == _visibleVP)))){
_local4 = Rectangle(_arg1.oldBounds.clone());
_local5 = Rectangle(_arg1.oldRegistrationBounds.clone());
_local4.x = (_local4.x + super.x);
_local4.y = (_local4.y + super.y);
_local5.x = (_local5.x + super.y);
_local5.y = (_local5.y + super.y);
dispatchEvent(new LayoutEvent(LayoutEvent.LAYOUT, false, false, _local4, _local5));
};
}
public function findNextCuePointWithName(_arg1:Object):Object{
var _local2:CuePointManager;
_local2 = cuePointMgrs[_activeVP];
return (_local2.getNextCuePointWithName(_arg1));
}
public function set playButton(_arg1:Sprite):void{
uiMgr.setControl(UIManager.PLAY_BUTTON, _arg1);
}
public function set bitrate(_arg1:Number):void{
ncMgr.bitrate = _arg1;
}
public function set bufferingBarHidesAndDisablesOthers(_arg1:Boolean):void{
uiMgr.bufferingBarHidesAndDisablesOthers = _arg1;
}
override public function get soundTransform():SoundTransform{
var _local1:VideoPlayer;
var _local2:SoundTransform;
_local1 = videoPlayers[_visibleVP];
_local2 = _local1.soundTransform;
if (scrubbing){
_local2.volume = _volume;
};
return (_local2);
}
public function get stateResponsive():Boolean{
var _local1:VideoPlayer;
_local1 = videoPlayers[_activeVP];
return (_local1.stateResponsive);
}
public function get idleTimeout():Number{
var _local1:VideoPlayer;
_local1 = videoPlayers[_activeVP];
return (_local1.idleTimeout);
}
override public function get height():Number{
var _local1:VideoPlayer;
if (isLivePreview){
return (livePreviewHeight);
};
_local1 = videoPlayers[_visibleVP];
return (_local1.height);
}
public function set registrationWidth(_arg1:Number):void{
width = _arg1;
}
public function get metadata():Object{
var _local1:VideoPlayer;
_local1 = videoPlayers[_activeVP];
return (_local1.metadata);
}
public function set skinBackgroundColor(_arg1:uint):void{
uiMgr.skinBackgroundColor = _arg1;
}
public function get volume():Number{
return (_volume);
}
public function play(_arg1:String=null, _arg2:Number=NaN, _arg3:Boolean=false):void{
var _local4:VideoPlayerState;
var _local5:VideoPlayer;
if (_arg1 == null){
if (!_firstStreamShown){
_local4 = videoPlayerStates[_activeVP];
queueCmd(_local4, QueuedCommand.PLAY);
} else {
_local5 = videoPlayers[_activeVP];
_local5.play();
};
} else {
if (_arg1 == this.source){
return;
};
this.autoPlay = true;
this.totalTime = _arg2;
this.isLive = _arg3;
this.source = _arg1;
};
}
public function get paused():Boolean{
return ((state == VideoState.PAUSED));
}
flvplayback_internal function handleVideoEvent(_arg1:VideoEvent):void{
var _local2:VideoPlayerState;
var _local3:CuePointManager;
var _local4:VideoEvent;
var _local5:String;
var _local6:Number;
_local2 = videoPlayerStateDict[_arg1.currentTarget];
_local3 = cuePointMgrs[_local2.index];
_local4 = VideoEvent(_arg1.clone());
_local4.vp = _local2.index;
_local5 = ((((_local2.index == _visibleVP)) && (scrubbing))) ? VideoState.SEEKING : _arg1.state;
switch (_arg1.type){
case VideoEvent.AUTO_REWOUND:
dispatchEvent(_local4);
dispatchEvent(new VideoEvent(VideoEvent.REWIND, false, false, _local5, _arg1.playheadTime, _local2.index));
_local3.resetASCuePointIndex(_arg1.playheadTime);
break;
case VideoEvent.PLAYHEAD_UPDATE:
_local4.state = _local5;
dispatchEvent(_local4);
if (((!(isNaN(_local2.preSeekTime))) && (!((_arg1.state == VideoState.SEEKING))))){
_local6 = _local2.preSeekTime;
_local2.preSeekTime = NaN;
_local3.resetASCuePointIndex(_arg1.playheadTime);
dispatchEvent(new VideoEvent(VideoEvent.SEEKED, false, false, _arg1.state, _arg1.playheadTime, _local2.index));
if (_local6 < _arg1.playheadTime){
dispatchEvent(new VideoEvent(VideoEvent.FAST_FORWARD, false, false, _arg1.state, _arg1.playheadTime, _local2.index));
} else {
if (_local6 > _arg1.playheadTime){
dispatchEvent(new VideoEvent(VideoEvent.REWIND, false, false, _arg1.state, _arg1.playheadTime, _local2.index));
};
};
};
_local3.dispatchASCuePoints();
break;
case VideoEvent.STATE_CHANGE:
if ((((_local2.index == _visibleVP)) && (scrubbing))){
break;
};
if (_arg1.state == VideoState.RESIZING){
break;
};
if ((((((_local2.prevState == VideoState.LOADING)) && (_local2.autoPlay))) && ((_arg1.state == VideoState.STOPPED)))){
return;
};
if ((((((((_arg1.state == VideoState.CONNECTION_ERROR)) && ((_arg1.vp == _visibleVP)))) && (!(_firstStreamShown)))) && (uiMgr.skinReady))){
showFirstStream();
uiMgr.visible = true;
if (uiMgr.skin == ""){
uiMgr.hookUpCustomComponents();
};
if (skinShowTimer != null){
skinShowTimer.reset();
skinShowTimer = null;
};
};
_local2.prevState = _arg1.state;
_local4.state = _local5;
dispatchEvent(_local4);
if (_local2.owner.state != _arg1.state){
return;
};
switch (_arg1.state){
case VideoState.BUFFERING:
dispatchEvent(new VideoEvent(VideoEvent.BUFFERING_STATE_ENTERED, false, false, _local5, _arg1.playheadTime, _local2.index));
break;
case VideoState.PAUSED:
dispatchEvent(new VideoEvent(VideoEvent.PAUSED_STATE_ENTERED, false, false, _local5, _arg1.playheadTime, _local2.index));
break;
case VideoState.PLAYING:
dispatchEvent(new VideoEvent(VideoEvent.PLAYING_STATE_ENTERED, false, false, _local5, _arg1.playheadTime, _local2.index));
break;
case VideoState.STOPPED:
dispatchEvent(new VideoEvent(VideoEvent.STOPPED_STATE_ENTERED, false, false, _local5, _arg1.playheadTime, _local2.index));
break;
};
break;
case VideoEvent.READY:
if (!_firstStreamReady){
if (_local2.index == _visibleVP){
_firstStreamReady = true;
if (((uiMgr.skinReady) && (!(_firstStreamShown)))){
uiMgr.visible = true;
if (uiMgr.skin == ""){
uiMgr.hookUpCustomComponents();
};
showFirstStream();
};
};
} else {
if (((((_firstStreamShown) && ((_arg1.state == VideoState.STOPPED)))) && (_local2.autoPlay))){
if (_local2.owner.isRTMP){
_local2.owner.play();
} else {
_local2.prevState = VideoState.STOPPED;
_local2.owner.playWhenEnoughDownloaded();
};
};
};
_local4.state = _local5;
dispatchEvent(_local4);
break;
case VideoEvent.CLOSE:
case VideoEvent.COMPLETE:
_local4.state = _local5;
dispatchEvent(_local4);
break;
};
}
public function set volumeBar(_arg1:Sprite):void{
uiMgr.setControl(UIManager.VOLUME_BAR, _arg1);
}
public function set fullScreenBackgroundColor(_arg1:uint):void{
uiMgr.fullScreenBackgroundColor = _arg1;
}
public function get isLive():Boolean{
var _local1:VideoPlayerState;
var _local2:VideoPlayer;
_local1 = videoPlayerStates[_activeVP];
if (_local1.isLiveSet){
return (_local1.isLive);
};
_local2 = videoPlayers[_activeVP];
return (_local2.isLive);
}
public function get bufferTime():Number{
var _local1:VideoPlayer;
_local1 = videoPlayers[_activeVP];
return (_local1.bufferTime);
}
public function get registrationHeight():Number{
var _local1:VideoPlayer;
_local1 = videoPlayers[_visibleVP];
return (_local1.registrationHeight);
}
public function get playPauseButton():Sprite{
return (uiMgr.getControl(UIManager.PLAY_PAUSE_BUTTON));
}
flvplayback_internal function showFirstStream():void{
var _local1:VideoPlayer;
var _local2:int;
var _local3:VideoPlayerState;
var _local4:int;
_firstStreamShown = true;
_local1 = videoPlayers[_visibleVP];
_local1.visible = true;
if (!scrubbing){
_soundTransform.volume = _volume;
_local1.soundTransform = _soundTransform;
};
_local2 = 0;
while (_local2 < videoPlayers.length) {
_local1 = videoPlayers[_local2];
if (_local1 != null){
_local3 = videoPlayerStates[_local2];
if ((((_local1.state == VideoState.STOPPED)) && (_local3.autoPlay))){
if (_local1.isRTMP){
_local1.play();
} else {
_local3.prevState = VideoState.STOPPED;
_local1.playWhenEnoughDownloaded();
};
};
if (_local3.cmdQueue != null){
_local4 = 0;
while (_local4 < _local3.cmdQueue.length) {
switch (_local3.cmdQueue[_local4].type){
case QueuedCommand.PLAY:
_local1.play();
break;
case QueuedCommand.PAUSE:
_local1.pause();
break;
case QueuedCommand.STOP:
_local1.stop();
break;
case QueuedCommand.SEEK:
_local1.seek(_local3.cmdQueue[_local4].time);
break;
case QueuedCommand.PLAY_WHEN_ENOUGH:
_local1.playWhenEnoughDownloaded();
break;
};
_local4++;
};
_local3.cmdQueue = null;
};
};
_local2++;
};
}
public function set volumeBarScrubTolerance(_arg1:Number):void{
uiMgr.volumeBarScrubTolerance = _arg1;
}
public function set skinBackgroundAlpha(_arg1:Number):void{
uiMgr.skinBackgroundAlpha = _arg1;
}
public function get playheadUpdateInterval():Number{
var _local1:VideoPlayer;
_local1 = videoPlayers[_activeVP];
return (_local1.playheadUpdateInterval);
}
public function set muteButton(_arg1:Sprite):void{
uiMgr.setControl(UIManager.MUTE_BUTTON, _arg1);
}
public function get autoRewind():Boolean{
var _local1:VideoPlayer;
_local1 = videoPlayers[_activeVP];
return (_local1.autoRewind);
}
flvplayback_internal function handleMetadataEvent(_arg1:MetadataEvent):void{
var _local2:VideoPlayerState;
var _local3:CuePointManager;
var _local4:MetadataEvent;
_local2 = videoPlayerStateDict[_arg1.currentTarget];
_local3 = cuePointMgrs[_local2.index];
switch (_arg1.type){
case MetadataEvent.METADATA_RECEIVED:
_local3.processFLVCuePoints(_arg1.info.cuePoints);
break;
case MetadataEvent.CUE_POINT:
if (!_local3.isFLVCuePointEnabled(_arg1.info)){
return;
};
break;
};
_local4 = MetadataEvent(_arg1.clone());
_local4.vp = _local2.index;
dispatchEvent(_local4);
}
public function playWhenEnoughDownloaded():void{
var _local1:VideoPlayerState;
var _local2:VideoPlayer;
if (!_firstStreamShown){
_local1 = videoPlayerStates[_activeVP];
queueCmd(_local1, QueuedCommand.PLAY_WHEN_ENOUGH);
} else {
_local2 = videoPlayers[_activeVP];
_local2.playWhenEnoughDownloaded();
};
}
public function get bitrate():Number{
return (ncMgr.bitrate);
}
public function get fullScreenBackgroundColor():uint{
return (uiMgr.fullScreenBackgroundColor);
}
public function get skin():String{
return (uiMgr.skin);
}
public function set registrationX(_arg1:Number):void{
super.x = _arg1;
}
public function set registrationY(_arg1:Number):void{
super.y = _arg1;
}
public function setSize(_arg1:Number, _arg2:Number):void{
var _local3:Rectangle;
var _local4:Rectangle;
var _local5:int;
var _local6:VideoPlayer;
_local3 = new Rectangle(x, y, this.width, this.height);
_local4 = new Rectangle(registrationX, registrationY, registrationWidth, registrationHeight);
if (isLivePreview){
livePreviewWidth = _arg1;
livePreviewHeight = _arg2;
if (previewImage_mc != null){
previewImage_mc.width = _arg1;
previewImage_mc.height = _arg2;
};
preview_mc.box_mc.width = _arg1;
preview_mc.box_mc.height = _arg2;
if ((((preview_mc.box_mc.width < preview_mc.icon_mc.width)) || ((preview_mc.box_mc.height < preview_mc.icon_mc.height)))){
preview_mc.icon_mc.visible = false;
} else {
preview_mc.icon_mc.visible = true;
preview_mc.icon_mc.x = ((preview_mc.box_mc.width - preview_mc.icon_mc.width) / 2);
preview_mc.icon_mc.y = ((preview_mc.box_mc.height - preview_mc.icon_mc.height) / 2);
};
dispatchEvent(new LayoutEvent(LayoutEvent.LAYOUT, false, false, _local3, _local4));
return;
};
resizingNow = true;
_local5 = 0;
while (_local5 < videoPlayers.length) {
_local6 = videoPlayers[_local5];
if (_local6 != null){
_local6.setSize(_arg1, _arg2);
};
_local5++;
};
resizingNow = false;
dispatchEvent(new LayoutEvent(LayoutEvent.LAYOUT, false, false, _local3, _local4));
}
public function get isRTMP():Boolean{
var _local1:VideoPlayer;
if (isLivePreview){
return (true);
};
_local1 = videoPlayers[_activeVP];
return (_local1.isRTMP);
}
public function set preview(_arg1:String):void{
var filename = _arg1;
if (!isLivePreview){
return;
};
previewImageUrl = filename;
if (previewImage_mc != null){
removeChild(previewImage_mc);
};
previewImage_mc = new Loader();
previewImage_mc.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompletePreview);
previewImage_mc.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, function (_arg1:IOErrorEvent):void{
});
previewImage_mc.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, function (_arg1:SecurityErrorEvent):void{
});
addChildAt(previewImage_mc, 1);
previewImage_mc.load(new URLRequest(previewImageUrl));
}
override public function set width(_arg1:Number):void{
var _local2:Rectangle;
var _local3:Rectangle;
var _local4:int;
var _local5:VideoPlayer;
if (isLivePreview){
setSize(_arg1, this.height);
return;
};
_local2 = new Rectangle(x, y, width, height);
_local3 = new Rectangle(registrationX, registrationY, registrationWidth, registrationHeight);
resizingNow = true;
_local4 = 0;
while (_local4 < videoPlayers.length) {
_local5 = videoPlayers[_local4];
if (_local5 != null){
_local5.width = _arg1;
};
_local4++;
};
resizingNow = false;
dispatchEvent(new LayoutEvent(LayoutEvent.LAYOUT, false, false, _local2, _local3));
}
public function get playButton():Sprite{
return (uiMgr.getControl(UIManager.PLAY_BUTTON));
}
public function set pauseButton(_arg1:Sprite):void{
uiMgr.setControl(UIManager.PAUSE_BUTTON, _arg1);
}
public function get bytesTotal():uint{
var _local1:VideoPlayer;
_local1 = videoPlayers[_activeVP];
return (_local1.bytesTotal);
}
public function seekToPrevNavCuePoint(_arg1:Number=NaN):void{
var _local2:Object;
var _local3:Number;
var _local4:VideoPlayer;
if (((isNaN(_arg1)) || ((_arg1 < 0)))){
_local4 = videoPlayers[_activeVP];
_arg1 = _local4.playheadTime;
};
_local2 = findNearestCuePoint(_arg1, CuePointType.NAVIGATION);
if (_local2 == null){
seek(0);
return;
};
_local3 = _local2.index;
while ((((_local3 >= 0)) && (((!(isFLVCuePointEnabled(_local2.array[_local3]))) || ((_local2.array[_local3].time >= (_arg1 - _seekToPrevOffset))))))) {
_local3--;
};
if (_local3 < 0){
seek(0);
} else {
seek(_local2.array[_local3].time);
};
}
public function get autoPlay():Boolean{
var _local1:VideoPlayerState;
_local1 = videoPlayerStates[_activeVP];
return (_local1.autoPlay);
}
public function set playheadPercentage(_arg1:Number):void{
seekPercent(_arg1);
}
public function isFLVCuePointEnabled(_arg1):Boolean{
var _local2:CuePointManager;
_local2 = cuePointMgrs[_activeVP];
return (_local2.isFLVCuePointEnabled(_arg1));
}
public function get buffering():Boolean{
return ((state == VideoState.BUFFERING));
}
public function get volumeBarScrubTolerance():Number{
return (uiMgr.volumeBarScrubTolerance);
}
public function get skinBackgroundColor():uint{
return (uiMgr.skinBackgroundColor);
}
public function get visibleVideoPlayerIndex():uint{
return (_visibleVP);
}
public function set stopButton(_arg1:Sprite):void{
uiMgr.setControl(UIManager.STOP_BUTTON, _arg1);
}
public function get skinBackgroundAlpha():Number{
return (uiMgr.skinBackgroundAlpha);
}
public function get preferredWidth():int{
var _local1:VideoPlayer;
_local1 = videoPlayers[_activeVP];
return (_local1.videoWidth);
}
override public function get width():Number{
var _local1:VideoPlayer;
if (isLivePreview){
return (livePreviewWidth);
};
_local1 = videoPlayers[_visibleVP];
return (_local1.width);
}
public function get stopped():Boolean{
return ((state == VideoState.STOPPED));
}
public function set fullScreenButton(_arg1:Sprite):void{
uiMgr.setControl(UIManager.FULL_SCREEN_BUTTON, _arg1);
}
public function get stopButton():Sprite{
return (uiMgr.getControl(UIManager.STOP_BUTTON));
}
public function set playheadUpdateInterval(_arg1:Number):void{
var _local2:CuePointManager;
var _local3:VideoPlayer;
if (_activeVP == 0){
_playheadUpdateInterval = _arg1;
};
_local2 = cuePointMgrs[_activeVP];
_local2.playheadUpdateInterval = _arg1;
_local3 = videoPlayers[_activeVP];
_local3.playheadUpdateInterval = _arg1;
}
private function createLivePreviewMovieClip():void{
preview_mc = new MovieClip();
preview_mc.name = "preview_mc";
preview_mc.box_mc = new MovieClip();
preview_mc.box_mc.name = "box_mc";
preview_mc.box_mc.graphics.beginFill(0);
preview_mc.box_mc.graphics.moveTo(0, 0);
preview_mc.box_mc.graphics.lineTo(0, 100);
preview_mc.box_mc.graphics.lineTo(100, 100);
preview_mc.box_mc.graphics.lineTo(100, 0);
preview_mc.box_mc.graphics.lineTo(0, 0);
preview_mc.box_mc.graphics.endFill();
preview_mc.addChild(preview_mc.box_mc);
preview_mc.icon_mc = new Icon();
preview_mc.icon_mc.name = "icon_mc";
preview_mc.addChild(preview_mc.icon_mc);
addChild(preview_mc);
}
public function set idleTimeout(_arg1:Number):void{
var _local2:VideoPlayer;
if (_activeVP == 0){
_idleTimeout = _arg1;
};
_local2 = videoPlayers[_activeVP];
_local2.idleTimeout = _arg1;
}
flvplayback_internal function skinLoaded():void{
var _local1:VideoPlayer;
if (isLivePreview){
return;
};
_local1 = videoPlayers[_visibleVP];
if (((((_firstStreamReady) || ((_local1.state == VideoState.CONNECTION_ERROR)))) || ((_local1.state == VideoState.DISCONNECTED)))){
uiMgr.visible = true;
if (!_firstStreamShown){
showFirstStream();
};
} else {
if (skinShowTimer != null){
skinShowTimer.reset();
skinShowTimer = null;
};
skinShowTimer = new Timer(DEFAULT_SKIN_SHOW_TIMER_INTERVAL, 1);
skinShowTimer.addEventListener(TimerEvent.TIMER, showSkinNow);
skinShowTimer.start();
};
dispatchEvent(new VideoEvent(VideoEvent.SKIN_LOADED, false, false, state, playheadTime, _visibleVP));
}
flvplayback_internal function _scrubFinish():void{
var _local1:Number;
var _local2:String;
var _local3:VideoPlayer;
_local1 = playheadTime;
_local2 = state;
_local3 = videoPlayers[_visibleVP];
_soundTransform.volume = _volume;
_local3.soundTransform = _soundTransform;
if (_local2 != VideoState.SEEKING){
dispatchEvent(new VideoEvent(VideoEvent.STATE_CHANGE, false, false, _local2, _local1, _visibleVP));
};
dispatchEvent(new VideoEvent(VideoEvent.SCRUB_FINISH, false, false, _local2, _local1, _visibleVP));
}
public function set playPauseButton(_arg1:Sprite):void{
uiMgr.setControl(UIManager.PLAY_PAUSE_BUTTON, _arg1);
}
public function set backButton(_arg1:Sprite):void{
uiMgr.setControl(UIManager.BACK_BUTTON, _arg1);
}
public function set cuePoints(_arg1:Array):void{
if (!_componentInspectorSetting){
return;
};
cuePointMgrs[0].processCuePointsProperty(_arg1);
}
public function findCuePoint(_arg1, _arg2:String="all"):Object{
var _local3:CuePointManager;
_local3 = cuePointMgrs[_activeVP];
switch (_arg2){
case "event":
return (_local3.getCuePoint(_local3.eventCuePoints, false, _arg1));
case "navigation":
return (_local3.getCuePoint(_local3.navCuePoints, false, _arg1));
case "flv":
return (_local3.getCuePoint(_local3.flvCuePoints, false, _arg1));
case "actionscript":
return (_local3.getCuePoint(_local3.asCuePoints, false, _arg1));
case "all":
default:
return (_local3.getCuePoint(_local3.allCuePoints, false, _arg1));
};
}
public function get seekBarScrubTolerance():Number{
return (uiMgr.seekBarScrubTolerance);
}
flvplayback_internal function handleVideoProgressEvent(_arg1:VideoProgressEvent):void{
var _local2:VideoPlayerState;
var _local3:VideoProgressEvent;
_local2 = videoPlayerStateDict[_arg1.currentTarget];
_local3 = VideoProgressEvent(_arg1.clone());
_local3.vp = _local2.index;
dispatchEvent(_local3);
}
}
}//package fl.video
Section 85
//flvplayback_internal (fl.video.flvplayback_internal)
package fl.video {
public namespace flvplayback_internal = "http://www.adobe.com/2007/flash/flvplayback/internal";
}//package fl.video
Section 86
//FPADManager (fl.video.FPADManager)
package fl.video {
import flash.net.*;
import flash.events.*;
public class FPADManager {
flvplayback_internal var _parseResults:ParseResults;
flvplayback_internal var rtmpURL:String;
flvplayback_internal var _url:String;
flvplayback_internal var xmlLoader:URLLoader;
flvplayback_internal var xml:XML;
flvplayback_internal var _uriParam:String;
private var _owner:INCManager;
public static const VERSION:String = "2.0.0.37";
public static const SHORT_VERSION:String = "2.0";
public function FPADManager(_arg1:INCManager){
_owner = _arg1;
}
flvplayback_internal function connectXML(_arg1:String, _arg2:String, _arg3:String, _arg4:ParseResults):Boolean{
_uriParam = _arg2;
_parseResults = _arg4;
_url = ((_arg1 + "uri=") + _parseResults.protocol);
if (_parseResults.serverName != null){
_url = (_url + ("/" + _parseResults.serverName));
};
if (_parseResults.portNumber != null){
_url = (_url + (":" + _parseResults.portNumber));
};
if (_parseResults.wrappedURL != null){
_url = (_url + ("/?" + _parseResults.wrappedURL));
};
_url = (_url + ("/" + _parseResults.appName));
_url = (_url + _arg3);
xml = new XML();
xmlLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, xmlLoadEventHandler);
xmlLoader.addEventListener(IOErrorEvent.IO_ERROR, xmlLoadEventHandler);
xmlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, xmlLoadEventHandler);
xmlLoader.load(new URLRequest(_url));
return (false);
}
flvplayback_internal function xmlLoadEventHandler(_arg1:Event):void{
var proxy:String;
var e = _arg1;
try {
if (e.type != Event.COMPLETE){
_owner.helperDone(this, false);
} else {
xml = new XML(xmlLoader.data);
if ((((xml == null)) || ((xml.localName() == null)))){
throw (new VideoError(VideoError.INVALID_XML, (("URL: \"" + _url) + "\" No root node found; if url is for an flv it must have .flv extension and take no parameters")));
} else {
if (xml.localName() != "fpad"){
throw (new VideoError(VideoError.INVALID_XML, (("URL: \"" + _url) + "\" Root node not fpad")));
};
};
proxy = null;
if ((((((xml.proxy.length() > 0)) && (xml.proxy.hasSimpleContent()))) && ((xml.proxy.*[0].nodeKind() == "text")))){
proxy = xml.proxy.*[0].toString();
};
if (proxy == null){
throw (new VideoError(VideoError.INVALID_XML, (("URL: \"" + _url) + "\" fpad xml requires proxy tag.")));
};
rtmpURL = ((((_parseResults.protocol + "/") + proxy) + "/?") + _uriParam);
_owner.helperDone(this, true);
};
} catch(err:Error) {
_owner.helperDone(this, false);
throw (err);
};
}
}
}//package fl.video
Section 87
//Icon (fl.video.Icon)
package fl.video {
import flash.display.*;
public dynamic class Icon extends MovieClip {
}
}//package fl.video
Section 88
//INCManager (fl.video.INCManager)
package fl.video {
import flash.net.*;
public interface INCManager {
function set timeout(_arg1:uint):void;
function get streamLength():Number;
function get timeout():uint;
function connectToURL(_arg1:String):Boolean;
function get streamName():String;
function get bitrate():Number;
function get streamHeight():int;
function helperDone(_arg1:Object, _arg2:Boolean):void;
function getProperty(_arg1:String);
function get streamWidth():int;
function connectAgain():Boolean;
function reconnect():void;
function set videoPlayer(_arg1:VideoPlayer):void;
function setProperty(_arg1:String, _arg2):void;
function set bitrate(_arg1:Number):void;
function get netConnection():NetConnection;
function get videoPlayer():VideoPlayer;
function get isRTMP():Boolean;
function close():void;
}
}//package fl.video
Section 89
//IVPEvent (fl.video.IVPEvent)
package fl.video {
public interface IVPEvent {
function set vp(_arg1:uint):void;
function get vp():uint;
function get type():String;
}
}//package fl.video
Section 90
//LayoutEvent (fl.video.LayoutEvent)
package fl.video {
import flash.events.*;
import flash.geom.*;
public class LayoutEvent extends Event {
private var _oldBounds:Rectangle;
private var _oldRegistrationBounds:Rectangle;
public static const LAYOUT:String = "layout";
public function LayoutEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:Rectangle=null, _arg5:Rectangle=null){
super(_arg1, _arg2, _arg3);
_oldBounds = _arg4;
_oldRegistrationBounds = _arg5;
}
public function get oldRegistrationBounds():Rectangle{
return (_oldRegistrationBounds);
}
override public function clone():Event{
return (new LayoutEvent(type, bubbles, cancelable, Rectangle(oldBounds.clone()), Rectangle(oldRegistrationBounds.clone())));
}
public function set oldRegistrationBounds(_arg1:Rectangle):void{
_oldRegistrationBounds = _arg1;
}
public function set oldBounds(_arg1:Rectangle):void{
_oldBounds = _arg1;
}
public function get oldBounds():Rectangle{
return (_oldBounds);
}
}
}//package fl.video
Section 91
//MetadataEvent (fl.video.MetadataEvent)
package fl.video {
import flash.events.*;
public class MetadataEvent extends Event implements IVPEvent {
private var _info:Object;
private var _vp:uint;
public static const METADATA_RECEIVED:String = "metadataReceived";
public static const CUE_POINT:String = "cuePoint";
public function MetadataEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:Object=null, _arg5:uint=0){
super(_arg1, _arg2, _arg3);
_info = _arg4;
_vp = _arg5;
}
public function get vp():uint{
return (_vp);
}
public function set info(_arg1:Object):void{
_info = _arg1;
}
override public function clone():Event{
return (new MetadataEvent(type, bubbles, cancelable, info, vp));
}
public function get info():Object{
return (_info);
}
public function set vp(_arg1:uint):void{
_vp = _arg1;
}
}
}//package fl.video
Section 92
//NCManager (fl.video.NCManager)
package fl.video {
import flash.net.*;
import flash.events.*;
import flash.utils.*;
public class NCManager implements INCManager {
public const DEFAULT_TIMEOUT:uint = 60000;
flvplayback_internal var _serverName:String;
flvplayback_internal var _tryNCTimer:Timer;
flvplayback_internal var _autoSenseBW:Boolean;
flvplayback_internal var _fpadZone:Number;
flvplayback_internal var _appName:String;
flvplayback_internal var _ncConnected:Boolean;
flvplayback_internal var _fpadMgr:FPADManager;
flvplayback_internal var _bitrate:Number;
flvplayback_internal var _timeoutTimer:Timer;
flvplayback_internal var _wrappedURL:String;
flvplayback_internal var _payload:Number;
flvplayback_internal var _proxyType:String;
flvplayback_internal var _nc:NetConnection;
flvplayback_internal var _streamLength:Number;
flvplayback_internal var _connTypeCounter:uint;
flvplayback_internal var _streamWidth:int;
flvplayback_internal var _ncUri:String;
flvplayback_internal var _contentPath:String;
flvplayback_internal var _smilMgr:SMILManager;
flvplayback_internal var _streamHeight:int;
flvplayback_internal var _isRTMP:Boolean;
flvplayback_internal var _tryNC:Array;
flvplayback_internal var _owner:VideoPlayer;
flvplayback_internal var _streams:Array;
flvplayback_internal var _portNumber:String;
flvplayback_internal var _streamName:String;
flvplayback_internal var _objectEncoding:uint;
public var fallbackServerName:String;
flvplayback_internal var _protocol:String;
public static const SHORT_VERSION:String = "2.0";
flvplayback_internal static const RTMP_CONN:Array = [{protocol:"rtmp:/", port:"1935"}, {protocol:"rtmp:/", port:"443"}, {protocol:"rtmpt:/", port:"80"}, {protocol:"rtmps:/", port:"443"}];
public static const VERSION:String = "2.0.0.37";
public function NCManager(){
_fpadZone = NaN;
_objectEncoding = ObjectEncoding.AMF0;
_proxyType = "best";
_timeoutTimer = new Timer(DEFAULT_TIMEOUT);
_timeoutTimer.addEventListener(TimerEvent.TIMER, this._onFMSConnectTimeOut);
_tryNCTimer = new Timer(1500);
_tryNCTimer.addEventListener(TimerEvent.TIMER, this.nextConnect);
initNCInfo();
initOtherInfo();
_nc = null;
_ncConnected = false;
}
flvplayback_internal function initNCInfo():void{
_isRTMP = false;
_serverName = null;
_wrappedURL = null;
_portNumber = null;
_appName = null;
}
flvplayback_internal function cleanConns():void{
var _local1:uint;
_tryNCTimer.stop();
if (_tryNC != null){
_local1 = 0;
while (_local1 < _tryNC.length) {
if (((!((_tryNC[_local1] == null))) && (!((_tryNC[_local1] == undefined))))){
_tryNC[_local1].removeEventListener(NetStatusEvent.NET_STATUS, connectOnStatus);
if (_tryNC[_local1].client.pending){
_tryNC[_local1].addEventListener(NetStatusEvent.NET_STATUS, disconnectOnStatus);
} else {
_tryNC[_local1].close();
};
};
_tryNC[_local1] = null;
_local1++;
};
_tryNC = null;
};
}
public function get streamWidth():int{
return (_streamWidth);
}
public function connectToURL(_arg1:String):Boolean{
var parseResults:ParseResults;
var canReuse:Boolean;
var url = _arg1;
initOtherInfo();
_contentPath = url;
if ((((_contentPath == null)) || ((_contentPath == "")))){
throw (new VideoError(VideoError.INVALID_SOURCE));
};
parseResults = parseURL(_contentPath);
if ((((parseResults.streamName == null)) || ((parseResults.streamName == "")))){
throw (new VideoError(VideoError.INVALID_SOURCE, url));
};
if (parseResults.isRTMP){
canReuse = canReuseOldConnection(parseResults);
_isRTMP = true;
_protocol = parseResults.protocol;
_streamName = parseResults.streamName;
_serverName = parseResults.serverName;
_wrappedURL = parseResults.wrappedURL;
_portNumber = parseResults.portNumber;
_appName = parseResults.appName;
if ((((((((_appName == null)) || ((_appName == "")))) || ((_streamName == null)))) || ((_streamName == "")))){
throw (new VideoError(VideoError.INVALID_SOURCE, url));
};
_autoSenseBW = (_streamName.indexOf(",") >= 0);
return (((canReuse) || (connectRTMP())));
} else {
if ((((parseResults.streamName.indexOf("?") < 0)) && ((parseResults.streamName.slice(-4).toLowerCase() == ".flv")))){
canReuse = canReuseOldConnection(parseResults);
_isRTMP = false;
_streamName = parseResults.streamName;
return (((canReuse) || (connectHTTP())));
};
if (parseResults.streamName.indexOf("/fms/fpad") >= 0){
try {
return (connectFPAD(parseResults.streamName));
} catch(err:Error) {
};
};
};
new this.SMILManager(!NULL!)._smilMgr = !NULL!;
return (_smilMgr.connectXML(parseResults.streamName));
}
public function get streamName():String{
return (_streamName);
}
flvplayback_internal function reconnectOnStatus(_arg1:NetStatusEvent):void{
if ((((_arg1.info.code == "NetConnection.Connect.Failed")) || ((_arg1.info.code == "NetConnection.Connect.Rejected")))){
_nc = null;
_ncConnected = false;
_owner.ncReconnected();
};
}
public function get videoPlayer():VideoPlayer{
return (_owner);
}
flvplayback_internal function getStreamLengthResult(_arg1:Number):void{
trace((("calling getStreamLengthResult(" + _arg1) + ")"));
if (_arg1 > 0){
_streamLength = _arg1;
};
_owner.ncConnected();
}
flvplayback_internal function canReuseOldConnection(_arg1:ParseResults):Boolean{
if ((((_nc == null)) || (!(_ncConnected)))){
return (false);
};
if (!_arg1.isRTMP){
if (!_isRTMP){
return (true);
};
_owner.close();
_nc = null;
_ncConnected = false;
initNCInfo();
return (false);
};
if (_isRTMP){
if ((((((((((_arg1.serverName == _serverName)) && ((_arg1.appName == _appName)))) && ((_arg1.protocol == _protocol)))) && ((_arg1.portNumber == _portNumber)))) && ((_arg1.wrappedURL == _wrappedURL)))){
return (true);
};
_owner.close();
_nc = null;
_ncConnected = false;
};
initNCInfo();
return (false);
}
public function getProperty(_arg1:String){
switch (_arg1){
case "fallbackServerName":
return (fallbackServerName);
case "fpadZone":
return (_fpadZone);
case "objectEncoding":
return (_objectEncoding);
case "proxyType":
return (_proxyType);
default:
throw (new VideoError(VideoError.UNSUPPORTED_PROPERTY, _arg1));
};
}
flvplayback_internal function connectRTMP():Boolean{
var _local1:uint;
_timeoutTimer.stop();
_timeoutTimer.start();
_tryNC = new Array();
_local1 = 0;
while (_local1 < RTMP_CONN.length) {
_tryNC[_local1] = new NetConnection();
_tryNC[_local1].objectEncoding = _objectEncoding;
_tryNC[_local1].proxyType = _proxyType;
if (!isNaN(_fpadZone)){
_tryNC[_local1].fpadZone = _fpadZone;
};
_tryNC[_local1].client = new ConnectClient(this, _tryNC[_local1], _local1);
_tryNC[_local1].addEventListener(NetStatusEvent.NET_STATUS, connectOnStatus);
_local1++;
};
nextConnect();
return (false);
}
public function reconnect():void{
if (!_isRTMP){
throw (new Error("Cannot call reconnect on an http connection"));
};
_nc.client = new ReconnectClient(this);
_nc.addEventListener(NetStatusEvent.NET_STATUS, reconnectOnStatus);
_nc.connect(_ncUri, false);
}
public function helperDone(_arg1:Object, _arg2:Boolean):void{
var _local3:ParseResults;
var _local4:String;
var _local5:Boolean;
var _local6:uint;
var _local7:Number;
if (!_arg2){
_nc = null;
_ncConnected = false;
_owner.ncConnected();
_smilMgr = null;
_fpadMgr = null;
return;
};
_local5 = false;
if (_arg1 == _fpadMgr){
_local4 = _fpadMgr.rtmpURL;
_fpadMgr = null;
_local3 = parseURL(_local4);
_isRTMP = _local3.isRTMP;
_protocol = _local3.protocol;
_serverName = _local3.serverName;
_portNumber = _local3.portNumber;
_wrappedURL = _local3.wrappedURL;
_appName = _local3.appName;
_streamName = _local3.streamName;
_local7 = _fpadZone;
_fpadZone = NaN;
connectRTMP();
_fpadZone = _local7;
return;
};
if (_arg1 != _smilMgr){
return;
};
_streamWidth = _smilMgr.width;
_streamHeight = _smilMgr.height;
_local4 = _smilMgr.baseURLAttr[0];
if (((!((_local4 == null))) && (!((_local4 == ""))))){
if (_local4.charAt((_local4.length - 1)) != "/"){
_local4 = (_local4 + "/");
};
_local3 = parseURL(_local4);
_isRTMP = _local3.isRTMP;
_local5 = true;
_streamName = _local3.streamName;
if (_isRTMP){
_protocol = _local3.protocol;
_serverName = _local3.serverName;
_portNumber = _local3.portNumber;
_wrappedURL = _local3.wrappedURL;
_appName = _local3.appName;
if ((((_appName == null)) || ((_appName == "")))){
_smilMgr = null;
throw (new VideoError(VideoError.INVALID_XML, ("Base RTMP URL must include application name: " + _local4)));
};
if (_smilMgr.baseURLAttr.length > 1){
_local3 = parseURL(_smilMgr.baseURLAttr[1]);
if (_local3.serverName != null){
fallbackServerName = _local3.serverName;
};
};
};
};
_streams = _smilMgr.videoTags;
_smilMgr = null;
_local6 = 0;
while (_local6 < _streams.length) {
_local4 = _streams[_local6].src;
_local3 = parseURL(_local4);
if (!_local5){
_isRTMP = _local3.isRTMP;
_local5 = true;
if (_isRTMP){
_protocol = _local3.protocol;
if (_streams.length > 1){
throw (new VideoError(VideoError.INVALID_XML, "Cannot switch between multiple absolute RTMP URLs, must use meta tag base attribute."));
};
_serverName = _local3.serverName;
_portNumber = _local3.portNumber;
_wrappedURL = _local3.wrappedURL;
_appName = _local3.appName;
if ((((_appName == null)) || ((_appName == "")))){
throw (new VideoError(VideoError.INVALID_XML, ("Base RTMP URL must include application name: " + _local4)));
};
} else {
if ((((_local3.streamName.indexOf("/fms/fpad") >= 0)) && ((_streams.length > 1)))){
throw (new VideoError(VideoError.INVALID_XML, "Cannot switch between multiple absolute fpad URLs, must use meta tag base attribute."));
};
};
} else {
if (((((((!((_streamName == null))) && (!((_streamName == ""))))) && (!(_local3.isRelative)))) && ((_streams.length > 1)))){
throw (new VideoError(VideoError.INVALID_XML, "When using meta tag base attribute, cannot use absolute URLs for video or ref tag src attributes."));
};
};
_streams[_local6].parseResults = _local3;
_local6++;
};
_autoSenseBW = (_streams.length > 1);
if (!_autoSenseBW){
if (_streamName != null){
_streamName = (_streamName + _streams[0].parseResults.streamName);
} else {
_streamName = _streams[0].parseResults.streamName;
};
if (((_isRTMP) && ((_streamName.substr(-4).toLowerCase() == ".flv")))){
_streamName = _streamName.substr(0, (_streamName.length - 4));
};
_streamLength = _streams[0].dur;
};
if (_isRTMP){
connectRTMP();
} else {
if (((!((_streamName == null))) && ((_streamName.indexOf("/fms/fpad") >= 0)))){
connectFPAD(_streamName);
} else {
if (_autoSenseBW){
bitrateMatch();
};
connectHTTP();
_owner.ncConnected();
};
};
}
public function get netConnection():NetConnection{
return (_nc);
}
public function get bitrate():Number{
return (_bitrate);
}
public function setProperty(_arg1:String, _arg2):void{
switch (_arg1){
case "fallbackServerName":
fallbackServerName = String(_arg2);
break;
case "fpadZone":
_fpadZone = Number(_arg2);
break;
case "objectEncoding":
_objectEncoding = uint(_arg2);
break;
case "proxyType":
_proxyType = String(_arg2);
break;
default:
throw (new VideoError(VideoError.UNSUPPORTED_PROPERTY, _arg1));
};
}
public function get timeout():uint{
return (_timeoutTimer.delay);
}
public function set videoPlayer(_arg1:VideoPlayer):void{
_owner = _arg1;
}
flvplayback_internal function bitrateMatch():void{
var _local1:Number;
var _local2:uint;
var _local3:uint;
_local1 = _bitrate;
if (isNaN(_local1)){
_local1 = 0;
};
_local2 = _streams.length;
_local3 = 0;
while (_local3 < _streams.length) {
if (((isNaN(_streams[_local3].bitrate)) || ((_local1 >= _streams[_local3].bitrate)))){
_local2 = _local3;
break;
};
_local3++;
};
if (_local2 == _streams.length){
throw (new VideoError(VideoError.NO_BITRATE_MATCH));
};
if (_streamName != null){
_streamName = (_streamName + _streams[_local2].src);
} else {
_streamName = _streams[_local2].src;
};
if (((_isRTMP) && ((_streamName.substr(-4).toLowerCase() == ".flv")))){
_streamName = _streamName.substr(0, (_streamName.length - 4));
};
_streamLength = _streams[_local2].dur;
}
flvplayback_internal function disconnectOnStatus(_arg1:NetStatusEvent):void{
if (_arg1.info.code == "NetConnection.Connect.Success"){
_arg1.target.removeEventListener(NetStatusEvent.NET_STATUS, disconnectOnStatus);
_arg1.target.close();
};
}
flvplayback_internal function nextConnect(_arg1:TimerEvent=null):void{
var _local2:String;
var _local3:String;
var _local4:String;
var _local5:uint;
_tryNCTimer.stop();
if (_connTypeCounter == 0){
_local2 = _protocol;
if (_portNumber != null){
_local3 = _portNumber;
} else {
_local5 = 0;
while (_local5 < RTMP_CONN.length) {
if (_local2 == RTMP_CONN[_local5].protocol){
_local3 = RTMP_CONN[_local5].port;
break;
};
_local5++;
};
};
} else {
_local2 = RTMP_CONN[_connTypeCounter].protocol;
_local3 = RTMP_CONN[_connTypeCounter].port;
};
_local4 = (((_local2 + ((_serverName)==null) ? "" : (((("/" + _serverName) + ":") + _local3) + "/")) + ((_wrappedURL)==null) ? "" : (_wrappedURL + "/")) + _appName);
_tryNC[_connTypeCounter].client.pending = true;
_tryNC[_connTypeCounter].connect(_local4, _autoSenseBW);
if (_connTypeCounter < (RTMP_CONN.length - 1)){
_connTypeCounter++;
_tryNCTimer.start();
};
}
flvplayback_internal function connectFPAD(_arg1:String):Boolean{
var _local2:Object;
var _local3:String;
var _local4:String;
var _local5:String;
var _local6:ParseResults;
_local2 = /^(.+)(\?|\&)(uri=)([^&]+)(\&.*)?$/.exec(_arg1);
if (_local2 == null){
throw (new VideoError(VideoError.INVALID_SOURCE, ("fpad url must include uri parameter: " + _arg1)));
};
_local3 = (_local2[1] + _local2[2]);
_local4 = _local2[4];
_local5 = ((_local2[5])==undefined) ? "" : _local2[5];
_local6 = parseURL(_local4);
if (!_local6.isRTMP){
throw (new VideoError(VideoError.INVALID_SOURCE, ("fpad url uri parameter must be rtmp url: " + _arg1)));
};
_fpadMgr = new FPADManager(this);
return (_fpadMgr.connectXML(_local3, _local4, _local5, _local6));
}
flvplayback_internal function connectHTTP():Boolean{
_nc = new NetConnection();
_nc.connect(null);
_ncConnected = true;
return (true);
}
public function get isRTMP():Boolean{
return (_isRTMP);
}
public function get streamLength():Number{
return (_streamLength);
}
public function connectAgain():Boolean{
var _local1:int;
var _local2:String;
_local1 = _appName.indexOf("/");
if (_local1 < 0){
_local1 = _streamName.indexOf("/");
if (_local1 >= 0){
_appName = (_appName + "/");
_appName = (_appName + _streamName.slice(0, _local1));
_streamName = _streamName.slice((_local1 + 1));
};
return (false);
};
_local2 = _appName.slice((_local1 + 1));
_local2 = (_local2 + "/");
_local2 = (_local2 + _streamName);
_streamName = _local2;
_appName = _appName.slice(0, _local1);
close();
_payload = 0;
_connTypeCounter = 0;
cleanConns();
connectRTMP();
return (true);
}
flvplayback_internal function parseURL(_arg1:String):ParseResults{
var _local2:ParseResults;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:String;
var _local8:ParseResults;
_local2 = new ParseResults();
_local3 = 0;
_local4 = _arg1.indexOf(":/", _local3);
if (_local4 >= 0){
_local4 = (_local4 + 2);
_local2.protocol = _arg1.slice(_local3, _local4).toLowerCase();
_local2.isRelative = false;
} else {
_local2.isRelative = true;
};
if (((!((_local2.protocol == null))) && ((((((_local2.protocol == "rtmp:/")) || ((_local2.protocol == "rtmpt:/")))) || ((_local2.protocol == "rtmps:/")))))){
_local2.isRTMP = true;
_local3 = _local4;
if (_arg1.charAt(_local3) == "/"){
_local3++;
_local5 = _arg1.indexOf(":", _local3);
_local6 = _arg1.indexOf("/", _local3);
if (_local6 < 0){
if (_local5 < 0){
_local2.serverName = _arg1.slice(_local3);
} else {
_local4 = _local5;
_local2.portNumber = _arg1.slice(_local3, _local4);
_local3 = (_local4 + 1);
_local2.serverName = _arg1.slice(_local3);
};
return (_local2);
};
if ((((_local5 >= 0)) && ((_local5 < _local6)))){
_local4 = _local5;
_local2.serverName = _arg1.slice(_local3, _local4);
_local3 = (_local4 + 1);
_local4 = _local6;
_local2.portNumber = _arg1.slice(_local3, _local4);
} else {
_local4 = _local6;
_local2.serverName = _arg1.slice(_local3, _local4);
};
_local3 = (_local4 + 1);
};
if (_arg1.charAt(_local3) == "?"){
_local7 = _arg1.slice((_local3 + 1));
_local8 = parseURL(_local7);
if ((((_local8.protocol == null)) || (!(_local8.isRTMP)))){
throw (new VideoError(VideoError.INVALID_SOURCE, _arg1));
};
_local2.wrappedURL = "?";
_local2.wrappedURL = (_local2.wrappedURL + _local8.protocol);
if (_local8.serverName != null){
_local2.wrappedURL = (_local2.wrappedURL + "/");
_local2.wrappedURL = (_local2.wrappedURL + _local8.serverName);
};
if (_local8.portNumber != null){
_local2.wrappedURL = (_local2.wrappedURL + (":" + _local8.portNumber));
};
if (_local8.wrappedURL != null){
_local2.wrappedURL = (_local2.wrappedURL + "/");
_local2.wrappedURL = (_local2.wrappedURL + _local8.wrappedURL);
};
_local2.appName = _local8.appName;
_local2.streamName = _local8.streamName;
return (_local2);
};
_local4 = _arg1.indexOf("/", _local3);
if (_local4 < 0){
_local2.appName = _arg1.slice(_local3);
return (_local2);
};
_local2.appName = _arg1.slice(_local3, _local4);
_local3 = (_local4 + 1);
_local4 = _arg1.indexOf("/", _local3);
if (_local4 < 0){
_local2.streamName = _arg1.slice(_local3);
if (_local2.streamName.slice(-4).toLowerCase() == ".flv"){
_local2.streamName = _local2.streamName.slice(0, -4);
};
return (_local2);
};
_local2.appName = (_local2.appName + "/");
_local2.appName = (_local2.appName + _arg1.slice(_local3, _local4));
_local3 = (_local4 + 1);
_local2.streamName = _arg1.slice(_local3);
if (_local2.streamName.slice(-4).toLowerCase() == ".flv"){
_local2.streamName = _local2.streamName.slice(0, -4);
};
} else {
_local2.isRTMP = false;
_local2.streamName = _arg1;
};
return (_local2);
}
flvplayback_internal function initOtherInfo():void{
_contentPath = null;
_streamName = null;
_streamWidth = -1;
_streamHeight = -1;
_streamLength = NaN;
_streams = null;
_autoSenseBW = false;
_payload = 0;
_connTypeCounter = 0;
cleanConns();
}
public function set timeout(_arg1:uint):void{
_timeoutTimer.delay = _arg1;
}
flvplayback_internal function _onFMSConnectTimeOut(_arg1:TimerEvent=null):void{
cleanConns();
_nc = null;
_ncConnected = false;
if (!connectAgain()){
_owner.ncConnected();
};
}
public function get streamHeight():int{
return (_streamHeight);
}
flvplayback_internal function connectOnStatus(_arg1:NetStatusEvent):void{
_arg1.target.client.pending = false;
if (_arg1.info.code == "NetConnection.Connect.Success"){
_nc = _tryNC[_arg1.target.client.connIndex];
cleanConns();
} else {
if ((((((_arg1.info.code == "NetConnection.Connect.Failed")) || ((_arg1.info.code == "NetConnection.Connect.Rejected")))) && ((_arg1.target.client.connIndex == (RTMP_CONN.length - 1))))){
if (!connectAgain()){
tryFallBack();
};
};
};
}
flvplayback_internal function onReconnected():void{
_ncConnected = true;
_owner.ncReconnected();
}
flvplayback_internal function tryFallBack():void{
if ((((_serverName == fallbackServerName)) || ((fallbackServerName == null)))){
_nc = null;
_ncConnected = false;
_owner.ncConnected();
} else {
_connTypeCounter = 0;
cleanConns();
_serverName = fallbackServerName;
connectRTMP();
};
}
public function set bitrate(_arg1:Number):void{
if (!_isRTMP){
_bitrate = _arg1;
};
}
flvplayback_internal function onConnected(_arg1:NetConnection, _arg2:Number):void{
var _local3:Array;
var _local4:uint;
var _local5:String;
_timeoutTimer.stop();
_arg1.removeEventListener(NetStatusEvent.NET_STATUS, connectOnStatus);
_nc = _arg1;
_ncUri = _nc.uri;
_ncConnected = true;
if (_autoSenseBW){
_bitrate = (_arg2 * 0x0400);
if (_streams != null){
bitrateMatch();
} else {
_local3 = _streamName.split(",");
_local4 = 0;
while (_local4 < _local3.length) {
_local5 = stripFrontAndBackWhiteSpace(_local3[_local4]);
if ((_local4 + 1) < _local3.length){
if (_arg2 <= Number(_local3[(_local4 + 1)])){
_streamName = _local5;
break;
};
} else {
_streamName = _local5;
break;
};
_local4 = (_local4 + 2);
};
if (_streamName.slice(-4).toLowerCase() == ".flv"){
_streamName = _streamName.slice(0, -4);
};
};
};
trace(("_streamLength = " + _streamLength));
if (((!(_owner.isLive)) && (isNaN(_streamLength)))){
trace("calling getStreamLength");
_nc.call("getStreamLength", new Responder(getStreamLengthResult), _streamName);
} else {
_owner.ncConnected();
};
}
public function close():void{
if (_nc){
_nc.close();
_ncConnected = false;
};
}
flvplayback_internal static function stripFrontAndBackWhiteSpace(_arg1:String):String{
var _local2:uint;
var _local3:uint;
var _local4:int;
var _local5:int;
_local3 = _arg1.length;
_local4 = 0;
_local5 = _local3;
_local2 = 0;
for (;_local2 < _local3;_local2++) {
switch (_arg1.charCodeAt(_local2)){
case 9:
case 10:
case 13:
case 32:
continue;
};
_local4 = _local2;
break;
};
_local2 = _local3;
for (;_local2 >= 0;_local2--) {
switch (_arg1.charCodeAt(_local2)){
case 9:
case 10:
case 13:
case 32:
continue;
};
_local5 = (_local2 + 1);
break;
};
if (_local5 <= _local4){
return ("");
};
return (_arg1.slice(_local4, _local5));
}
}
}//package fl.video
Section 93
//ParseResults (fl.video.ParseResults)
package fl.video {
public class ParseResults {
public var portNumber:String;
public var streamName:String;
public var serverName:String;
public var isRTMP:Boolean;
public var appName:String;
public var isRelative:Boolean;
public var protocol:String;
public var wrappedURL:String;
}
}//package fl.video
Section 94
//QueuedCommand (fl.video.QueuedCommand)
package fl.video {
public class QueuedCommand {
public var type:uint;
public var time:Number;
public var url:String;
public var isLive:Boolean;
public static const LOAD:uint = 1;
public static const STOP:uint = 3;
public static const PLAY_WHEN_ENOUGH:uint = 5;
public static const PLAY:uint = 0;
public static const PAUSE:uint = 2;
public static const SEEK:uint = 4;
public function QueuedCommand(_arg1:uint, _arg2:String, _arg3:Boolean, _arg4:Number){
this.type = _arg1;
this.url = _arg2;
this.isLive = _arg3;
this.time = _arg4;
}
}
}//package fl.video
Section 95
//ReconnectClient (fl.video.ReconnectClient)
package fl.video {
public class ReconnectClient {
public var owner:NCManager;
public function ReconnectClient(_arg1:NCManager){
this.owner = _arg1;
}
public function close():void{
}
public function onBWDone(... _args):void{
owner.onReconnected();
}
}
}//package fl.video
Section 96
//SkinErrorEvent (fl.video.SkinErrorEvent)
package fl.video {
import flash.events.*;
public class SkinErrorEvent extends ErrorEvent {
public static const SKIN_ERROR:String = "skinError";
public function SkinErrorEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:String=""){
super(_arg1, _arg2, _arg3, _arg4);
}
override public function clone():Event{
return (new SkinErrorEvent(type, bubbles, cancelable, text));
}
}
}//package fl.video
Section 97
//SMILManager (fl.video.SMILManager)
package fl.video {
import flash.net.*;
import flash.events.*;
public class SMILManager {
flvplayback_internal var width:int;
flvplayback_internal var xmlLoader:URLLoader;
flvplayback_internal var xml:XML;
flvplayback_internal var height:int;
private var _url:String;
flvplayback_internal var videoTags:Array;
flvplayback_internal var baseURLAttr:Array;
private var _owner:INCManager;
public static const VERSION:String = "2.0.0.37";
public static const SHORT_VERSION:String = "2.0";
public function SMILManager(_arg1:INCManager){
_owner = _arg1;
width = -1;
height = -1;
}
flvplayback_internal function parseVideo(_arg1:XML):Object{
var _local2:Object;
_local2 = new Object();
if (_arg1.@src.length() > 0){
_local2.src = _arg1.@src.toString();
};
if (_arg1.@["system-bitrate"].length() > 0){
_local2.bitrate = int(_arg1.@["system-bitrate"].toString());
};
if (_arg1.@dur.length() > 0){
_local2.dur = parseTime(_arg1.@dur.toString());
};
return (_local2);
}
flvplayback_internal function connectXML(_arg1:String):Boolean{
_url = fixURL(_arg1);
xmlLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, xmlLoadEventHandler);
xmlLoader.addEventListener(IOErrorEvent.IO_ERROR, xmlLoadEventHandler);
xmlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, xmlLoadEventHandler);
xmlLoader.load(new URLRequest(_url));
return (false);
}
flvplayback_internal function parseSwitch(_arg1:XML):void{
var _local2:String;
var _local3:XML;
for (_local2 in _arg1.*) {
_local3 = _arg1.*[_local2];
if (_local3.nodeKind() != "element"){
} else {
switch (_local3.localName()){
case "video":
case "ref":
videoTags.push(parseVideo(_local3));
break;
default:
break;
};
};
};
}
flvplayback_internal function fixURL(_arg1:String):String{
var _local2:String;
if (/^(http:|https:)/i.test(_arg1)){
_local2 = ((_arg1.indexOf("?"))>=0) ? "&" : "?";
return ((((_arg1 + _local2) + "FLVPlaybackVersion=") + SHORT_VERSION));
};
return (_arg1);
}
flvplayback_internal function xmlLoadEventHandler(_arg1:Event):void{
var e = _arg1;
try {
if (e.type != Event.COMPLETE){
_owner.helperDone(this, false);
} else {
baseURLAttr = new Array();
videoTags = new Array();
xml = new XML(xmlLoader.data);
if ((((xml == null)) || ((xml.localName() == null)))){
throw (new VideoError(VideoError.INVALID_XML, (("URL: \"" + _url) + "\" No root node found; if url is for an flv it must have .flv extension and take no parameters")));
} else {
if (xml.localName() != "smil"){
throw (new VideoError(VideoError.INVALID_XML, (("URL: \"" + _url) + "\" Root node not smil")));
};
};
checkForIllegalNodes(xml, "element", ["head", "body"]);
if (xml.head.length() > 0){
parseHead(xml.head[0]);
};
if (xml.body.length() < 1){
throw (new VideoError(VideoError.INVALID_XML, (("URL: \"" + _url) + "\" Tag body is required.")));
} else {
parseBody(xml.body[0]);
};
_owner.helperDone(this, true);
};
} catch(err:Error) {
_owner.helperDone(this, false);
throw (err);
} finally {
xmlLoader.removeEventListener(Event.COMPLETE, xmlLoadEventHandler);
xmlLoader.removeEventListener(IOErrorEvent.IO_ERROR, xmlLoadEventHandler);
xmlLoader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, xmlLoadEventHandler);
xmlLoader = null;
};
}
flvplayback_internal function checkForIllegalNodes(_arg1:XML, _arg2:String, _arg3:Array):void{
var _local4:String;
var _local5:Boolean;
var _local6:XML;
var _local7:String;
var _local8:String;
for (_local4 in _arg1.*) {
_local5 = false;
_local6 = _arg1.*[_local4];
if (_local6.nodeKind() != _arg2){
} else {
_local7 = _local6.localName();
for (_local8 in _arg3) {
if (_arg3[_local8] == _local7){
_local5 = true;
break;
};
};
if (!_local5){
throw (new VideoError(VideoError.INVALID_XML, (((((((("URL: \"" + _url) + "\" ") + _arg2) + " ") + _local7) + " not supported in ") + _arg1.localName()) + " tag.")));
};
};
};
}
flvplayback_internal function parseHead(_arg1:XML):void{
checkForIllegalNodes(_arg1, "element", ["meta", "layout"]);
if (_arg1.meta.length() > 0){
checkForIllegalNodes(_arg1.meta[0], "element", []);
checkForIllegalNodes(_arg1.meta[0], "attribute", ["base"]);
if (_arg1.meta.@base.length() > 0){
baseURLAttr.push(_arg1.meta.@base.toString());
};
};
if (_arg1.layout.length() > 0){
parseLayout(_arg1.layout[0]);
};
}
flvplayback_internal function parseBody(_arg1:XML):void{
var _local2:XML;
var _local3:String;
var _local4:Object;
if (((!((_arg1.*.length() == 1))) || (!((_arg1.*[0].nodeKind() == "element"))))){
throw (new VideoError(VideoError.INVALID_XML, (((("URL: \"" + _url) + "\" Tag ") + _arg1.localName()) + " is required to contain exactly one tag.")));
};
_local2 = _arg1.*[0];
_local3 = _local2.localName();
switch (_local3){
case "switch":
parseSwitch(_local2);
break;
case "video":
case "ref":
_local4 = parseVideo(_local2);
videoTags.push(_local4);
break;
default:
throw (new VideoError(VideoError.INVALID_XML, (((((("URL: \"" + _url) + "\" Tag ") + _local3) + " not supported in ") + _arg1.localName()) + " tag.")));
};
if (videoTags.length < 1){
throw (new VideoError(VideoError.INVALID_XML, (("URL: \"" + _url) + "\" At least one video of ref tag is required.")));
};
}
flvplayback_internal function parseTime(_arg1:String):Number{
var _local2:Object;
var _local3:Number;
var _local4:Number;
_local2 = /^((\d+):)?(\d+):((\d+)(.\d+)?)$/.exec(_arg1);
if (_local2 == null){
_local3 = Number(_arg1);
if (((isNaN(_local3)) || ((_local3 < 0)))){
throw (new VideoError(VideoError.INVALID_XML, ("Invalid dur value: " + _arg1)));
};
return (_local3);
//unresolved jump
};
_local4 = 0;
_local4 = (_local4 + ((uint(_local2[2]) * 60) * 60));
_local4 = (_local4 + (uint(_local2[3]) * 60));
_local4 = (_local4 + Number(_local2[4]));
return (_local4);
}
flvplayback_internal function parseLayout(_arg1:XML):void{
var _local2:XML;
var _local3:Number;
var _local4:Number;
checkForIllegalNodes(_arg1, "element", ["root-layout"]);
if (_arg1["root-layout"].length() > 1){
throw (new VideoError(VideoError.INVALID_XML, (("URL: \"" + _url) + "\" Only one base attribute supported in meta tag.")));
};
if (_arg1["root-layout"].length() > 0){
_local2 = _arg1["root-layout"][0];
if (_local2.@width.length() > 0){
_local3 = Number(_local2.@width[0]);
};
if (_local2.@height.length() > 0){
_local4 = Number(_local2.@height[0]);
};
if (((((((isNaN(_local3)) || ((_local3 < 0)))) || (isNaN(_local4)))) || ((_local4 < 0)))){
throw (new VideoError(VideoError.INVALID_XML, (((("URL: \"" + _url) + "\" Tag ") + _arg1.localName()) + " requires attributes width and height. Width and height must be numbers greater than or equal to 0.")));
};
width = Math.round(_local3);
height = Math.round(_local4);
};
}
}
}//package fl.video
Section 98
//SoundEvent (fl.video.SoundEvent)
package fl.video {
import flash.events.*;
import flash.media.*;
public class SoundEvent extends Event {
private var _soundTransform:SoundTransform;
public static const SOUND_UPDATE:String = "soundUpdate";
public function SoundEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:SoundTransform=null){
super(_arg1, _arg2, _arg3);
_soundTransform = _arg4;
}
public function get soundTransform():SoundTransform{
return (_soundTransform);
}
override public function clone():Event{
return (new SoundEvent(type, bubbles, cancelable, soundTransform));
}
}
}//package fl.video
Section 99
//UIManager (fl.video.UIManager)
package fl.video {
import flash.net.*;
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
public class UIManager {
flvplayback_internal var _bufferingDelayTimer:Timer;
public var ctrlDataDict:Dictionary;
flvplayback_internal var _skinAutoHide:Boolean;
flvplayback_internal var placeholderLeft:Number;
flvplayback_internal var _playAfterScrub:Boolean;
public var customClips:Array;
flvplayback_internal var _skinFadeStartTime:int;
flvplayback_internal var delayedControls:Array;
flvplayback_internal var _lastScrubPos:Number;
flvplayback_internal var _skinAutoHideLastMotionTime:int;
flvplayback_internal var _volumeBarTimer:Timer;
flvplayback_internal var borderScale9Rects:Array;
flvplayback_internal var _volumeBarScrubTolerance:Number;
flvplayback_internal var _skin:String;
flvplayback_internal var videoRight:Number;
flvplayback_internal var _bufferingBarHides:Boolean;
flvplayback_internal var placeholderRight:Number;
flvplayback_internal var cachedSoundLevel:Number;
flvplayback_internal var videoBottom:Number;
flvplayback_internal var border_mc:DisplayObject;
flvplayback_internal var _skinFadingTimer:Timer;
flvplayback_internal var borderAlpha:Number;
flvplayback_internal var borderColorTransform:ColorTransform;
flvplayback_internal var borderColor:uint;
flvplayback_internal var __visible:Boolean;
flvplayback_internal var cacheFLVPlaybackLocation:Rectangle;
flvplayback_internal var cacheFLVPlaybackIndex:int;
flvplayback_internal var _skinReady:Boolean;
flvplayback_internal var controls:Array;
flvplayback_internal var _skinAutoHideMouseX:Number;
flvplayback_internal var _skinAutoHideMouseY:Number;
flvplayback_internal var layout_mc:Sprite;
flvplayback_internal var cacheSkinAutoHide:Boolean;
flvplayback_internal var cacheStageScaleMode:String;
flvplayback_internal var videoTop:Number;
flvplayback_internal var _skinFadingMaxTime:int;
flvplayback_internal var placeholderTop:Number;
flvplayback_internal var _lastVolumePos:Number;
flvplayback_internal var mouseCaptureCtrl:int;
flvplayback_internal var _seekBarScrubTolerance:Number;
flvplayback_internal var borderPrevRect:Rectangle;
flvplayback_internal var skinTemplate:Sprite;
flvplayback_internal var _progressPercent:Number;
flvplayback_internal var videoLeft:Number;
flvplayback_internal var _isMuted:Boolean;
flvplayback_internal var _skinAutoHideTimer:Timer;
flvplayback_internal var _fullScreenBgColor:uint;
flvplayback_internal var _vc:FLVPlayback;
flvplayback_internal var _bufferingOn:Boolean;
flvplayback_internal var _seekBarTimer:Timer;
flvplayback_internal var _controlsEnabled:Boolean;
flvplayback_internal var _fullScreen:Boolean;
flvplayback_internal var placeholderBottom:Number;
flvplayback_internal var _fullScreenTakeOver:Boolean;
flvplayback_internal var skin_mc:Sprite;
flvplayback_internal var skinLoadDelayCount:uint;
flvplayback_internal var _skinFadingIn:Boolean;
flvplayback_internal var _skinAutoHideMotionTimeout:int;
flvplayback_internal var borderCopy:Sprite;
flvplayback_internal var cacheStageAlign:String;
flvplayback_internal var cacheFLVPlaybackParent:DisplayObjectContainer;
flvplayback_internal var skinLoader:Loader;
public static const VOLUME_BAR_HIT:int = 12;
public static const MUTE_OFF_BUTTON:int = 10;
public static const BACK_BUTTON:int = 5;
public static const FORWARD_BUTTON:int = 6;
public static const STOP_BUTTON:int = 2;
public static const NUM_BUTTONS:int = 13;
public static const NORMAL_STATE:uint = 0;
public static const SEEK_BAR_HANDLE:int = 3;
public static const PLAY_BUTTON:int = 1;
public static const MUTE_BUTTON:int = 15;
public static const DOWN_STATE:uint = 2;
public static const SEEK_BAR_SCRUB_TOLERANCE_DEFAULT:Number = 5;
public static const FULL_SCREEN_OFF_BUTTON:int = 8;
flvplayback_internal static const SKIN_AUTO_HIDE_MOTION_TIMEOUT_DEFAULT:Number = 3000;
public static const SEEK_BAR:int = 17;
public static const VOLUME_BAR_SCRUB_TOLERANCE_DEFAULT:Number = 0;
public static const FULL_SCREEN_ON_BUTTON:int = 7;
public static const FULL_SCREEN_BUTTON:int = 14;
public static const BUFFERING_BAR:int = 16;
public static const VERSION:String = "2.0.0.37";
public static const VOLUME_BAR_HANDLE:int = 11;
public static const PAUSE_BUTTON:int = 0;
flvplayback_internal static const SKIN_AUTO_HIDE_INTERVAL:Number = 200;
public static const OVER_STATE:uint = 1;
flvplayback_internal static const SKIN_FADING_INTERVAL:Number = 100;
public static const VOLUME_BAR:int = 18;
public static const SHORT_VERSION:String = "2.0";
public static const SEEK_BAR_INTERVAL_DEFAULT:Number = 250;
flvplayback_internal static const SKIN_FADING_MAX_TIME_DEFAULT:Number = 500;
public static const SEEK_BAR_HIT:int = 4;
public static const PLAY_PAUSE_BUTTON:int = 13;
public static const BUFFERING_DELAY_INTERVAL_DEFAULT:Number = 1000;
public static const MUTE_ON_BUTTON:int = 9;
public static const NUM_CONTROLS:int = 19;
public static const VOLUME_BAR_INTERVAL_DEFAULT:Number = 250;
flvplayback_internal static var layoutNameToIndexMappings:Object = null;
flvplayback_internal static var buttonSkinLinkageIDs:Array = ["upLinkageID", "overLinkageID", "downLinkageID"];
flvplayback_internal static var layoutNameArray:Array = ["pause_mc", "play_mc", "stop_mc", null, null, "back_mc", "forward_mc", null, null, null, null, null, null, "playpause_mc", "fullScreenToggle_mc", "volumeMute_mc", "bufferingBar_mc", "seekBar_mc", "volumeBar_mc", "seekBarHandle_mc", "seekBarHit_mc", "seekBarProgress_mc", "seekBarFullness_mc", "volumeBarHandle_mc", "volumeBarHit_mc", "volumeBarProgress_mc", "volumeBarFullness_mc", "progressFill_mc"];
flvplayback_internal static var skinClassPrefixes:Array = ["pauseButton", "playButton", "stopButton", null, null, "backButton", "forwardButton", "fullScreenButtonOn", "fullScreenButtonOff", "muteButtonOn", "muteButtonOff", null, null, null, null, null, "bufferingBar", "seekBar", "volumeBar"];
flvplayback_internal static var customComponentClassNames:Array = ["PauseButton", "PlayButton", "StopButton", null, null, "BackButton", "ForwardButton", null, null, null, null, null, null, "PlayPauseButton", "FullScreenButton", "MuteButton", "BufferingBar", "SeekBar", "VolumeBar"];
public function UIManager(_arg1:FLVPlayback){
var vc = _arg1;
super();
_vc = vc;
_skin = null;
_skinAutoHide = false;
cacheSkinAutoHide = _skinAutoHide;
_skinFadingMaxTime = SKIN_FADING_MAX_TIME_DEFAULT;
_skinAutoHideMotionTimeout = SKIN_AUTO_HIDE_MOTION_TIMEOUT_DEFAULT;
_skinReady = true;
__visible = false;
_bufferingBarHides = false;
_controlsEnabled = true;
_lastScrubPos = 0;
_lastVolumePos = 0;
cachedSoundLevel = _vc.volume;
_isMuted = false;
controls = new Array();
customClips = null;
ctrlDataDict = new Dictionary(true);
skin_mc = null;
skinLoader = null;
skinTemplate = null;
layout_mc = null;
border_mc = null;
borderCopy = null;
borderPrevRect = null;
borderScale9Rects = null;
borderAlpha = 0.85;
borderColor = 4697035;
borderColorTransform = new ColorTransform(0, 0, 0, 0, 71, 171, 203, (0xFF * borderAlpha));
_seekBarScrubTolerance = SEEK_BAR_SCRUB_TOLERANCE_DEFAULT;
_volumeBarScrubTolerance = VOLUME_BAR_SCRUB_TOLERANCE_DEFAULT;
_bufferingOn = false;
mouseCaptureCtrl = -1;
_seekBarTimer = new Timer(SEEK_BAR_INTERVAL_DEFAULT);
_seekBarTimer.addEventListener(TimerEvent.TIMER, seekBarListener);
_volumeBarTimer = new Timer(VOLUME_BAR_INTERVAL_DEFAULT);
_volumeBarTimer.addEventListener(TimerEvent.TIMER, volumeBarListener);
_bufferingDelayTimer = new Timer(BUFFERING_DELAY_INTERVAL_DEFAULT, 1);
_bufferingDelayTimer.addEventListener(TimerEvent.TIMER, doBufferingDelay);
_skinAutoHideTimer = new Timer(SKIN_AUTO_HIDE_INTERVAL);
_skinAutoHideTimer.addEventListener(TimerEvent.TIMER, skinAutoHideHitTest);
_skinFadingTimer = new Timer(SKIN_FADING_INTERVAL);
_skinFadingTimer.addEventListener(TimerEvent.TIMER, skinFadeMore);
_vc.addEventListener(MetadataEvent.METADATA_RECEIVED, handleIVPEvent);
_vc.addEventListener(VideoEvent.PLAYHEAD_UPDATE, handleIVPEvent);
_vc.addEventListener(VideoProgressEvent.PROGRESS, handleIVPEvent);
_vc.addEventListener(VideoEvent.STATE_CHANGE, handleIVPEvent);
_vc.addEventListener(VideoEvent.READY, handleIVPEvent);
_vc.addEventListener(LayoutEvent.LAYOUT, handleLayoutEvent);
_vc.addEventListener(AutoLayoutEvent.AUTO_LAYOUT, handleLayoutEvent);
_vc.addEventListener(SoundEvent.SOUND_UPDATE, handleSoundEvent);
_vc.addEventListener(Event.ADDED_TO_STAGE, handleEvent);
_fullScreen = false;
_fullScreenTakeOver = true;
_fullScreenBgColor = 0;
if (_vc.stage != null){
try {
_fullScreen = (_vc.stage.displayState == StageDisplayState.FULL_SCREEN);
_vc.stage.addEventListener(FullScreenEvent.FULL_SCREEN, handleFullScreenEvent);
} catch(se:SecurityError) {
};
};
if (layoutNameToIndexMappings == null){
initLayoutNameToIndexMappings();
};
}
flvplayback_internal function removeButtonListeners(_arg1:Sprite):void{
if (_arg1 == null){
return;
};
_arg1.removeEventListener(MouseEvent.ROLL_OVER, handleButtonEvent);
_arg1.removeEventListener(MouseEvent.ROLL_OUT, handleButtonEvent);
_arg1.removeEventListener(MouseEvent.MOUSE_DOWN, handleButtonEvent);
_arg1.removeEventListener(MouseEvent.CLICK, handleButtonEvent);
_arg1.removeEventListener(Event.ENTER_FRAME, skinButtonControl);
}
public function set skinFadeTime(_arg1:int):void{
_skinFadingMaxTime = _arg1;
}
public function get skinFadeTime():int{
return (_skinFadingMaxTime);
}
flvplayback_internal function finishLoad(_arg1:Event):void{
var i:int;
var cachedActivePlayerIndex:int;
var state:String;
var j:int;
var e = _arg1;
try {
skinLoadDelayCount++;
if (skinLoadDelayCount < 2){
return;
} else {
_vc.removeEventListener(Event.ENTER_FRAME, finishLoad);
};
i = 0;
while (i < NUM_CONTROLS) {
if (delayedControls[i] != undefined){
setControl(i, delayedControls[i]);
};
i = (i + 1);
};
if (_fullScreenTakeOver){
enterFullScreenTakeOver();
} else {
exitFullScreenTakeOver();
};
layoutSkin();
setupSkinAutoHide(false);
skin_mc.visible = __visible;
_vc.addChild(skin_mc);
_skinReady = true;
_vc.skinLoaded();
cachedActivePlayerIndex = _vc.activeVideoPlayerIndex;
_vc.activeVideoPlayerIndex = _vc.visibleVideoPlayerIndex;
state = _vc.state;
j = 0;
while (j < NUM_CONTROLS) {
if (controls[j] == undefined){
} else {
setEnabledAndVisibleForState(j, state);
if (j < NUM_BUTTONS){
skinButtonControl(controls[j]);
};
};
j = (j + 1);
};
_vc.activeVideoPlayerIndex = cachedActivePlayerIndex;
} catch(err:Error) {
_vc.skinError(err.message);
removeSkin();
};
}
flvplayback_internal function downloadSkin():void{
if (skinLoader == null){
skinLoader = new Loader();
skinLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, handleLoad);
skinLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, handleLoadErrorEvent);
skinLoader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, handleLoadErrorEvent);
};
skinLoader.load(new URLRequest(_skin));
}
flvplayback_internal function removeSkin():void{
var i:int;
if (skinLoader != null){
try {
skinLoader.close();
} catch(e1:Error) {
};
skinLoader = null;
};
if (skin_mc != null){
i = 0;
while (i < NUM_CONTROLS) {
if (controls[i] == undefined){
} else {
if (i < NUM_BUTTONS){
removeButtonListeners(controls[i]);
};
delete ctrlDataDict[controls[i]];
delete controls[i];
};
i = (i + 1);
};
try {
skin_mc.parent.removeChild(skin_mc);
} catch(e2:Error) {
};
skin_mc = null;
};
skinTemplate = null;
layout_mc = null;
border_mc = null;
borderCopy = null;
borderPrevRect = null;
borderScale9Rects = null;
}
flvplayback_internal function positionBar(_arg1:Sprite, _arg2:String, _arg3:Number):void{
var ctrlData:ControlData;
var bar:DisplayObject;
var barData:ControlData;
var ctrl = _arg1;
var type = _arg2;
var percent = _arg3;
try {
if ((((ctrl["positionBar"] is Function)) && (ctrl["positionBar"](type, percent)))){
return;
};
} catch(re2:ReferenceError) {
};
ctrlData = ctrlDataDict[ctrl];
bar = ctrlData[(type + "_mc")];
if (bar == null){
return;
};
barData = ctrlDataDict[bar];
if (bar.parent == ctrl){
if (barData.fill_mc == null){
bar.scaleX = ((barData.origScaleX * percent) / 100);
} else {
positionMaskedFill(bar, percent);
};
} else {
bar.x = (ctrl.x + barData.leftMargin);
bar.y = (ctrl.y + barData.origY);
if (barData.fill_mc == null){
bar.width = ((((ctrl.width - barData.leftMargin) - barData.rightMargin) * percent) / 100);
} else {
positionMaskedFill(bar, percent);
};
};
}
flvplayback_internal function setupButtonSkin(_arg1:int):Sprite{
var _local2:String;
var _local3:Sprite;
var _local4:ControlData;
_local2 = skinClassPrefixes[_arg1];
if (_local2 == null){
return (null);
};
_local3 = new Sprite();
_local4 = new ControlData(this, _local3, null, _arg1);
ctrlDataDict[_local3] = _local4;
_local4.state_mc = new Array();
_local4.state_mc[NORMAL_STATE] = setupButtonSkinState(_local3, skinTemplate, (_local2 + "NormalState"));
_local4.state_mc[NORMAL_STATE].visible = true;
_local4.state_mc[OVER_STATE] = setupButtonSkinState(_local3, skinTemplate, (_local2 + "OverState"), _local4.state_mc[NORMAL_STATE]);
_local4.state_mc[DOWN_STATE] = setupButtonSkinState(_local3, skinTemplate, (_local2 + "DownState"), _local4.state_mc[NORMAL_STATE]);
_local4.disabled_mc = setupButtonSkinState(_local3, skinTemplate, (_local2 + "DisabledState"), _local4.state_mc[NORMAL_STATE]);
return (_local3);
}
public function get skinReady():Boolean{
return (_skinReady);
}
public function get skinAutoHide():Boolean{
return (_skinAutoHide);
}
flvplayback_internal function dispatchMessage(_arg1:int):void{
var _local2:int;
var _local3:Sprite;
var _local4:ControlData;
var _local5:Sprite;
if ((((_arg1 == SEEK_BAR_HANDLE)) || ((_arg1 == SEEK_BAR_HIT)))){
_vc._scrubStart();
};
_local2 = _vc.activeVideoPlayerIndex;
_vc.activeVideoPlayerIndex = _vc.visibleVideoPlayerIndex;
switch (_arg1){
case PAUSE_BUTTON:
_vc.pause();
break;
case PLAY_BUTTON:
_vc.play();
break;
case STOP_BUTTON:
_vc.stop();
break;
case SEEK_BAR_HIT:
case SEEK_BAR_HANDLE:
_local3 = controls[SEEK_BAR];
_local4 = ctrlDataDict[_local3];
calcPercentageFromHandle(_local3);
_lastScrubPos = _local4.percentage;
if (_arg1 == SEEK_BAR_HIT){
_local5 = controls[SEEK_BAR_HANDLE];
controls[SEEK_BAR_HANDLE].x = _local5.parent.mouseX;
_local5.y = _local5.parent.mouseY;
};
_vc.removeEventListener(VideoEvent.PLAYHEAD_UPDATE, handleIVPEvent);
if (((_vc.playing) || (_vc.buffering))){
_playAfterScrub = true;
} else {
if (_vc.state != VideoState.SEEKING){
_playAfterScrub = false;
};
};
_seekBarTimer.start();
startHandleDrag(_local3);
_vc.pause();
break;
case VOLUME_BAR_HIT:
case VOLUME_BAR_HANDLE:
_local3 = controls[VOLUME_BAR];
_local4 = ctrlDataDict[_local3];
calcPercentageFromHandle(_local3);
_lastVolumePos = _local4.percentage;
if (_arg1 == VOLUME_BAR_HIT){
_local5 = controls[VOLUME_BAR_HANDLE];
controls[VOLUME_BAR_HANDLE].x = _local5.parent.mouseX;
_local5.y = _local5.parent.mouseY;
};
_vc.removeEventListener(SoundEvent.SOUND_UPDATE, handleSoundEvent);
_volumeBarTimer.start();
startHandleDrag(_local3);
break;
case BACK_BUTTON:
_vc.seekToPrevNavCuePoint();
break;
case FORWARD_BUTTON:
_vc.seekToNextNavCuePoint();
break;
case MUTE_ON_BUTTON:
if (!_isMuted){
_isMuted = true;
cachedSoundLevel = _vc.volume;
_vc.volume = 0;
setEnabledAndVisibleForState(MUTE_OFF_BUTTON, VideoState.PLAYING);
skinButtonControl(controls[MUTE_OFF_BUTTON]);
setEnabledAndVisibleForState(MUTE_ON_BUTTON, VideoState.PLAYING);
skinButtonControl(controls[MUTE_ON_BUTTON]);
};
break;
case MUTE_OFF_BUTTON:
if (_isMuted){
_isMuted = false;
_vc.volume = cachedSoundLevel;
setEnabledAndVisibleForState(MUTE_OFF_BUTTON, VideoState.PLAYING);
skinButtonControl(controls[MUTE_OFF_BUTTON]);
setEnabledAndVisibleForState(MUTE_ON_BUTTON, VideoState.PLAYING);
skinButtonControl(controls[MUTE_ON_BUTTON]);
};
break;
case FULL_SCREEN_ON_BUTTON:
if (((!(_fullScreen)) && (!((_vc.stage == null))))){
_vc.stage.displayState = StageDisplayState.FULL_SCREEN;
setEnabledAndVisibleForState(FULL_SCREEN_OFF_BUTTON, VideoState.PLAYING);
skinButtonControl(controls[FULL_SCREEN_OFF_BUTTON]);
setEnabledAndVisibleForState(FULL_SCREEN_ON_BUTTON, VideoState.PLAYING);
skinButtonControl(controls[FULL_SCREEN_ON_BUTTON]);
};
break;
case FULL_SCREEN_OFF_BUTTON:
if (((_fullScreen) && (!((_vc.stage == null))))){
_vc.stage.displayState = StageDisplayState.NORMAL;
setEnabledAndVisibleForState(FULL_SCREEN_OFF_BUTTON, VideoState.PLAYING);
skinButtonControl(controls[FULL_SCREEN_OFF_BUTTON]);
setEnabledAndVisibleForState(FULL_SCREEN_ON_BUTTON, VideoState.PLAYING);
skinButtonControl(controls[FULL_SCREEN_ON_BUTTON]);
};
break;
default:
throw (new Error("Unknown ButtonControl"));
};
_vc.activeVideoPlayerIndex = _local2;
}
flvplayback_internal function handleFullScreenEvent(_arg1:FullScreenEvent):void{
_fullScreen = _arg1.fullScreen;
setEnabledAndVisibleForState(FULL_SCREEN_OFF_BUTTON, VideoState.PLAYING);
skinButtonControl(controls[FULL_SCREEN_OFF_BUTTON]);
setEnabledAndVisibleForState(FULL_SCREEN_ON_BUTTON, VideoState.PLAYING);
skinButtonControl(controls[FULL_SCREEN_ON_BUTTON]);
if (((_fullScreen) && (_fullScreenTakeOver))){
enterFullScreenTakeOver();
} else {
if (!_fullScreen){
exitFullScreenTakeOver();
};
};
}
flvplayback_internal function handleLayoutEvent(_arg1:LayoutEvent):void{
layoutSkin();
setupSkinAutoHide(false);
}
flvplayback_internal function seekBarListener(_arg1:TimerEvent):void{
var _local2:int;
var _local3:Sprite;
var _local4:ControlData;
var _local5:Number;
_local2 = _vc.activeVideoPlayerIndex;
_vc.activeVideoPlayerIndex = _vc.visibleVideoPlayerIndex;
_local3 = controls[SEEK_BAR];
if (_local3 == null){
return;
};
_local4 = ctrlDataDict[_local3];
calcPercentageFromHandle(_local3);
_local5 = _local4.percentage;
if (_arg1 == null){
_seekBarTimer.stop();
if (_local5 != _lastScrubPos){
_vc.seekPercent(_local5);
};
_vc.addEventListener(VideoEvent.PLAYHEAD_UPDATE, handleIVPEvent);
if (_playAfterScrub){
_vc.play();
};
} else {
if (_vc.getVideoPlayer(_vc.visibleVideoPlayerIndex).state == VideoState.SEEKING){
} else {
if ((((((((_seekBarScrubTolerance <= 0)) || ((Math.abs((_local5 - _lastScrubPos)) > _seekBarScrubTolerance)))) || ((_local5 < _seekBarScrubTolerance)))) || ((_local5 > (100 - _seekBarScrubTolerance))))){
if (_local5 != _lastScrubPos){
_lastScrubPos = _local5;
_vc.seekPercent(_local5);
};
};
};
};
_vc.activeVideoPlayerIndex = _local2;
}
public function get seekBarInterval():Number{
return (_seekBarTimer.delay);
}
public function set skinAutoHide(_arg1:Boolean):void{
if (_arg1 == _skinAutoHide){
return;
};
_skinAutoHide = _arg1;
cacheSkinAutoHide = _arg1;
setupSkinAutoHide(true);
}
flvplayback_internal function setCustomClip(_arg1:DisplayObject):void{
var dCopy:DisplayObject;
var ctrlData:ControlData;
var scale9Grid:Rectangle;
var diff:Number;
var numBorderBitmaps:int;
var i:int;
var lastXDim:Number;
var lastYDim:Number;
var newRect:Rectangle;
var dispObj = _arg1;
dCopy = new (dispObj["constructor"]);
skin_mc.addChild(dCopy);
ctrlData = new ControlData(this, dCopy, null, -1);
ctrlDataDict[dCopy] = ctrlData;
ctrlData.avatar = dispObj;
customClips.push(dCopy);
if (dispObj.name == "border_mc"){
border_mc = dCopy;
try {
borderCopy = (ctrlData.avatar["colorMe"]) ? new Sprite() : null;
} catch(re:ReferenceError) {
borderCopy = null;
};
if (borderCopy != null){
border_mc.visible = false;
scale9Grid = border_mc.scale9Grid;
scale9Grid.x = Math.round(scale9Grid.x);
scale9Grid.y = Math.round(scale9Grid.y);
scale9Grid.width = Math.round(scale9Grid.width);
diff = ((scale9Grid.x + scale9Grid.width) - border_mc.scale9Grid.right);
if (diff > 0.5){
scale9Grid.width--;
} else {
if (diff < -0.5){
scale9Grid.width++;
};
};
scale9Grid.height = Math.round(scale9Grid.height);
diff = ((scale9Grid.y + scale9Grid.height) - border_mc.scale9Grid.bottom);
if (diff > 0.5){
scale9Grid.height--;
} else {
if (diff < -0.5){
scale9Grid.height++;
};
};
if (scale9Grid != null){
borderScale9Rects = new Array();
lastXDim = (border_mc.width - (scale9Grid.x + scale9Grid.width));
lastXDim = (Math.floor(lastXDim) + 1);
lastYDim = (border_mc.height - (scale9Grid.y + scale9Grid.height));
lastYDim = (Math.floor(lastYDim) + 1);
newRect = new Rectangle(0, 0, scale9Grid.x, scale9Grid.y);
borderScale9Rects.push(((((newRect.width < 1)) || ((newRect.height < 1)))) ? null : newRect);
newRect = new Rectangle(scale9Grid.x, 0, scale9Grid.width, scale9Grid.y);
borderScale9Rects.push(((((newRect.width < 1)) || ((newRect.height < 1)))) ? null : newRect);
newRect = new Rectangle((scale9Grid.x + scale9Grid.width), 0, lastXDim, scale9Grid.y);
borderScale9Rects.push(((((newRect.width < 1)) || ((newRect.height < 1)))) ? null : newRect);
newRect = new Rectangle(0, scale9Grid.y, scale9Grid.x, scale9Grid.height);
borderScale9Rects.push(((((newRect.width < 1)) || ((newRect.height < 1)))) ? null : newRect);
newRect = new Rectangle(scale9Grid.x, scale9Grid.y, scale9Grid.width, scale9Grid.height);
borderScale9Rects.push(((((newRect.width < 1)) || ((newRect.height < 1)))) ? null : newRect);
newRect = new Rectangle((scale9Grid.x + scale9Grid.width), scale9Grid.y, lastXDim, scale9Grid.height);
borderScale9Rects.push(((((newRect.width < 1)) || ((newRect.height < 1)))) ? null : newRect);
newRect = new Rectangle(0, (scale9Grid.y + scale9Grid.height), scale9Grid.x, lastYDim);
borderScale9Rects.push(((((newRect.width < 1)) || ((newRect.height < 1)))) ? null : newRect);
newRect = new Rectangle(scale9Grid.x, (scale9Grid.y + scale9Grid.height), scale9Grid.width, lastYDim);
borderScale9Rects.push(((((newRect.width < 1)) || ((newRect.height < 1)))) ? null : newRect);
newRect = new Rectangle((scale9Grid.x + scale9Grid.width), (scale9Grid.y + scale9Grid.height), lastXDim, lastYDim);
borderScale9Rects.push(((((newRect.width < 1)) || ((newRect.height < 1)))) ? null : newRect);
i = 0;
while (i < borderScale9Rects.length) {
if (borderScale9Rects[i] != null){
break;
};
i = (i + 1);
};
if (i >= borderScale9Rects.length){
borderScale9Rects = null;
};
};
numBorderBitmaps = ((borderScale9Rects)==null) ? 1 : 9;
i = 0;
while (i < numBorderBitmaps) {
if ((((borderScale9Rects == null)) || (!((borderScale9Rects[i] == null))))){
borderCopy.addChild(new Bitmap());
};
i = (i + 1);
};
skin_mc.addChild(borderCopy);
borderPrevRect = null;
};
};
}
public function get fullScreenSkinDelay():int{
return (_skinAutoHideMotionTimeout);
}
flvplayback_internal function doBufferingDelay(_arg1:TimerEvent):void{
var _local2:int;
_bufferingDelayTimer.reset();
_local2 = _vc.activeVideoPlayerIndex;
_vc.activeVideoPlayerIndex = _vc.visibleVideoPlayerIndex;
if (_vc.state == VideoState.BUFFERING){
_bufferingOn = true;
handleIVPEvent(new VideoEvent(VideoEvent.STATE_CHANGE, false, false, VideoState.BUFFERING, NaN, _vc.visibleVideoPlayerIndex));
};
_vc.activeVideoPlayerIndex = _local2;
}
flvplayback_internal function volumeBarListener(_arg1:TimerEvent):void{
var _local2:Sprite;
var _local3:ControlData;
var _local4:Number;
var _local5:Boolean;
_local2 = controls[VOLUME_BAR];
if (_local2 == null){
return;
};
_local3 = ctrlDataDict[_local2];
calcPercentageFromHandle(_local2);
_local4 = _local3.percentage;
_local5 = (_arg1 == null);
if (_local5){
_volumeBarTimer.stop();
_vc.addEventListener(SoundEvent.SOUND_UPDATE, handleSoundEvent);
};
if (((((((((_local5) || ((_volumeBarScrubTolerance <= 0)))) || ((Math.abs((_local4 - _lastVolumePos)) > _volumeBarScrubTolerance)))) || ((_local4 < _volumeBarScrubTolerance)))) || ((_local4 > (100 - _volumeBarScrubTolerance))))){
if (_local4 != _lastVolumePos){
if (_isMuted){
cachedSoundLevel = (_local4 / 100);
} else {
_vc.volume = (_local4 / 100);
};
_lastVolumePos = _local4;
};
};
}
public function get visible():Boolean{
return (__visible);
}
flvplayback_internal function fixUpBar(_arg1:DisplayObject, _arg2:String, _arg3:DisplayObject, _arg4:String):void{
var ctrlData:ControlData;
var bar:DisplayObject;
var barData:ControlData;
var definitionHolder = _arg1;
var propPrefix = _arg2;
var ctrl = _arg3;
var name = _arg4;
ctrlData = ctrlDataDict[ctrl];
if (ctrlData[name] != null){
return;
};
try {
bar = ctrl[name];
} catch(re:ReferenceError) {
bar = null;
};
if (bar == null){
try {
bar = createSkin(definitionHolder, (propPrefix + "LinkageID"));
} catch(ve:VideoError) {
bar = null;
};
if (bar == null){
return;
};
if (ctrl.parent != null){
if (getBooleanPropSafe(ctrl, (propPrefix + "Below"))){
ctrl.parent.addChildAt(bar, ctrl.parent.getChildIndex(ctrl));
} else {
ctrl.parent.addChild(bar);
};
};
};
ctrlData[name] = bar;
barData = ctrlDataDict[bar];
if (barData == null){
barData = new ControlData(this, bar, ctrl, -1);
ctrlDataDict[bar] = barData;
};
}
public function get volumeBarInterval():Number{
return (_volumeBarTimer.delay);
}
public function get bufferingBarHidesAndDisablesOthers():Boolean{
return (_bufferingBarHides);
}
flvplayback_internal function calcLayoutControl(_arg1:DisplayObject):Rectangle{
var rect:Rectangle;
var ctrlData:ControlData;
var anchorRight:Boolean;
var anchorLeft:Boolean;
var anchorTop:Boolean;
var anchorBottom:Boolean;
var ctrl = _arg1;
rect = new Rectangle();
if (ctrl == null){
return (rect);
};
ctrlData = ctrlDataDict[ctrl];
if (ctrlData == null){
return (rect);
};
if (ctrlData.avatar == null){
return (rect);
};
anchorRight = false;
anchorLeft = true;
anchorTop = false;
anchorBottom = true;
try {
anchorRight = ctrlData.avatar["anchorRight"];
} catch(re1:ReferenceError) {
anchorRight = false;
};
try {
anchorLeft = ctrlData.avatar["anchorLeft"];
} catch(re1:ReferenceError) {
anchorLeft = true;
};
try {
anchorTop = ctrlData.avatar["anchorTop"];
} catch(re1:ReferenceError) {
anchorTop = false;
};
try {
anchorBottom = ctrlData.avatar["anchorBottom"];
} catch(re1:ReferenceError) {
anchorBottom = true;
};
if (anchorRight){
if (anchorLeft){
rect.x = ((ctrlData.avatar.x - placeholderLeft) + videoLeft);
rect.width = ((((ctrlData.avatar.x + ctrlData.avatar.width) - placeholderRight) + videoRight) - rect.x);
ctrlData.origWidth = NaN;
} else {
rect.x = ((ctrlData.avatar.x - placeholderRight) + videoRight);
rect.width = ctrl.width;
};
} else {
rect.x = ((ctrlData.avatar.x - placeholderLeft) + videoLeft);
rect.width = ctrl.width;
};
if (anchorTop){
if (anchorBottom){
rect.y = ((ctrlData.avatar.y - placeholderTop) + videoTop);
rect.height = ((((ctrlData.avatar.y + ctrlData.avatar.height) - placeholderBottom) + videoBottom) - rect.y);
ctrlData.origHeight = NaN;
} else {
rect.y = ((ctrlData.avatar.y - placeholderTop) + videoTop);
rect.height = ctrl.height;
};
} else {
rect.y = ((ctrlData.avatar.y - placeholderBottom) + videoBottom);
rect.height = ctrl.height;
};
try {
if ((ctrl["layoutSelf"] is Function)){
rect = ctrl["layoutSelf"](rect);
};
} catch(re3:ReferenceError) {
};
return (rect);
}
flvplayback_internal function skinFadeMore(_arg1:TimerEvent):void{
var _local2:Number;
if (((((!(_skinFadingIn)) && ((skin_mc.alpha <= 0.5)))) || (((_skinFadingIn) && ((skin_mc.alpha >= 0.95)))))){
skin_mc.visible = _skinFadingIn;
skin_mc.alpha = 1;
_skinFadingTimer.stop();
} else {
_local2 = ((getTimer() - _skinFadeStartTime) / _skinFadingMaxTime);
if (!_skinFadingIn){
_local2 = (1 - _local2);
};
if (_local2 < 0){
_local2 = 0;
} else {
if (_local2 > 1){
_local2 = 1;
};
};
skin_mc.alpha = _local2;
};
}
flvplayback_internal function resetPlayPause():void{
var _local1:int;
if (controls[PLAY_PAUSE_BUTTON] == undefined){
return;
};
_local1 = PAUSE_BUTTON;
while (_local1 <= PLAY_BUTTON) {
removeButtonListeners(controls[_local1]);
delete ctrlDataDict[controls[_local1]];
delete controls[_local1];
_local1++;
};
delete ctrlDataDict[controls[PLAY_PAUSE_BUTTON]];
delete controls[PLAY_PAUSE_BUTTON];
}
public function setControl(_arg1:int, _arg2:Sprite):void{
var ctrlData:ControlData;
var index = _arg1;
var ctrl = _arg2;
if (ctrl == controls[index]){
return;
};
switch (index){
case PAUSE_BUTTON:
case PLAY_BUTTON:
resetPlayPause();
break;
case PLAY_PAUSE_BUTTON:
if ((((ctrl == null)) || (!((ctrl.parent == skin_mc))))){
resetPlayPause();
};
if (ctrl != null){
setControl(PAUSE_BUTTON, Sprite(ctrl.getChildByName("pause_mc")));
setControl(PLAY_BUTTON, Sprite(ctrl.getChildByName("play_mc")));
};
break;
case FULL_SCREEN_BUTTON:
if (ctrl != null){
setControl(FULL_SCREEN_ON_BUTTON, Sprite(ctrl.getChildByName("on_mc")));
setControl(FULL_SCREEN_OFF_BUTTON, Sprite(ctrl.getChildByName("off_mc")));
};
break;
case MUTE_BUTTON:
if (ctrl != null){
setControl(MUTE_ON_BUTTON, Sprite(ctrl.getChildByName("on_mc")));
setControl(MUTE_OFF_BUTTON, Sprite(ctrl.getChildByName("off_mc")));
};
break;
};
if (controls[index] != null){
try {
delete controls[index]["uiMgr"];
} catch(re:ReferenceError) {
};
if (index < NUM_BUTTONS){
removeButtonListeners(controls[index]);
};
delete ctrlDataDict[controls[index]];
delete controls[index];
};
if (ctrl == null){
return;
};
ctrlData = ctrlDataDict[ctrl];
if (ctrlData == null){
ctrlData = new ControlData(this, ctrl, null, index);
ctrlDataDict[ctrl] = ctrlData;
} else {
ctrlData.index = index;
};
if (index >= NUM_BUTTONS){
controls[index] = ctrl;
switch (index){
case SEEK_BAR:
addBarControl(ctrl);
break;
case VOLUME_BAR:
addBarControl(ctrl);
ctrlData.percentage = (_vc.volume * 100);
break;
case BUFFERING_BAR:
if (ctrl.parent == skin_mc){
finishAddBufferingBar();
} else {
ctrl.addEventListener(Event.ENTER_FRAME, finishAddBufferingBar);
};
break;
};
setEnabledAndVisibleForState(index, _vc.state);
} else {
controls[index] = ctrl;
addButtonControl(ctrl);
};
}
flvplayback_internal function bitmapCopyBorder():void{
var _local1:Rectangle;
var _local2:BitmapData;
var _local3:Matrix;
var _local4:Number;
var _local5:Number;
var _local6:Rectangle;
var _local7:int;
var _local8:int;
var _local9:Bitmap;
var _local10:Number;
var _local11:Number;
if ((((border_mc == null)) || ((borderCopy == null)))){
return;
};
_local1 = border_mc.getBounds(skin_mc);
if ((((borderPrevRect == null)) || (!(borderPrevRect.equals(_local1))))){
borderCopy.x = _local1.x;
borderCopy.y = _local1.y;
_local3 = new Matrix(border_mc.scaleX, 0, 0, border_mc.scaleY, 0, 0);
if (borderScale9Rects == null){
_local2 = new BitmapData(_local1.width, _local1.height, true, 0);
_local2.draw(border_mc, _local3, borderColorTransform);
Bitmap(borderCopy.getChildAt(0)).bitmapData = _local2;
} else {
_local4 = 0;
_local5 = 0;
_local6 = new Rectangle(0, 0, 0, 0);
_local7 = 0;
_local8 = 0;
while (_local8 < borderScale9Rects.length) {
if ((_local8 % 3) == 0){
_local4 = 0;
_local5 = (_local5 + _local6.height);
};
if (borderScale9Rects[_local8] == null){
} else {
_local6 = Rectangle(borderScale9Rects[_local8]).clone();
_local3.a = 1;
if ((((((_local8 == 1)) || ((_local8 == 4)))) || ((_local8 == 7)))){
_local10 = ((_local1.width - (_local4 * 2)) / _local6.width);
_local6.x = (_local6.x * _local10);
_local6.width = (_local6.width * _local10);
_local6.width = Math.round(_local6.width);
_local3.a = (_local3.a * _local10);
};
_local3.tx = -(_local6.x);
_local6.x = 0;
_local3.d = 1;
if ((((_local8 >= 3)) && ((_local8 <= 5)))){
_local11 = ((_local1.height - (_local5 * 2)) / _local6.height);
_local6.y = (_local6.y * _local11);
_local6.height = (_local6.height * _local11);
_local6.height = Math.round(_local6.height);
_local3.d = (_local3.d * _local11);
};
_local3.ty = -(_local6.y);
_local6.y = 0;
_local2 = new BitmapData(_local6.width, _local6.height, true, 0);
_local2.draw(border_mc, _local3, borderColorTransform, null, _local6, false);
_local9 = Bitmap(borderCopy.getChildAt(_local7));
_local7++;
_local9.bitmapData = _local2;
_local9.x = _local4;
_local9.y = _local5;
_local4 = (_local4 + _local6.width);
};
_local8++;
};
};
borderPrevRect = _local1;
};
}
flvplayback_internal function createSkin(_arg1:DisplayObject, _arg2:String):DisplayObject{
var stateSkinDesc:*;
var theClass:Class;
var definitionHolder = _arg1;
var skinName = _arg2;
try {
stateSkinDesc = definitionHolder[skinName];
if ((stateSkinDesc is String)){
try {
theClass = Class(definitionHolder.loaderInfo.applicationDomain.getDefinition(stateSkinDesc));
} catch(err1:Error) {
theClass = Class(getDefinitionByName(stateSkinDesc));
};
return (DisplayObject(new (theClass)));
} else {
if ((stateSkinDesc is Class)){
return (new (stateSkinDesc));
} else {
if ((stateSkinDesc is DisplayObject)){
return (stateSkinDesc);
};
};
};
} catch(err2:Error) {
throw (new VideoError(VideoError.MISSING_SKIN_STYLE, skinName));
};
return (null);
}
flvplayback_internal function hookUpCustomComponents():void{
var searchHash:Object;
var doTheSearch:Boolean;
var i:int;
var dispObj:DisplayObject;
var name:String;
var index:int;
var ctrl:Sprite;
searchHash = new Object();
doTheSearch = false;
i = 0;
while (i < NUM_CONTROLS) {
if (controls[i] == null){
searchHash[customComponentClassNames[i]] = i;
doTheSearch = true;
};
i = (i + 1);
};
if (!doTheSearch){
return;
};
i = 0;
while (i < _vc.parent.numChildren) {
dispObj = _vc.parent.getChildAt(i);
name = getQualifiedClassName(dispObj);
if (searchHash[name] != undefined){
if (typeof(searchHash[name]) == "number"){
index = int(searchHash[name]);
try {
ctrl = Sprite(dispObj);
if ((((((index >= NUM_BUTTONS)) || ((ctrl["placeholder_mc"] is DisplayObject)))) && ((ctrl["uiMgr"] == null)))){
setControl(index, ctrl);
searchHash[name] = ctrl;
};
} catch(err:Error) {
};
};
};
i = (i + 1);
};
}
flvplayback_internal function addButtonControl(_arg1:Sprite):void{
var _local2:ControlData;
var _local3:int;
if (_arg1 == null){
return;
};
_local2 = ctrlDataDict[_arg1];
_arg1.mouseChildren = false;
_local3 = _vc.activeVideoPlayerIndex;
_vc.activeVideoPlayerIndex = _vc.visibleVideoPlayerIndex;
_local2.state = NORMAL_STATE;
setEnabledAndVisibleForState(_local2.index, _vc.state);
_arg1.addEventListener(MouseEvent.ROLL_OVER, handleButtonEvent);
_arg1.addEventListener(MouseEvent.ROLL_OUT, handleButtonEvent);
_arg1.addEventListener(MouseEvent.MOUSE_DOWN, handleButtonEvent);
_arg1.addEventListener(MouseEvent.CLICK, handleButtonEvent);
if (_arg1.parent == skin_mc){
skinButtonControl(_arg1);
} else {
_arg1.addEventListener(Event.ENTER_FRAME, skinButtonControl);
};
_vc.activeVideoPlayerIndex = _local3;
}
flvplayback_internal function positionHandle(_arg1:Sprite):void{
var _local2:ControlData;
var _local3:Sprite;
var _local4:ControlData;
var _local5:Number;
var _local6:Number;
if (_arg1 == null){
return;
};
if ((((_arg1["positionHandle"] is Function)) && (_arg1["positionHandle"]()))){
return;
};
_local2 = ctrlDataDict[_arg1];
_local3 = _local2.handle_mc;
if (_local3 == null){
return;
};
_local4 = ctrlDataDict[_local3];
_local5 = (isNaN(_local2.origWidth)) ? _arg1.width : _local2.origWidth;
_local6 = ((_local5 - _local4.rightMargin) - _local4.leftMargin);
_local3.x = ((_arg1.x + _local4.leftMargin) + ((_local6 * _local2.percentage) / 100));
_local3.y = (_arg1.y + _local4.origY);
if (_local2.fullness_mc != null){
positionBar(_arg1, "fullness", _local2.percentage);
};
}
flvplayback_internal function exitFullScreenTakeOver():void{
var fullScreenBG:Sprite;
if (cacheStageAlign == null){
return;
};
_vc.removeEventListener(Event.ADDED_TO_STAGE, handleEvent);
try {
_vc.stage.align = cacheStageAlign;
_vc.stage.scaleMode = cacheStageScaleMode;
if (_vc.parent != cacheFLVPlaybackParent){
cacheFLVPlaybackParent.addChildAt(_vc, cacheFLVPlaybackIndex);
} else {
cacheFLVPlaybackParent.setChildIndex(_vc, cacheFLVPlaybackIndex);
};
if (cacheStageAlign == null){
return;
};
_vc.registrationX = cacheFLVPlaybackLocation.x;
_vc.registrationY = cacheFLVPlaybackLocation.y;
_vc.setSize(cacheFLVPlaybackLocation.width, cacheFLVPlaybackLocation.height);
fullScreenBG = Sprite(_vc.getChildByName("fullScreenBG"));
if (fullScreenBG != null){
_vc.removeChild(fullScreenBG);
};
} catch(err:Error) {
};
_vc.addEventListener(Event.ADDED_TO_STAGE, handleEvent);
cacheStageAlign = null;
cacheStageScaleMode = null;
cacheFLVPlaybackParent = null;
cacheFLVPlaybackIndex = 0;
cacheFLVPlaybackLocation = null;
if (_skinAutoHide != cacheSkinAutoHide){
_skinAutoHide = cacheSkinAutoHide;
setupSkinAutoHide(false);
};
}
flvplayback_internal function positionMaskedFill(_arg1:DisplayObject, _arg2:Number):void{
var ctrlData:ControlData;
var fill:DisplayObject;
var mask:DisplayObject;
var fillData:ControlData;
var maskData:ControlData;
var slideReveal:Boolean;
var maskSprite:Sprite;
var barData:ControlData;
var ctrl = _arg1;
var percent = _arg2;
if (ctrl == null){
return;
};
ctrlData = ctrlDataDict[ctrl];
fill = ctrlData.fill_mc;
if (fill == null){
return;
};
mask = ctrlData.mask_mc;
if (ctrlData.mask_mc == null){
try {
var _local4 = ctrl["mask_mc"];
mask = _local4;
ctrlData.mask_mc = _local4;
} catch(re:ReferenceError) {
ctrlData.mask_mc = null;
};
if (ctrlData.mask_mc == null){
maskSprite = new Sprite();
_local4 = maskSprite;
mask = _local4;
ctrlData.mask_mc = _local4;
maskSprite.graphics.beginFill(0xFFFFFF);
maskSprite.graphics.drawRect(0, 0, 1, 1);
maskSprite.graphics.endFill();
barData = ctrlDataDict[fill];
maskSprite.x = barData.origX;
maskSprite.y = barData.origY;
maskSprite.width = barData.origWidth;
maskSprite.height = barData.origHeight;
maskSprite.visible = false;
fill.parent.addChild(maskSprite);
fill.mask = maskSprite;
};
if (ctrlData.mask_mc != null){
calcBarMargins(ctrl, "mask", true);
};
};
fillData = ctrlDataDict[fill];
maskData = ctrlDataDict[mask];
try {
slideReveal = fill["slideReveal"];
} catch(re:ReferenceError) {
slideReveal = false;
};
if (fill.parent == ctrl){
if (slideReveal){
fill.x = ((maskData.origX - fillData.origWidth) + ((fillData.origWidth * percent) / 100));
} else {
mask.width = ((fillData.origWidth * percent) / 100);
};
} else {
if (fill.parent == ctrl.parent){
if (slideReveal){
mask.x = (ctrl.x + maskData.leftMargin);
mask.y = (ctrl.y + maskData.topMargin);
mask.width = ((ctrl.width - maskData.rightMargin) - maskData.leftMargin);
mask.height = ((ctrl.height - maskData.topMargin) - maskData.bottomMargin);
fill.x = ((mask.x - fillData.origWidth) + ((maskData.origWidth * percent) / 100));
fill.y = (ctrl.y + fillData.topMargin);
} else {
fill.x = (ctrl.x + fillData.leftMargin);
fill.y = (ctrl.y + fillData.topMargin);
mask.x = fill.x;
mask.y = fill.y;
mask.width = ((((ctrl.width - fillData.rightMargin) - fillData.leftMargin) * percent) / 100);
mask.height = ((ctrl.height - fillData.topMargin) - fillData.bottomMargin);
};
};
};
}
flvplayback_internal function calcPercentageFromHandle(_arg1:Sprite):void{
var _local2:ControlData;
var _local3:Sprite;
var _local4:ControlData;
var _local5:Number;
var _local6:Number;
var _local7:Number;
if (_arg1 == null){
return;
};
_local2 = ctrlDataDict[_arg1];
if ((((_arg1["calcPercentageFromHandle"] is Function)) && (_arg1["calcPercentageFromHandle"]()))){
if (_local2.percentage < 0){
_local2.percentage = 0;
};
if (_local2.percentage > 100){
_local2.percentage = 100;
};
return;
};
_local3 = _local2.handle_mc;
if (_local3 == null){
return;
};
_local4 = ctrlDataDict[_local3];
_local5 = (isNaN(_local2.origWidth)) ? _arg1.width : _local2.origWidth;
_local6 = ((_local5 - _local4.rightMargin) - _local4.leftMargin);
_local7 = (_local3.x - (_arg1.x + _local4.leftMargin));
_local2.percentage = ((_local7 / _local6) * 100);
if (_local2.percentage < 0){
_local2.percentage = 0;
};
if (_local2.percentage > 100){
_local2.percentage = 100;
};
if (_local2.fullness_mc != null){
positionBar(_arg1, "fullness", _local2.percentage);
};
}
flvplayback_internal function skinAutoHideHitTest(_arg1:TimerEvent, _arg2:Boolean=true):void{
var visibleVP:VideoPlayer;
var hit:Boolean;
var e = _arg1;
var doFade = _arg2;
try {
if (!__visible){
skin_mc.visible = false;
} else {
if (_vc.stage != null){
visibleVP = _vc.getVideoPlayer(_vc.visibleVideoPlayerIndex);
hit = visibleVP.hitTestPoint(_vc.stage.mouseX, _vc.stage.mouseY, true);
if (((((_fullScreen) && (_fullScreenTakeOver))) && (!((e == null))))){
if ((((_vc.stage.mouseX == _skinAutoHideMouseX)) && ((_vc.stage.mouseY == _skinAutoHideMouseY)))){
if ((getTimer() - _skinAutoHideLastMotionTime) > _skinAutoHideMotionTimeout){
hit = false;
};
} else {
_skinAutoHideLastMotionTime = getTimer();
_skinAutoHideMouseX = _vc.stage.mouseX;
_skinAutoHideMouseY = _vc.stage.mouseY;
};
};
if (((!(hit)) && (!((border_mc == null))))){
hit = border_mc.hitTestPoint(_vc.stage.mouseX, _vc.stage.mouseY, true);
if (((((hit) && (_fullScreen))) && (_fullScreenTakeOver))){
_skinAutoHideLastMotionTime = getTimer();
};
};
if (((!(doFade)) || ((_skinFadingMaxTime <= 0)))){
_skinFadingTimer.stop();
skin_mc.visible = hit;
skin_mc.alpha = 1;
} else {
if (((((((hit) && (skin_mc.visible))) && (((!(_skinFadingTimer.running)) || (_skinFadingIn))))) || (((!(hit)) && (((!(skin_mc.visible)) || (((_skinFadingTimer.running) && (!(_skinFadingIn)))))))))){
} else {
_skinFadingTimer.stop();
_skinFadingIn = hit;
if (((_skinFadingIn) && ((skin_mc.alpha == 1)))){
skin_mc.alpha = 0;
};
_skinFadeStartTime = getTimer();
_skinFadingTimer.start();
skin_mc.visible = true;
};
};
};
};
} catch(se:SecurityError) {
_skinAutoHideTimer.stop();
_skinFadingTimer.stop();
skin_mc.visible = __visible;
skin_mc.alpha = 1;
};
}
flvplayback_internal function handleRelease(_arg1:int):void{
var _local2:int;
_local2 = _vc.activeVideoPlayerIndex;
_vc.activeVideoPlayerIndex = _vc.visibleVideoPlayerIndex;
if (_arg1 == SEEK_BAR){
seekBarListener(null);
} else {
if (_arg1 == VOLUME_BAR){
volumeBarListener(null);
};
};
stopHandleDrag(controls[_arg1]);
_vc.activeVideoPlayerIndex = _local2;
if (_arg1 == SEEK_BAR){
_vc._scrubFinish();
};
}
flvplayback_internal function setTwoButtonHolderSkin(_arg1:int, _arg2:int, _arg3:String, _arg4:int, _arg5:String):Sprite{
var _local6:Sprite;
var _local7:Sprite;
var _local8:ControlData;
_local7 = new Sprite();
_local8 = new ControlData(this, _local7, null, _arg1);
ctrlDataDict[_local7] = _local8;
skin_mc.addChild(_local7);
_local6 = setupButtonSkin(_arg2);
_local6.name = _arg3;
_local6.visible = true;
_local7.addChild(_local6);
_local6 = setupButtonSkin(_arg4);
_local6.name = _arg5;
_local6.visible = false;
_local7.addChild(_local6);
return (_local7);
}
public function set seekBarInterval(_arg1:Number):void{
if (_seekBarTimer.delay == _arg1){
return;
};
_seekBarTimer.delay = _arg1;
}
flvplayback_internal function layoutControl(_arg1:DisplayObject):void{
var _local2:ControlData;
var _local3:Rectangle;
var _local4:Sprite;
var _local5:Rectangle;
if (_arg1 == null){
return;
};
_local2 = ctrlDataDict[_arg1];
if (_local2 == null){
return;
};
if (_local2.avatar == null){
return;
};
_local3 = calcLayoutControl(_arg1);
_arg1.x = _local3.x;
_arg1.y = _local3.y;
_arg1.width = _local3.width;
_arg1.height = _local3.height;
switch (_local2.index){
case SEEK_BAR:
case VOLUME_BAR:
if (((!((_local2.hit_mc == null))) && ((_local2.hit_mc.parent == skin_mc)))){
_local4 = _local2.hit_mc;
_local5 = calcLayoutControl(_local4);
_local4.x = _local5.x;
_local4.y = _local5.y;
_local4.width = _local5.width;
_local4.height = _local5.height;
};
if (_local2.progress_mc != null){
if (isNaN(_progressPercent)){
_progressPercent = (_vc.isRTMP) ? 100 : 0;
};
positionBar(Sprite(_arg1), "progress", _progressPercent);
};
positionHandle(Sprite(_arg1));
break;
case BUFFERING_BAR:
positionMaskedFill(_arg1, 100);
break;
};
}
public function set fullScreenSkinDelay(_arg1:int):void{
_skinAutoHideMotionTimeout = _arg1;
}
flvplayback_internal function captureMouseEvent(_arg1:MouseEvent):void{
_arg1.stopPropagation();
}
flvplayback_internal function handleMouseUp(_arg1:MouseEvent):void{
var _local2:Sprite;
var _local3:ControlData;
_local2 = controls[mouseCaptureCtrl];
if (_local2 != null){
_local3 = ctrlDataDict[_local2];
_local3.state = (_local2.hitTestPoint(_arg1.stageX, _arg1.stageY, true)) ? OVER_STATE : NORMAL_STATE;
skinButtonControl(_local2);
switch (mouseCaptureCtrl){
case SEEK_BAR_HANDLE:
case SEEK_BAR_HIT:
handleRelease(SEEK_BAR);
break;
case VOLUME_BAR_HANDLE:
case VOLUME_BAR_HIT:
handleRelease(VOLUME_BAR);
break;
};
};
_arg1.currentTarget.removeEventListener(MouseEvent.MOUSE_DOWN, captureMouseEvent, true);
_arg1.currentTarget.removeEventListener(MouseEvent.MOUSE_OUT, captureMouseEvent, true);
_arg1.currentTarget.removeEventListener(MouseEvent.MOUSE_OVER, captureMouseEvent, true);
_arg1.currentTarget.removeEventListener(MouseEvent.MOUSE_UP, handleMouseUp);
_arg1.currentTarget.removeEventListener(MouseEvent.ROLL_OUT, captureMouseEvent, true);
_arg1.currentTarget.removeEventListener(MouseEvent.ROLL_OVER, captureMouseEvent, true);
}
public function set visible(_arg1:Boolean):void{
if (__visible == _arg1){
return;
};
__visible = _arg1;
if (!__visible){
skin_mc.visible = false;
} else {
setupSkinAutoHide(false);
};
}
public function get bufferingDelayInterval():Number{
return (_bufferingDelayTimer.delay);
}
public function set fullScreenBackgroundColor(_arg1:uint):void{
if (_fullScreenBgColor != _arg1){
_fullScreenBgColor = _arg1;
if (_vc){
};
};
}
public function get fullScreenTakeOver():Boolean{
return (_fullScreenTakeOver);
}
public function set skin(_arg1:String):void{
var _local2:String;
if (_arg1 == null){
removeSkin();
_skin = null;
_skinReady = true;
} else {
_local2 = String(_arg1);
if (_arg1 == _skin){
return;
};
removeSkin();
_skin = String(_arg1);
_skinReady = (_skin == "");
if (!_skinReady){
downloadSkin();
};
};
}
public function set volumeBarInterval(_arg1:Number):void{
if (_volumeBarTimer.delay == _arg1){
return;
};
_volumeBarTimer.delay = _arg1;
}
flvplayback_internal function setSkin(_arg1:int, _arg2:DisplayObject):void{
var _local3:Sprite;
var _local4:ControlData;
var _local5:String;
if (_arg1 >= NUM_CONTROLS){
return;
};
if (_arg1 < NUM_BUTTONS){
_local3 = setupButtonSkin(_arg1);
skin_mc.addChild(_local3);
_local4 = ctrlDataDict[_local3];
} else {
switch (_arg1){
case PLAY_PAUSE_BUTTON:
_local3 = setTwoButtonHolderSkin(_arg1, PLAY_BUTTON, "play_mc", PAUSE_BUTTON, "pause_mc");
_local4 = ctrlDataDict[_local3];
break;
case FULL_SCREEN_BUTTON:
_local3 = setTwoButtonHolderSkin(_arg1, FULL_SCREEN_ON_BUTTON, "on_mc", FULL_SCREEN_OFF_BUTTON, "off_mc");
_local4 = ctrlDataDict[_local3];
break;
case MUTE_BUTTON:
_local3 = setTwoButtonHolderSkin(_arg1, MUTE_ON_BUTTON, "on_mc", MUTE_OFF_BUTTON, "off_mc");
_local4 = ctrlDataDict[_local3];
break;
case SEEK_BAR:
case VOLUME_BAR:
_local5 = skinClassPrefixes[_arg1];
_local3 = Sprite(createSkin(skinTemplate, _local5));
if (_local3 != null){
skin_mc.addChild(_local3);
_local4 = new ControlData(this, _local3, null, _arg1);
ctrlDataDict[_local3] = _local4;
_local4.progress_mc = setupBarSkinPart(_local3, _arg2, skinTemplate, (_local5 + "Progress"), "progress_mc");
_local4.fullness_mc = setupBarSkinPart(_local3, _arg2, skinTemplate, (_local5 + "Fullness"), "fullness_mc");
_local4.hit_mc = Sprite(setupBarSkinPart(_local3, _arg2, skinTemplate, (_local5 + "Hit"), "hit_mc"));
_local4.handle_mc = Sprite(setupBarSkinPart(_local3, _arg2, skinTemplate, (_local5 + "Handle"), "handle_mc", true));
_local3.width = _arg2.width;
_local3.height = _arg2.height;
};
break;
case BUFFERING_BAR:
_local5 = skinClassPrefixes[_arg1];
_local3 = Sprite(createSkin(skinTemplate, _local5));
if (_local3 != null){
skin_mc.addChild(_local3);
_local4 = new ControlData(this, _local3, null, _arg1);
ctrlDataDict[_local3] = _local4;
_local4.fill_mc = setupBarSkinPart(_local3, _arg2, skinTemplate, (_local5 + "Fill"), "fill_mc");
_local3.width = _arg2.width;
_local3.height = _arg2.height;
};
break;
};
};
_local4.avatar = _arg2;
ctrlDataDict[_local3] = _local4;
delayedControls[_arg1] = _local3;
}
public function set bufferingBarHidesAndDisablesOthers(_arg1:Boolean):void{
_bufferingBarHides = _arg1;
}
flvplayback_internal function handleSoundEvent(_arg1:SoundEvent):void{
var _local2:Sprite;
var _local3:ControlData;
if (((_isMuted) && ((_arg1.soundTransform.volume > 0)))){
_isMuted = false;
setEnabledAndVisibleForState(MUTE_OFF_BUTTON, VideoState.PLAYING);
skinButtonControl(controls[MUTE_OFF_BUTTON]);
setEnabledAndVisibleForState(MUTE_ON_BUTTON, VideoState.PLAYING);
skinButtonControl(controls[MUTE_ON_BUTTON]);
};
_local2 = controls[VOLUME_BAR];
if (_local2 != null){
_local3 = ctrlDataDict[_local2];
_local3.percentage = ((_isMuted) ? cachedSoundLevel : _arg1.soundTransform.volume * 100);
if (_local3.percentage < 0){
_local3.percentage = 0;
} else {
if (_local3.percentage > 100){
_local3.percentage = 100;
};
};
positionHandle(_local2);
};
}
flvplayback_internal function stopHandleDrag(_arg1:Sprite):void{
var ctrlData:ControlData;
var handle:Sprite;
var ctrl = _arg1;
if (ctrl == null){
return;
};
ctrlData = ctrlDataDict[ctrl];
try {
if ((((ctrl["stopHandleDrag"] is Function)) && (ctrl["stopHandleDrag"]()))){
ctrlData.isDragging = false;
return;
};
} catch(re:ReferenceError) {
};
handle = ctrlData.handle_mc;
if (handle == null){
return;
};
handle.stopDrag();
ctrlData.isDragging = false;
}
public function set skinBackgroundAlpha(_arg1:Number):void{
if (borderAlpha != _arg1){
borderAlpha = _arg1;
borderColorTransform.alphaOffset = (0xFF * _arg1);
borderPrevRect = null;
layoutSkin();
};
}
public function getControl(_arg1:int):Sprite{
return (controls[_arg1]);
}
public function set volumeBarScrubTolerance(_arg1:Number):void{
_volumeBarScrubTolerance = _arg1;
}
flvplayback_internal function calcBarMargins(_arg1:DisplayObject, _arg2:String, _arg3:Boolean):void{
var ctrlData:ControlData;
var bar:DisplayObject;
var barData:ControlData;
var ctrl = _arg1;
var type = _arg2;
var symmetricMargins = _arg3;
if (ctrl == null){
return;
};
ctrlData = ctrlDataDict[ctrl];
bar = ctrlData[(type + "_mc")];
if (bar == null){
try {
bar = ctrl[(type + "_mc")];
} catch(re:ReferenceError) {
bar = null;
};
if (bar == null){
return;
};
ctrlData[(type + "_mc")] = bar;
};
barData = ctrlDataDict[bar];
if (barData == null){
barData = new ControlData(this, bar, ctrl, -1);
ctrlDataDict[bar] = barData;
};
barData.leftMargin = getNumberPropSafe(ctrl, (type + "LeftMargin"));
if (((isNaN(barData.leftMargin)) && ((bar.parent == ctrl.parent)))){
barData.leftMargin = (bar.x - ctrl.x);
};
barData.rightMargin = getNumberPropSafe(ctrl, (type + "RightMargin"));
if (isNaN(barData.rightMargin)){
if (symmetricMargins){
barData.rightMargin = barData.leftMargin;
} else {
if (bar.parent == ctrl.parent){
barData.rightMargin = (((ctrl.width - bar.width) - bar.x) + ctrl.x);
};
};
};
barData.topMargin = getNumberPropSafe(ctrl, (type + "TopMargin"));
if (((isNaN(barData.topMargin)) && ((bar.parent == ctrl.parent)))){
barData.topMargin = (bar.y - ctrl.y);
};
barData.bottomMargin = getNumberPropSafe(ctrl, (type + "BottomMargin"));
if (isNaN(barData.bottomMargin)){
if (symmetricMargins){
barData.bottomMargin = barData.topMargin;
} else {
if (bar.parent == ctrl.parent){
barData.bottomMargin = (((ctrl.height - bar.height) - bar.y) + ctrl.y);
};
};
};
barData.origX = getNumberPropSafe(ctrl, (type + "X"));
if (isNaN(barData.origX)){
if (bar.parent == ctrl.parent){
barData.origX = (bar.x - ctrl.x);
} else {
if (bar.parent == ctrl){
barData.origX = bar.x;
};
};
};
barData.origY = getNumberPropSafe(ctrl, (type + "Y"));
if (isNaN(barData.origY)){
if (bar.parent == ctrl.parent){
barData.origY = (bar.y - ctrl.y);
} else {
if (bar.parent == ctrl){
barData.origY = bar.y;
};
};
};
barData.origWidth = bar.width;
barData.origHeight = bar.height;
barData.origScaleX = bar.scaleX;
barData.origScaleY = bar.scaleY;
}
public function set skinBackgroundColor(_arg1:uint):void{
if (borderColor != _arg1){
borderColor = _arg1;
borderColorTransform.redOffset = ((borderColor >> 16) & 0xFF);
borderColorTransform.greenOffset = ((borderColor >> 8) & 0xFF);
borderColorTransform.blueOffset = (borderColor & 0xFF);
borderPrevRect = null;
layoutSkin();
};
}
flvplayback_internal function handleLoad(_arg1:Event):void{
var i:int;
var dispObj:DisplayObject;
var index:Number;
var e = _arg1;
try {
skin_mc = new Sprite();
if (e != null){
skinTemplate = Sprite(skinLoader.content);
};
layout_mc = skinTemplate;
customClips = new Array();
delayedControls = new Array();
i = 0;
while (i < layout_mc.numChildren) {
dispObj = layout_mc.getChildAt(i);
index = layoutNameToIndexMappings[dispObj.name];
if (!isNaN(index)){
setSkin(int(index), dispObj);
} else {
if (dispObj.name != "video_mc"){
setCustomClip(dispObj);
};
};
i = (i + 1);
};
skinLoadDelayCount = 0;
_vc.addEventListener(Event.ENTER_FRAME, finishLoad);
} catch(err:Error) {
_vc.skinError(err.message);
removeSkin();
};
}
flvplayback_internal function finishAddBufferingBar(_arg1:Event=null):void{
var _local2:Sprite;
if (_arg1 != null){
_arg1.currentTarget.removeEventListener(Event.ENTER_FRAME, finishAddBufferingBar);
};
_local2 = controls[BUFFERING_BAR];
calcBarMargins(_local2, "fill", true);
fixUpBar(_local2, "fill", _local2, "fill_mc");
positionMaskedFill(_local2, 100);
}
flvplayback_internal function handleButtonEvent(_arg1:MouseEvent):void{
var ctrlData:ControlData;
var topLevel:DisplayObject;
var e = _arg1;
ctrlData = ctrlDataDict[e.currentTarget];
switch (e.type){
case MouseEvent.ROLL_OVER:
ctrlData.state = OVER_STATE;
break;
case MouseEvent.ROLL_OUT:
ctrlData.state = NORMAL_STATE;
break;
case MouseEvent.MOUSE_DOWN:
ctrlData.state = DOWN_STATE;
mouseCaptureCtrl = ctrlData.index;
switch (mouseCaptureCtrl){
case SEEK_BAR_HANDLE:
case SEEK_BAR_HIT:
case VOLUME_BAR_HANDLE:
case VOLUME_BAR_HIT:
dispatchMessage(ctrlData.index);
break;
};
topLevel = _vc.stage;
try {
topLevel.addEventListener(MouseEvent.MOUSE_DOWN, captureMouseEvent, true);
} catch(se:SecurityError) {
topLevel = _vc.root;
topLevel.addEventListener(MouseEvent.MOUSE_DOWN, captureMouseEvent, true);
};
topLevel.addEventListener(MouseEvent.MOUSE_OUT, captureMouseEvent, true);
topLevel.addEventListener(MouseEvent.MOUSE_OVER, captureMouseEvent, true);
topLevel.addEventListener(MouseEvent.MOUSE_UP, handleMouseUp);
topLevel.addEventListener(MouseEvent.ROLL_OUT, captureMouseEvent, true);
topLevel.addEventListener(MouseEvent.ROLL_OVER, captureMouseEvent, true);
break;
case MouseEvent.CLICK:
switch (mouseCaptureCtrl){
case SEEK_BAR_HANDLE:
case SEEK_BAR_HIT:
case VOLUME_BAR_HANDLE:
case VOLUME_BAR_HIT:
break;
default:
dispatchMessage(ctrlData.index);
break;
};
return;
};
skinButtonControl(e.currentTarget);
}
flvplayback_internal function applySkinState(_arg1:ControlData, _arg2:DisplayObject):void{
if (_arg2 != _arg1.currentState_mc){
if (_arg1.currentState_mc != null){
_arg1.currentState_mc.visible = false;
};
_arg1.currentState_mc = _arg2;
_arg1.currentState_mc.visible = true;
};
}
flvplayback_internal function handleLoadErrorEvent(_arg1:ErrorEvent):void{
_skinReady = true;
_vc.skinError(_arg1.toString());
}
flvplayback_internal function addBarControl(_arg1:Sprite):void{
var _local2:ControlData;
_local2 = ctrlDataDict[_arg1];
_local2.isDragging = false;
_local2.percentage = 0;
if ((((_arg1.parent == skin_mc)) && (!((skin_mc == null))))){
finishAddBarControl(_arg1);
} else {
_arg1.addEventListener(Event.REMOVED_FROM_STAGE, cleanupHandle);
_arg1.addEventListener(Event.ENTER_FRAME, finishAddBarControl);
};
}
flvplayback_internal function handleEvent(_arg1:Event):void{
var e = _arg1;
switch (e.type){
case Event.ADDED_TO_STAGE:
_fullScreen = false;
if (_vc.stage != null){
try {
_fullScreen = (_vc.stage.displayState == StageDisplayState.FULL_SCREEN);
_vc.stage.addEventListener(FullScreenEvent.FULL_SCREEN, handleFullScreenEvent);
} catch(se:SecurityError) {
};
};
setEnabledAndVisibleForState(FULL_SCREEN_OFF_BUTTON, VideoState.PLAYING);
skinButtonControl(controls[FULL_SCREEN_OFF_BUTTON]);
setEnabledAndVisibleForState(FULL_SCREEN_ON_BUTTON, VideoState.PLAYING);
skinButtonControl(controls[FULL_SCREEN_ON_BUTTON]);
if (((_fullScreen) && (_fullScreenTakeOver))){
enterFullScreenTakeOver();
} else {
if (!_fullScreen){
exitFullScreenTakeOver();
};
};
layoutSkin();
setupSkinAutoHide(false);
break;
};
}
flvplayback_internal function skinButtonControl(_arg1:Object):void{
var ctrl:Sprite;
var ctrlData:ControlData;
var e:Event;
var ctrlOrEvent = _arg1;
if (ctrlOrEvent == null){
return;
};
if ((ctrlOrEvent is Event)){
e = Event(ctrlOrEvent);
ctrl = Sprite(e.currentTarget);
ctrl.removeEventListener(Event.ENTER_FRAME, skinButtonControl);
} else {
ctrl = Sprite(ctrlOrEvent);
};
ctrlData = ctrlDataDict[ctrl];
if (ctrlData == null){
return;
};
try {
if (ctrl["placeholder_mc"] != undefined){
ctrl.removeChild(ctrl["placeholder_mc"]);
ctrl["placeholder_mc"] = null;
};
} catch(re:ReferenceError) {
};
if (ctrlData.state_mc == null){
ctrlData.state_mc = new Array();
};
if (ctrlData.state_mc[NORMAL_STATE] == undefined){
ctrlData.state_mc[NORMAL_STATE] = setupButtonSkinState(ctrl, ctrl, buttonSkinLinkageIDs[NORMAL_STATE], null);
};
if (((ctrlData.enabled) && (_controlsEnabled))){
if (ctrlData.state_mc[ctrlData.state] == undefined){
ctrlData.state_mc[ctrlData.state] = setupButtonSkinState(ctrl, ctrl, buttonSkinLinkageIDs[ctrlData.state], ctrlData.state_mc[NORMAL_STATE]);
};
if (ctrlData.state_mc[ctrlData.state] != ctrlData.currentState_mc){
if (ctrlData.currentState_mc != null){
ctrlData.currentState_mc.visible = false;
};
ctrlData.currentState_mc = ctrlData.state_mc[ctrlData.state];
ctrlData.currentState_mc.visible = true;
};
applySkinState(ctrlData, ctrlData.state_mc[ctrlData.state]);
} else {
ctrlData.state = NORMAL_STATE;
if (ctrlData.disabled_mc == null){
ctrlData.disabled_mc = setupButtonSkinState(ctrl, ctrl, "disabledLinkageID", ctrlData.state_mc[NORMAL_STATE]);
};
applySkinState(ctrlData, ctrlData.disabled_mc);
};
}
public function set controlsEnabled(_arg1:Boolean):void{
var _local2:int;
if (_controlsEnabled == _arg1){
return;
};
_controlsEnabled = _arg1;
_local2 = 0;
while (_local2 < NUM_BUTTONS) {
skinButtonControl(controls[_local2]);
_local2++;
};
}
flvplayback_internal function setupSkinAutoHide(_arg1:Boolean):void{
if (((_skinAutoHide) && (!((skin_mc == null))))){
skinAutoHideHitTest(null, _arg1);
_skinAutoHideTimer.start();
} else {
if (skin_mc != null){
if (((((((_arg1) && ((_skinFadingMaxTime > 0)))) && (((!(skin_mc.visible)) || ((skin_mc.alpha < 1)))))) && (__visible))){
_skinFadingTimer.stop();
_skinFadeStartTime = getTimer();
_skinFadingIn = true;
if (skin_mc.alpha == 1){
skin_mc.alpha = 0;
};
_skinFadingTimer.start();
} else {
if (_skinFadingMaxTime <= 0){
_skinFadingTimer.stop();
skin_mc.alpha = 1;
};
};
skin_mc.visible = __visible;
};
_skinAutoHideTimer.stop();
};
}
flvplayback_internal function finishAddBarControl(_arg1:Object):void{
var ctrl:Sprite;
var ctrlData:ControlData;
var e:Event;
var ctrlOrEvent = _arg1;
if (ctrlOrEvent == null){
return;
};
if ((ctrlOrEvent is Event)){
e = Event(ctrlOrEvent);
ctrl = Sprite(e.currentTarget);
ctrl.removeEventListener(Event.ENTER_FRAME, finishAddBarControl);
} else {
ctrl = Sprite(ctrlOrEvent);
};
ctrlData = ctrlDataDict[ctrl];
try {
if ((ctrl["addBarControl"] is Function)){
var _local3 = ctrl;
_local3["addBarControl"]();
};
} catch(re:ReferenceError) {
};
ctrlData.origWidth = ctrl.width;
ctrlData.origHeight = ctrl.height;
fixUpBar(ctrl, "progress", ctrl, "progress_mc");
calcBarMargins(ctrl, "progress", false);
if (ctrlData.progress_mc != null){
fixUpBar(ctrl, "progressBarFill", ctrlData.progress_mc, "fill_mc");
calcBarMargins(ctrlData.progress_mc, "fill", false);
calcBarMargins(ctrlData.progress_mc, "mask", false);
if (isNaN(_progressPercent)){
_progressPercent = (_vc.isRTMP) ? 100 : 0;
};
positionBar(ctrl, "progress", _progressPercent);
};
fixUpBar(ctrl, "fullness", ctrl, "fullness_mc");
calcBarMargins(ctrl, "fullness", false);
if (ctrlData.fullness_mc != null){
fixUpBar(ctrl, "fullnessBarFill", ctrlData.fullness_mc, "fill_mc");
calcBarMargins(ctrlData.fullness_mc, "fill", false);
calcBarMargins(ctrlData.fullness_mc, "mask", false);
};
fixUpBar(ctrl, "hit", ctrl, "hit_mc");
fixUpBar(ctrl, "handle", ctrl, "handle_mc");
calcBarMargins(ctrl, "handle", true);
switch (ctrlData.index){
case SEEK_BAR:
setControl(SEEK_BAR_HANDLE, ctrlData.handle_mc);
if (ctrlData.hit_mc != null){
setControl(SEEK_BAR_HIT, ctrlData.hit_mc);
};
break;
case VOLUME_BAR:
setControl(VOLUME_BAR_HANDLE, ctrlData.handle_mc);
if (ctrlData.hit_mc != null){
setControl(VOLUME_BAR_HIT, ctrlData.hit_mc);
};
break;
};
positionHandle(ctrl);
}
public function get skin():String{
return (_skin);
}
public function get fullScreenBackgroundColor():uint{
return (_fullScreenBgColor);
}
flvplayback_internal function startHandleDrag(_arg1:Sprite):void{
var ctrlData:ControlData;
var handle:Sprite;
var handleData:ControlData;
var theY:Number;
var theWidth:Number;
var bounds:Rectangle;
var ctrl = _arg1;
if (ctrl == null){
return;
};
ctrlData = ctrlDataDict[ctrl];
try {
if ((((ctrl["startHandleDrag"] is Function)) && (ctrl["startHandleDrag"]()))){
ctrlData.isDragging = true;
return;
};
} catch(re:ReferenceError) {
};
handle = ctrlData.handle_mc;
if (handle == null){
return;
};
handleData = ctrlDataDict[handle];
theY = (ctrl.y + handleData.origY);
theWidth = (isNaN(ctrlData.origWidth)) ? ctrl.width : ctrlData.origWidth;
bounds = new Rectangle((ctrl.x + handleData.leftMargin), theY, (theWidth - handleData.rightMargin), 0);
handle.startDrag(false, bounds);
ctrlData.isDragging = true;
}
flvplayback_internal function setupBarSkinPart(_arg1:Sprite, _arg2:DisplayObject, _arg3:Sprite, _arg4:String, _arg5:String, _arg6:Boolean=false):DisplayObject{
var part:DisplayObject;
var partAvatar:DisplayObject;
var ctrlData:ControlData;
var partData:ControlData;
var ctrl = _arg1;
var avatar = _arg2;
var definitionHolder = _arg3;
var skinName = _arg4;
var partName = _arg5;
var required = _arg6;
try {
part = ctrl[partName];
} catch(re:ReferenceError) {
part = null;
};
if (part == null){
try {
part = createSkin(definitionHolder, skinName);
} catch(ve:VideoError) {
if (required){
throw (ve);
};
};
if (part != null){
skin_mc.addChild(part);
part.x = ctrl.x;
part.y = ctrl.y;
partAvatar = layout_mc.getChildByName((skinName + "_mc"));
if (partAvatar != null){
if (partName == "hit_mc"){
ctrlData = ctrlDataDict[ctrl];
partData = new ControlData(this, part, controls[ctrlData.index], -1);
partData.avatar = partAvatar;
ctrlDataDict[part] = partData;
} else {
part.x = (part.x + (partAvatar.x - avatar.x));
part.y = (part.y + (partAvatar.y - avatar.y));
part.width = partAvatar.width;
part.height = partAvatar.height;
};
};
};
};
if (((required) && ((part == null)))){
throw (new VideoError(VideoError.MISSING_SKIN_STYLE, skinName));
};
return (part);
}
public function get skinBackgroundAlpha():Number{
return (borderAlpha);
}
public function get volumeBarScrubTolerance():Number{
return (_volumeBarScrubTolerance);
}
public function get skinBackgroundColor():uint{
return (borderColor);
}
public function get controlsEnabled():Boolean{
return (_controlsEnabled);
}
flvplayback_internal function handleIVPEvent(_arg1:IVPEvent):void{
var _local2:uint;
var _local3:int;
var _local4:VideoEvent;
var _local5:Sprite;
var _local6:ControlData;
var _local7:VideoProgressEvent;
var _local8:VideoPlayerState;
var _local9:Number;
var _local10:Number;
var _local11:Number;
if (_arg1.vp != _vc.visibleVideoPlayerIndex){
return;
};
_local2 = _vc.activeVideoPlayerIndex;
_vc.activeVideoPlayerIndex = _vc.visibleVideoPlayerIndex;
switch (_arg1.type){
case VideoEvent.STATE_CHANGE:
_local4 = VideoEvent(_arg1);
if (_local4.state == VideoState.BUFFERING){
if (!_bufferingOn){
_bufferingDelayTimer.reset();
_bufferingDelayTimer.start();
};
} else {
_bufferingDelayTimer.reset();
_bufferingOn = false;
};
if (_local4.state == VideoState.LOADING){
_progressPercent = (_vc.getVideoPlayer(_arg1.vp).isRTMP) ? 100 : 0;
_local3 = SEEK_BAR;
while (_local3 <= VOLUME_BAR) {
_local5 = controls[_local3];
if (controls[_local3] == null){
} else {
_local6 = ctrlDataDict[_local5];
if (_local6.progress_mc != null){
positionBar(_local5, "progress", _progressPercent);
};
};
_local3++;
};
};
_local3 = 0;
while (_local3 < NUM_CONTROLS) {
if (controls[_local3] == undefined){
} else {
setEnabledAndVisibleForState(_local3, _local4.state);
if (_local3 < NUM_BUTTONS){
skinButtonControl(controls[_local3]);
};
};
_local3++;
};
break;
case VideoEvent.READY:
case MetadataEvent.METADATA_RECEIVED:
_local3 = 0;
while (_local3 < NUM_CONTROLS) {
if (controls[_local3] == undefined){
} else {
setEnabledAndVisibleForState(_local3, _vc.state);
if (_local3 < NUM_BUTTONS){
skinButtonControl(controls[_local3]);
};
};
_local3++;
};
if (_vc.getVideoPlayer(_arg1.vp).isRTMP){
_progressPercent = 100;
_local3 = SEEK_BAR;
while (_local3 <= VOLUME_BAR) {
_local5 = controls[_local3];
if (_local5 == null){
} else {
_local6 = ctrlDataDict[_local5];
if (_local6.progress_mc != null){
positionBar(_local5, "progress", _progressPercent);
};
};
_local3++;
};
};
break;
case VideoEvent.PLAYHEAD_UPDATE:
if (((((((!((controls[SEEK_BAR] == undefined))) && (!(_vc.isLive)))) && (!(isNaN(_vc.totalTime))))) && (!((_vc.getVideoPlayer(_vc.visibleVideoPlayerIndex).state == VideoState.SEEKING))))){
_local4 = VideoEvent(_arg1);
_local10 = ((_local4.playheadTime / _vc.totalTime) * 100);
if (_local10 < 0){
_local10 = 0;
} else {
if (_local10 > 100){
_local10 = 100;
};
};
_local5 = controls[SEEK_BAR];
_local6 = ctrlDataDict[_local5];
_local6.percentage = _local10;
positionHandle(_local5);
};
break;
case VideoProgressEvent.PROGRESS:
_local7 = VideoProgressEvent(_arg1);
_progressPercent = ((_local7.bytesTotal)<=0) ? 100 : ((_local7.bytesLoaded / _local7.bytesTotal) * 100);
_local8 = _vc.videoPlayerStates[_arg1.vp];
_local9 = _local8.minProgressPercent;
if (((!(isNaN(_local9))) && ((_local9 > _progressPercent)))){
_progressPercent = _local9;
};
if (!isNaN(_vc.totalTime)){
_local11 = ((_vc.playheadTime / _vc.totalTime) * 100);
if (_local11 > _progressPercent){
_progressPercent = _local11;
_local8.minProgressPercent = _progressPercent;
};
};
_local3 = SEEK_BAR;
while (_local3 <= VOLUME_BAR) {
_local5 = controls[_local3];
if (_local5 == null){
} else {
_local6 = ctrlDataDict[_local5];
if (_local6.progress_mc != null){
positionBar(_local5, "progress", _progressPercent);
};
};
_local3++;
};
break;
};
_vc.activeVideoPlayerIndex = _local2;
}
flvplayback_internal function setupButtonSkinState(_arg1:Sprite, _arg2:Sprite, _arg3:String, _arg4:DisplayObject=null):DisplayObject{
var stateSkin:DisplayObject;
var ctrl = _arg1;
var definitionHolder = _arg2;
var skinName = _arg3;
var defaultSkin = _arg4;
try {
stateSkin = createSkin(definitionHolder, skinName);
} catch(ve:VideoError) {
if (defaultSkin != null){
stateSkin = null;
} else {
throw (ve);
};
};
if (stateSkin != null){
stateSkin.visible = false;
ctrl.addChild(stateSkin);
} else {
if (defaultSkin != null){
stateSkin = defaultSkin;
};
};
return (stateSkin);
}
flvplayback_internal function layoutSkin():void{
var video_mc:DisplayObject;
var i:int;
var borderRect:Rectangle;
var forceSkinAutoHide:Boolean;
var minWidth:Number;
var vidWidth:Number;
var minHeight:Number;
var vidHeight:Number;
if (layout_mc == null){
return;
};
if (skinLoadDelayCount < 2){
return;
};
video_mc = layout_mc["video_mc"];
if (video_mc == null){
throw (new Error("No layout_mc.video_mc"));
};
placeholderLeft = video_mc.x;
placeholderRight = (video_mc.x + video_mc.width);
placeholderTop = video_mc.y;
placeholderBottom = (video_mc.y + video_mc.height);
videoLeft = (_vc.x - _vc.registrationX);
videoRight = (videoLeft + _vc.width);
videoTop = (_vc.y - _vc.registrationY);
videoBottom = (videoTop + _vc.height);
if (((((_fullScreen) && (_fullScreenTakeOver))) && (!((border_mc == null))))){
borderRect = calcLayoutControl(border_mc);
forceSkinAutoHide = false;
if ((((borderRect.width > 0)) && ((borderRect.height > 0)))){
if (borderRect.x < 0){
placeholderLeft = (placeholderLeft + (videoLeft - borderRect.x));
forceSkinAutoHide = true;
};
if ((borderRect.x + borderRect.width) > _vc.registrationWidth){
placeholderRight = (placeholderRight + ((borderRect.x + borderRect.width) - videoRight));
forceSkinAutoHide = true;
};
if (borderRect.y < 0){
placeholderTop = (placeholderTop + (videoTop - borderRect.y));
forceSkinAutoHide = true;
};
if ((borderRect.y + borderRect.height) > _vc.registrationHeight){
placeholderBottom = (placeholderBottom + ((borderRect.y + borderRect.height) - videoBottom));
forceSkinAutoHide = true;
};
if (forceSkinAutoHide){
_skinAutoHide = true;
setupSkinAutoHide(true);
};
};
};
try {
if (!isNaN(layout_mc["minWidth"])){
minWidth = layout_mc["minWidth"];
vidWidth = (videoRight - videoLeft);
if ((((minWidth > 0)) && ((minWidth > vidWidth)))){
videoLeft = (videoLeft - ((minWidth - vidWidth) / 2));
videoRight = (minWidth + videoLeft);
};
};
} catch(re1:ReferenceError) {
};
try {
if (!isNaN(layout_mc["minHeight"])){
minHeight = layout_mc["minHeight"];
vidHeight = (videoBottom - videoTop);
if ((((minHeight > 0)) && ((minHeight > vidHeight)))){
videoTop = (videoTop - ((minHeight - vidHeight) / 2));
videoBottom = (minHeight + videoTop);
};
};
} catch(re2:ReferenceError) {
};
i = 0;
while (i < customClips.length) {
layoutControl(customClips[i]);
if (customClips[i] == border_mc){
bitmapCopyBorder();
};
i = (i + 1);
};
i = 0;
while (i < NUM_CONTROLS) {
layoutControl(controls[i]);
i = (i + 1);
};
}
public function set bufferingDelayInterval(_arg1:Number):void{
if (_bufferingDelayTimer.delay == _arg1){
return;
};
_bufferingDelayTimer.delay = _arg1;
}
flvplayback_internal function setEnabledAndVisibleForState(_arg1:int, _arg2:String):void{
var _local3:int;
var _local4:String;
var _local5:Sprite;
var _local6:ControlData;
var _local7:Boolean;
var _local8:ControlData;
var _local9:ControlData;
var _local10:ControlData;
var _local11:ControlData;
_local3 = _vc.activeVideoPlayerIndex;
_vc.activeVideoPlayerIndex = _vc.visibleVideoPlayerIndex;
_local4 = _arg2;
if ((((_local4 == VideoState.BUFFERING)) && (!(_bufferingOn)))){
_local4 = VideoState.PLAYING;
};
_local5 = controls[_arg1];
if (_local5 == null){
return;
};
_local6 = ctrlDataDict[_local5];
if (_local6 == null){
return;
};
switch (_arg1){
case VOLUME_BAR:
case VOLUME_BAR_HANDLE:
case VOLUME_BAR_HIT:
_local6.enabled = true;
break;
case FULL_SCREEN_ON_BUTTON:
_local6.enabled = !(_fullScreen);
if (controls[FULL_SCREEN_BUTTON] != undefined){
_local5.visible = _local6.enabled;
};
break;
case FULL_SCREEN_OFF_BUTTON:
_local6.enabled = _fullScreen;
if (controls[FULL_SCREEN_BUTTON] != undefined){
_local5.visible = _local6.enabled;
};
break;
case MUTE_ON_BUTTON:
_local6.enabled = !(_isMuted);
if (controls[MUTE_BUTTON] != undefined){
_local5.visible = _local6.enabled;
};
break;
case MUTE_OFF_BUTTON:
_local6.enabled = _isMuted;
if (controls[MUTE_BUTTON] != undefined){
_local5.visible = _local6.enabled;
};
break;
default:
switch (_local4){
case VideoState.LOADING:
case VideoState.CONNECTION_ERROR:
_local6.enabled = false;
break;
case VideoState.DISCONNECTED:
_local6.enabled = ((!((_vc.source == null))) && (!((_vc.source == ""))));
break;
case VideoState.SEEKING:
break;
default:
_local6.enabled = true;
break;
};
break;
};
switch (_arg1){
case SEEK_BAR:
switch (_local4){
case VideoState.STOPPED:
case VideoState.PLAYING:
case VideoState.PAUSED:
case VideoState.REWINDING:
case VideoState.SEEKING:
_local6.enabled = true;
break;
case VideoState.BUFFERING:
_local6.enabled = ((!(_bufferingBarHides)) || ((controls[BUFFERING_BAR] == undefined)));
break;
default:
_local6.enabled = false;
break;
};
if (_local6.enabled){
_local6.enabled = !(isNaN(_vc.totalTime));
};
if (_local6.handle_mc != null){
_local8 = ctrlDataDict[_local6.handle_mc];
_local8.enabled = _local6.enabled;
_local6.handle_mc.visible = _local8.enabled;
};
if (_local6.hit_mc != null){
_local9 = ctrlDataDict[_local6.hit_mc];
_local9.enabled = _local6.enabled;
_local6.hit_mc.visible = _local9.enabled;
};
_local7 = ((((((!(_bufferingBarHides)) || (_local6.enabled))) || ((controls[BUFFERING_BAR] == undefined)))) || (!(controls[BUFFERING_BAR].visible)));
_local5.visible = _local7;
if (_local6.progress_mc != null){
_local6.progress_mc.visible = _local7;
_local10 = ctrlDataDict[_local6.progress_mc];
if (_local10.fill_mc != null){
_local10.fill_mc.visible = _local7;
};
};
if (_local6.fullness_mc != null){
_local6.fullness_mc.visible = _local7;
_local11 = ctrlDataDict[_local6.fullness_mc];
if (_local11.fill_mc != null){
_local11.fill_mc.visible = _local7;
};
};
break;
case BUFFERING_BAR:
switch (_local4){
case VideoState.STOPPED:
case VideoState.PLAYING:
case VideoState.PAUSED:
case VideoState.REWINDING:
case VideoState.SEEKING:
_local6.enabled = false;
break;
default:
_local6.enabled = true;
break;
};
_local5.visible = _local6.enabled;
if (_local6.fill_mc != null){
_local6.fill_mc.visible = _local6.enabled;
};
break;
case PAUSE_BUTTON:
switch (_local4){
case VideoState.DISCONNECTED:
case VideoState.STOPPED:
case VideoState.PAUSED:
case VideoState.REWINDING:
_local6.enabled = false;
break;
case VideoState.PLAYING:
_local6.enabled = true;
break;
case VideoState.BUFFERING:
_local6.enabled = ((!(_bufferingBarHides)) || ((controls[BUFFERING_BAR] == undefined)));
break;
};
if (controls[PLAY_PAUSE_BUTTON] != undefined){
_local5.visible = _local6.enabled;
};
break;
case PLAY_BUTTON:
switch (_local4){
case VideoState.PLAYING:
_local6.enabled = false;
break;
case VideoState.STOPPED:
case VideoState.PAUSED:
_local6.enabled = true;
break;
case VideoState.BUFFERING:
_local6.enabled = ((!(_bufferingBarHides)) || ((controls[BUFFERING_BAR] == undefined)));
break;
};
if (controls[PLAY_PAUSE_BUTTON] != undefined){
_local5.visible = !(controls[PAUSE_BUTTON].visible);
};
break;
case STOP_BUTTON:
switch (_local4){
case VideoState.DISCONNECTED:
case VideoState.STOPPED:
_local6.enabled = false;
break;
case VideoState.PAUSED:
case VideoState.PLAYING:
case VideoState.BUFFERING:
_local6.enabled = true;
break;
};
break;
case BACK_BUTTON:
case FORWARD_BUTTON:
switch (_local4){
case VideoState.BUFFERING:
_local6.enabled = ((!(_bufferingBarHides)) || ((controls[BUFFERING_BAR] == undefined)));
break;
};
};
_local5.mouseEnabled = _local6.enabled;
_vc.activeVideoPlayerIndex = _local3;
}
flvplayback_internal function cleanupHandle(_arg1:Object):void{
var e:Event;
var ctrl:Sprite;
var ctrlData:ControlData;
var ctrlOrEvent = _arg1;
try {
if ((ctrlOrEvent is Event)){
e = Event(ctrlOrEvent);
};
ctrl = ((e == null)) ? Sprite(ctrlOrEvent) : Sprite(e.currentTarget);
ctrlData = ctrlDataDict[ctrl];
if ((((ctrlData == null)) || ((e == null)))){
ctrl.removeEventListener(Event.REMOVED_FROM_STAGE, cleanupHandle, false);
if (ctrlData == null){
return;
};
};
ctrl.removeEventListener(Event.ENTER_FRAME, finishAddBarControl);
if (ctrlData.handle_mc != null){
if (ctrlData.handle_mc.parent != null){
ctrlData.handle_mc.parent.removeChild(ctrlData.handle_mc);
};
delete ctrlDataDict[ctrlData.handle_mc];
ctrlData.handle_mc = null;
};
if (ctrlData.hit_mc != null){
if (ctrlData.hit_mc.parent != null){
ctrlData.hit_mc.parent.removeChild(ctrlData.hit_mc);
};
delete ctrlDataDict[ctrlData.hit_mc];
ctrlData.hit_mc = null;
};
} catch(err:Error) {
};
}
flvplayback_internal function enterFullScreenTakeOver():void{
var fullScreenBG:Sprite;
if (((!(_fullScreen)) || (!((cacheStageAlign == null))))){
return;
};
_vc.removeEventListener(Event.ADDED_TO_STAGE, handleEvent);
try {
cacheStageAlign = _vc.stage.align;
cacheStageScaleMode = _vc.stage.scaleMode;
cacheFLVPlaybackParent = _vc.parent;
cacheFLVPlaybackIndex = _vc.parent.getChildIndex(_vc);
cacheFLVPlaybackLocation = new Rectangle(_vc.registrationX, _vc.registrationY, _vc.registrationWidth, _vc.registrationHeight);
_vc.stage.align = StageAlign.TOP_LEFT;
_vc.stage.scaleMode = StageScaleMode.NO_SCALE;
if (_vc.stage != _vc.parent){
_vc.stage.addChild(_vc);
} else {
_vc.stage.setChildIndex(_vc, (_vc.stage.numChildren - 1));
};
_vc.registrationX = 0;
_vc.registrationY = 0;
_vc.setSize(_vc.stage.stageWidth, _vc.stage.stageHeight);
fullScreenBG = Sprite(_vc.getChildByName("fullScreenBG"));
if (fullScreenBG == null){
fullScreenBG = new Sprite();
fullScreenBG.name = "fullScreenBG";
_vc.addChildAt(fullScreenBG, 0);
} else {
_vc.setChildIndex(fullScreenBG, 0);
};
fullScreenBG.graphics.beginFill(_fullScreenBgColor);
fullScreenBG.graphics.drawRect(0, 0, _vc.stage.stageWidth, _vc.stage.stageHeight);
} catch(err:Error) {
};
_vc.addEventListener(Event.ADDED_TO_STAGE, handleEvent);
}
public function set seekBarScrubTolerance(_arg1:Number):void{
_seekBarScrubTolerance = _arg1;
}
public function set fullScreenTakeOver(_arg1:Boolean):void{
if (_fullScreenTakeOver != _arg1){
_fullScreenTakeOver = _arg1;
if (_fullScreenTakeOver){
enterFullScreenTakeOver();
} else {
exitFullScreenTakeOver();
};
};
}
public function get seekBarScrubTolerance():Number{
return (_seekBarScrubTolerance);
}
flvplayback_internal static function getBooleanPropSafe(_arg1:Object, _arg2:String):Boolean{
var boolProp:*;
var obj = _arg1;
var propName = _arg2;
try {
boolProp = obj[propName];
return (Boolean(boolProp));
} catch(re:ReferenceError) {
};
return (false);
}
flvplayback_internal static function initLayoutNameToIndexMappings():void{
var _local1:int;
layoutNameToIndexMappings = new Object();
_local1 = 0;
while (_local1 < layoutNameArray.length) {
if (layoutNameArray[_local1] != null){
layoutNameToIndexMappings[layoutNameArray[_local1]] = _local1;
};
_local1++;
};
}
flvplayback_internal static function getNumberPropSafe(_arg1:Object, _arg2:String):Number{
var numProp:*;
var obj = _arg1;
var propName = _arg2;
try {
numProp = obj[propName];
return (Number(numProp));
} catch(re:ReferenceError) {
};
return (NaN);
}
}
}//package fl.video
Section 100
//VideoAlign (fl.video.VideoAlign)
package fl.video {
public final class VideoAlign {
public static const CENTER:String = "center";
public static const LEFT:String = "left";
public static const BOTTOM_RIGHT:String = "bottomRight";
public static const BOTTOM:String = "bottom";
public static const TOP_LEFT:String = "topLeft";
public static const TOP_RIGHT:String = "topRight";
public static const TOP:String = "top";
public static const BOTTOM_LEFT:String = "bottomLeft";
public static const RIGHT:String = "right";
}
}//package fl.video
Section 101
//VideoError (fl.video.VideoError)
package fl.video {
public class VideoError extends Error {
private var _code:uint;
public static const INVALID_SOURCE:uint = 1004;
flvplayback_internal static const ERROR_MSG:Array = ["Unable to make connection to server or to find FLV on server", "No matching cue point found", "Illegal cue point", "Invalid seek", "Invalid source", "Invalid xml", "No bitrate match, must be no default flv", "Cannot delete default VideoPlayer", "VideoPlayer.iNCManagerClass has not been set or its value is invalid", "Null url parameter sent to load()", "Skin is missing a required style definition or its value is invalid", "Unsupported property"];
public static const NULL_URL_LOAD:uint = 1009;
public static const INVALID_XML:uint = 1005;
flvplayback_internal static const BASE_ERROR_CODE:uint = 1000;
public static const DELETE_DEFAULT_PLAYER:uint = 1007;
public static const SHORT_VERSION:String = "2.0";
public static const UNSUPPORTED_PROPERTY:uint = 1011;
public static const ILLEGAL_CUE_POINT:uint = 1002;
public static const INVALID_SEEK:uint = 1003;
public static const NO_CONNECTION:uint = 1000;
public static const MISSING_SKIN_STYLE:uint = 1010;
public static const INCMANAGER_CLASS_UNSET:uint = 1008;
public static const NO_BITRATE_MATCH:uint = 1006;
public static const VERSION:String = "2.0.0.37";
public function VideoError(_arg1:uint, _arg2:String=null){
super((((("" + _arg1) + ": ") + ERROR_MSG[(_arg1 - BASE_ERROR_CODE)]) + ((_arg2)==null) ? "" : (": " + _arg2)));
name = "VideoError";
_code = _arg1;
}
public function get code():uint{
return (_code);
}
}
}//package fl.video
Section 102
//VideoEvent (fl.video.VideoEvent)
package fl.video {
import flash.events.*;
public class VideoEvent extends Event implements IVPEvent {
private var _vp:uint;
private var _playheadTime:Number;
private var _state:String;
public static const FAST_FORWARD:String = "fastForward";
public static const READY:String = "ready";
public static const SKIN_LOADED:String = "skinLoaded";
public static const SCRUB_FINISH:String = "scrubFinish";
public static const BUFFERING_STATE_ENTERED:String = "bufferingStateEntered";
public static const STOPPED_STATE_ENTERED:String = "stoppedStateEntered";
public static const AUTO_REWOUND:String = "autoRewound";
public static const SCRUB_START:String = "scrubStart";
public static const PLAYHEAD_UPDATE:String = "playheadUpdate";
public static const SEEKED:String = "seeked";
public static const PLAYING_STATE_ENTERED:String = "playingStateEntered";
public static const CLOSE:String = "close";
public static const PAUSED_STATE_ENTERED:String = "pausedStateEntered";
public static const COMPLETE:String = "complete";
public static const REWIND:String = "rewind";
public static const STATE_CHANGE:String = "stateChange";
public function VideoEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:String=null, _arg5:Number=NaN, _arg6:uint=0){
super(_arg1, _arg2, _arg3);
_state = _arg4;
_playheadTime = _arg5;
_vp = _arg6;
}
public function set playheadTime(_arg1:Number):void{
_playheadTime = _arg1;
}
public function get playheadTime():Number{
return (_playheadTime);
}
public function get state():String{
return (_state);
}
public function get vp():uint{
return (_vp);
}
override public function clone():Event{
return (new VideoEvent(type, bubbles, cancelable, state, playheadTime, vp));
}
public function set state(_arg1:String):void{
_state = _arg1;
}
public function set vp(_arg1:uint):void{
_vp = _arg1;
}
}
}//package fl.video
Section 103
//VideoPlayer (fl.video.VideoPlayer)
package fl.video {
import flash.net.*;
import flash.events.*;
import flash.geom.*;
import flash.media.*;
import flash.utils.*;
public class VideoPlayer extends Video {
protected var _align:String;
protected var _registrationWidth:Number;
flvplayback_internal var _updateProgressTimer:Timer;
flvplayback_internal var _atEndCheckPlayhead:Number;
flvplayback_internal var _hiddenForResize:Boolean;
flvplayback_internal var startProgressTime:Number;
protected var _volume:Number;
flvplayback_internal var _invalidSeekTime:Boolean;
flvplayback_internal var _readyDispatched:Boolean;
flvplayback_internal var lastUpdateTimeStuckCount:Number;
protected var _ns:NetStream;
protected var _isLive:Boolean;
flvplayback_internal var _bufferState:String;
protected var _streamLength:Number;
flvplayback_internal var _rtmpDoSeekTimer:Timer;
protected var _contentPath:String;
flvplayback_internal var lastUpdateTimeStuckCountMax:int;// = 5
protected var _metadata:Object;
protected var __visible:Boolean;
flvplayback_internal var autoResizeMetadataDelayMax:Number;// = 5
protected var _scaleMode:String;
flvplayback_internal var _lastUpdateTime:Number;
flvplayback_internal var _sawPlayStop:Boolean;
flvplayback_internal var _atEnd:Boolean;
flvplayback_internal var _sawSeekNotify:Boolean;
flvplayback_internal var _idleTimeoutTimer:Timer;
flvplayback_internal var _prevVideoWidth:int;
protected var _registrationX:Number;
protected var _registrationY:Number;
protected var _bufferTime:Number;
flvplayback_internal var _cachedState:String;
flvplayback_internal var totalDownloadTime:Number;
flvplayback_internal var _cachedPlayheadTime:Number;
protected var _autoPlay:Boolean;
protected var _autoRewind:Boolean;
flvplayback_internal var _invalidSeekRecovery:Boolean;
flvplayback_internal var _hiddenRewindPlayheadTime:Number;
flvplayback_internal var _prevVideoHeight:int;
protected var _ncMgr:INCManager;
protected var _soundTransform:SoundTransform;
flvplayback_internal var _httpDoSeekCount:Number;
flvplayback_internal var oldRegistrationBounds:Rectangle;
flvplayback_internal var _cmdQueue:Array;
flvplayback_internal var _updateTimeTimer:Timer;
flvplayback_internal var httpDoSeekMaxCount:Number;// = 4
flvplayback_internal var _startingPlay:Boolean;
flvplayback_internal var baselineProgressTime:Number;
flvplayback_internal var _autoResizeTimer:Timer;
flvplayback_internal var _autoResizeDone:Boolean;
flvplayback_internal var _httpDoSeekTimer:Timer;
protected var _state:String;
protected var _videoWidth:int;
flvplayback_internal var _finishAutoResizeTimer:Timer;
flvplayback_internal var _currentPos:Number;
flvplayback_internal var oldBounds:Rectangle;
protected var _videoHeight:int;
flvplayback_internal var waitingForEnough:Boolean;
flvplayback_internal var _delayedBufferingTimer:Timer;
protected var _registrationHeight:Number;
flvplayback_internal var _hiddenForResizeMetadataDelay:Number;
flvplayback_internal var autoResizePlayheadTimeout:Number;// = 0.5
flvplayback_internal var _rtmpDoStopAtEndTimer:Timer;
flvplayback_internal var totalProgressTime:Number;
flvplayback_internal static const DEFAULT_HTTP_DO_SEEK_MAX_COUNT:Number = 4;
flvplayback_internal static const FINISH_AUTO_RESIZE_INTERVAL:Number = 250;
flvplayback_internal static const DEFAULT_AUTO_RESIZE_PLAYHEAD_TIMEOUT:Number = 0.5;
flvplayback_internal static const DEFAULT_AUTO_RESIZE_METADATA_DELAY_MAX:Number = 5;
public static const SHORT_VERSION:String = "2.0";
flvplayback_internal static const HTTP_DO_SEEK_INTERVAL:Number = 250;
flvplayback_internal static const RTMP_DO_SEEK_INTERVAL:Number = 100;
flvplayback_internal static const HTTP_DELAYED_BUFFERING_INTERVAL:Number = 100;
public static const DEFAULT_UPDATE_TIME_INTERVAL:Number = 250;
flvplayback_internal static const AUTO_RESIZE_INTERVAL:Number = 100;
flvplayback_internal static const DEFAULT_LAST_UPDATE_TIME_STUCK_COUNT_MAX:int = 5;
flvplayback_internal static const RTMP_DO_STOP_AT_END_INTERVAL:Number = 500;
public static const DEFAULT_IDLE_TIMEOUT_INTERVAL:Number = 300000;
public static const VERSION:String = "2.0.0.37";
public static const DEFAULT_UPDATE_PROGRESS_INTERVAL:Number = 250;
public static var iNCManagerClass:Object = "fl.video.NCManager";
flvplayback_internal static var BUFFER_FLUSH:String = "bufferFlush";
flvplayback_internal static var BUFFER_FULL:String = "bufferFull";
flvplayback_internal static var BUFFER_EMPTY:String = "bufferEmpty";
public function VideoPlayer(_arg1:int=320, _arg2:int=240){
autoResizePlayheadTimeout = DEFAULT_AUTO_RESIZE_PLAYHEAD_TIMEOUT;
autoResizeMetadataDelayMax = DEFAULT_AUTO_RESIZE_METADATA_DELAY_MAX;
httpDoSeekMaxCount = DEFAULT_HTTP_DO_SEEK_MAX_COUNT;
lastUpdateTimeStuckCountMax = DEFAULT_LAST_UPDATE_TIME_STUCK_COUNT_MAX;
super(_arg1, _arg2);
_registrationX = x;
_registrationY = y;
_registrationWidth = _arg1;
_registrationHeight = _arg2;
_state = VideoState.DISCONNECTED;
_cachedState = _state;
_bufferState = BUFFER_EMPTY;
_sawPlayStop = false;
_cachedPlayheadTime = 0;
_metadata = null;
_startingPlay = false;
_invalidSeekTime = false;
_invalidSeekRecovery = false;
_currentPos = 0;
_atEnd = false;
_streamLength = 0;
_cmdQueue = new Array();
_readyDispatched = false;
_autoResizeDone = false;
_lastUpdateTime = NaN;
lastUpdateTimeStuckCount = 0;
_sawSeekNotify = false;
_hiddenForResize = false;
_hiddenForResizeMetadataDelay = 0;
_videoWidth = -1;
_videoHeight = -1;
_prevVideoWidth = 0;
_prevVideoHeight = 0;
_updateTimeTimer = new Timer(DEFAULT_UPDATE_TIME_INTERVAL);
_updateTimeTimer.addEventListener(TimerEvent.TIMER, doUpdateTime);
_updateProgressTimer = new Timer(DEFAULT_UPDATE_PROGRESS_INTERVAL);
_updateProgressTimer.addEventListener(TimerEvent.TIMER, doUpdateProgress);
_idleTimeoutTimer = new Timer(DEFAULT_IDLE_TIMEOUT_INTERVAL, 1);
_idleTimeoutTimer.addEventListener(TimerEvent.TIMER, doIdleTimeout);
_autoResizeTimer = new Timer(AUTO_RESIZE_INTERVAL);
_autoResizeTimer.addEventListener(TimerEvent.TIMER, doAutoResize);
_rtmpDoStopAtEndTimer = new Timer(RTMP_DO_STOP_AT_END_INTERVAL);
_rtmpDoStopAtEndTimer.addEventListener(TimerEvent.TIMER, rtmpDoStopAtEnd);
_rtmpDoSeekTimer = new Timer(RTMP_DO_SEEK_INTERVAL);
_rtmpDoSeekTimer.addEventListener(TimerEvent.TIMER, rtmpDoSeek);
_httpDoSeekTimer = new Timer(HTTP_DO_SEEK_INTERVAL);
_httpDoSeekTimer.addEventListener(TimerEvent.TIMER, httpDoSeek);
_httpDoSeekCount = 0;
_finishAutoResizeTimer = new Timer(FINISH_AUTO_RESIZE_INTERVAL, 1);
_finishAutoResizeTimer.addEventListener(TimerEvent.TIMER, finishAutoResize);
_delayedBufferingTimer = new Timer(HTTP_DELAYED_BUFFERING_INTERVAL);
_delayedBufferingTimer.addEventListener(TimerEvent.TIMER, doDelayedBuffering);
_isLive = false;
_align = VideoAlign.CENTER;
_scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO;
_autoPlay = true;
_autoRewind = false;
_bufferTime = 0.1;
_soundTransform = new SoundTransform();
_volume = _soundTransform.volume;
__visible = true;
_contentPath = "";
waitingForEnough = false;
baselineProgressTime = NaN;
startProgressTime = NaN;
totalDownloadTime = NaN;
totalProgressTime = NaN;
}
public function get playheadTime():Number{
var _local1:Number;
_local1 = ((_ns)==null) ? _currentPos : _ns.time;
if (((!((_metadata == null))) && (!((_metadata.audiodelay == undefined))))){
_local1 = (_local1 - _metadata.audiodelay);
if (_local1 < 0){
_local1 = 0;
};
};
return (_local1);
}
public function stop():void{
if (!isXnOK()){
if ((((((_state == VideoState.CONNECTION_ERROR)) || ((_ncMgr == null)))) || ((_ncMgr.netConnection == null)))){
throw (new VideoError(VideoError.NO_CONNECTION));
};
return;
} else {
if (_state == VideoState.EXEC_QUEUED_CMD){
_state = _cachedState;
} else {
if (!stateResponsive){
queueCmd(QueuedCommand.STOP);
return;
};
execQueuedCmds();
};
};
if ((((_state == VideoState.STOPPED)) || ((_ns == null)))){
return;
};
if (_ncMgr.isRTMP){
if (((_autoRewind) && (!(_isLive)))){
_currentPos = 0;
_play(0, 0);
_state = VideoState.STOPPED;
setState(VideoState.REWINDING);
} else {
closeNS(true);
setState(VideoState.STOPPED);
};
} else {
_pause(true);
if (_autoRewind){
_seek(0);
_state = VideoState.STOPPED;
setState(VideoState.REWINDING);
} else {
setState(VideoState.STOPPED);
};
};
}
flvplayback_internal function execQueuedCmds():void{
var nextCmd:Object;
while ((((((_cmdQueue.length > 0)) && (((((stateResponsive) || ((_state == VideoState.DISCONNECTED)))) || ((_state == VideoState.CONNECTION_ERROR)))))) && (((!((_cmdQueue[0].url == null))) || (((!((_state == VideoState.DISCONNECTED))) && (!((_state == VideoState.CONNECTION_ERROR))))))))) {
try {
nextCmd = _cmdQueue.shift();
_cachedState = _state;
_state = VideoState.EXEC_QUEUED_CMD;
switch (nextCmd.type){
case QueuedCommand.PLAY:
play(nextCmd.url, nextCmd.time, nextCmd.isLive);
break;
case QueuedCommand.LOAD:
load(nextCmd.url, nextCmd.time, nextCmd.isLive);
break;
case QueuedCommand.PAUSE:
pause();
break;
case QueuedCommand.STOP:
stop();
break;
case QueuedCommand.SEEK:
seek(nextCmd.time);
break;
case QueuedCommand.PLAY_WHEN_ENOUGH:
playWhenEnoughDownloaded();
break;
};
} finally {
if (_state == VideoState.EXEC_QUEUED_CMD){
_state = _cachedState;
};
};
};
}
public function setScale(_arg1:Number, _arg2:Number):void{
super.scaleX = _arg1;
super.scaleY = _arg2;
_registrationWidth = width;
_registrationHeight = height;
switch (_scaleMode){
case VideoScaleMode.MAINTAIN_ASPECT_RATIO:
case VideoScaleMode.NO_SCALE:
startAutoResize();
break;
default:
super.x = _registrationX;
super.y = _registrationY;
break;
};
}
public function set playheadTime(_arg1:Number):void{
seek(_arg1);
}
override public function get videoWidth():int{
if (_readyDispatched){
_videoWidth = super.videoWidth;
};
return (_videoWidth);
}
public function get scaleMode():String{
return (_scaleMode);
}
public function get progressInterval():Number{
return (_updateProgressTimer.delay);
}
public function set align(_arg1:String):void{
if (_align != _arg1){
switch (_arg1){
case VideoAlign.CENTER:
case VideoAlign.TOP:
case VideoAlign.LEFT:
case VideoAlign.BOTTOM:
case VideoAlign.RIGHT:
case VideoAlign.TOP_LEFT:
case VideoAlign.TOP_RIGHT:
case VideoAlign.BOTTOM_LEFT:
case VideoAlign.BOTTOM_RIGHT:
break;
default:
return;
};
_align = _arg1;
switch (_scaleMode){
case VideoScaleMode.MAINTAIN_ASPECT_RATIO:
case VideoScaleMode.NO_SCALE:
startAutoResize();
break;
};
};
}
public function set scaleMode(_arg1:String):void{
if (_scaleMode != _arg1){
switch (_arg1){
case VideoScaleMode.MAINTAIN_ASPECT_RATIO:
case VideoScaleMode.NO_SCALE:
case VideoScaleMode.EXACT_FIT:
break;
default:
return;
};
_scaleMode = _arg1;
startAutoResize();
};
}
public function get source():String{
return (_contentPath);
}
flvplayback_internal function doUpdateTime(_arg1:TimerEvent=null):void{
var _local2:Number;
_local2 = playheadTime;
if (_local2 != _atEndCheckPlayhead){
_atEndCheckPlayhead = NaN;
};
switch (_state){
case VideoState.STOPPED:
case VideoState.PAUSED:
case VideoState.DISCONNECTED:
case VideoState.CONNECTION_ERROR:
_updateTimeTimer.stop();
break;
case VideoState.PLAYING:
case VideoState.BUFFERING:
if (((((((((!((_ncMgr == null))) && (!(_ncMgr.isRTMP)))) && ((_lastUpdateTime == _local2)))) && (!((_ns == null))))) && ((_ns.bytesLoaded == _ns.bytesTotal)))){
if (lastUpdateTimeStuckCount > lastUpdateTimeStuckCountMax){
lastUpdateTimeStuckCount = 0;
httpDoStopAtEnd();
} else {
lastUpdateTimeStuckCount++;
};
};
};
if (_lastUpdateTime != _local2){
dispatchEvent(new VideoEvent(VideoEvent.PLAYHEAD_UPDATE, false, false, _state, _local2));
_lastUpdateTime = _local2;
lastUpdateTimeStuckCount = 0;
};
}
flvplayback_internal function rtmpNetStatus(_arg1:NetStatusEvent):void{
if (_state == VideoState.CONNECTION_ERROR){
return;
};
switch (_arg1.info.code){
case "NetStream.Play.Stop":
if (_startingPlay){
return;
};
switch (_state){
case VideoState.RESIZING:
if (_hiddenForResize){
finishAutoResize();
};
break;
case VideoState.LOADING:
case VideoState.STOPPED:
case VideoState.PAUSED:
break;
default:
_sawPlayStop = true;
break;
};
break;
case "NetStream.Buffer.Empty":
switch (_bufferState){
case BUFFER_FULL:
if (_sawPlayStop){
rtmpDoStopAtEnd();
} else {
if (_state == VideoState.PLAYING){
setState(VideoState.BUFFERING);
};
};
break;
};
_bufferState = BUFFER_EMPTY;
_sawPlayStop = false;
break;
case "NetStream.Buffer.Flush":
if (((_sawSeekNotify) && ((_state == VideoState.SEEKING)))){
_bufferState = BUFFER_EMPTY;
_sawPlayStop = false;
setStateFromCachedState(false);
doUpdateTime();
execQueuedCmds();
};
if (((_sawPlayStop) && ((((_bufferState == BUFFER_EMPTY)) || ((((_ns.bufferTime <= 0.1)) && ((_ns.bufferLength <= 0.1)))))))){
_cachedPlayheadTime = playheadTime;
_rtmpDoStopAtEndTimer.reset();
_rtmpDoStopAtEndTimer.start();
};
switch (_bufferState){
case BUFFER_EMPTY:
if (!_hiddenForResize){
if ((((((_state == VideoState.LOADING)) && ((_cachedState == VideoState.PLAYING)))) || ((_state == VideoState.BUFFERING)))){
setState(VideoState.PLAYING);
} else {
if (_cachedState == VideoState.BUFFERING){
_cachedState = VideoState.PLAYING;
};
};
};
_bufferState = BUFFER_FLUSH;
break;
default:
if (_state == VideoState.BUFFERING){
setStateFromCachedState();
};
break;
};
break;
case "NetStream.Buffer.Full":
if (((_sawSeekNotify) && ((_state == VideoState.SEEKING)))){
_bufferState = BUFFER_EMPTY;
_sawPlayStop = false;
setStateFromCachedState(false);
doUpdateTime();
execQueuedCmds();
};
switch (_bufferState){
case BUFFER_EMPTY:
_bufferState = BUFFER_FULL;
if (!_hiddenForResize){
if ((((((_state == VideoState.LOADING)) && ((_cachedState == VideoState.PLAYING)))) || ((_state == VideoState.BUFFERING)))){
setState(VideoState.PLAYING);
} else {
if (_cachedState == VideoState.BUFFERING){
_cachedState = VideoState.PLAYING;
};
};
if (_rtmpDoStopAtEndTimer.running){
_sawPlayStop = true;
_rtmpDoStopAtEndTimer.reset();
};
};
break;
case BUFFER_FLUSH:
_bufferState = BUFFER_FULL;
if (_rtmpDoStopAtEndTimer.running){
_sawPlayStop = true;
_rtmpDoStopAtEndTimer.reset();
};
break;
};
if (_state == VideoState.BUFFERING){
setStateFromCachedState();
};
break;
case "NetStream.Pause.Notify":
if ((((_state == VideoState.RESIZING)) && (_hiddenForResize))){
finishAutoResize();
};
break;
case "NetStream.Unpause.Notify":
if (_state == VideoState.PAUSED){
_state = VideoState.PLAYING;
setState(VideoState.BUFFERING);
} else {
_cachedState = VideoState.PLAYING;
};
break;
case "NetStream.Play.Start":
_rtmpDoStopAtEndTimer.reset();
_bufferState = BUFFER_EMPTY;
_sawPlayStop = false;
if (_startingPlay){
_startingPlay = false;
_cachedPlayheadTime = playheadTime;
} else {
if (_state == VideoState.PLAYING){
setState(VideoState.BUFFERING);
};
};
break;
case "NetStream.Play.Reset":
_rtmpDoStopAtEndTimer.reset();
if (_state == VideoState.REWINDING){
_rtmpDoSeekTimer.reset();
if ((((playheadTime == 0)) || ((playheadTime < _cachedPlayheadTime)))){
setStateFromCachedState();
} else {
_cachedPlayheadTime = playheadTime;
_rtmpDoSeekTimer.start();
};
};
break;
case "NetStream.Seek.Notify":
if (playheadTime != _cachedPlayheadTime){
setStateFromCachedState(false);
doUpdateTime();
execQueuedCmds();
} else {
_sawSeekNotify = true;
_rtmpDoSeekTimer.start();
};
break;
case "Netstream.Play.UnpublishNotify":
break;
case "Netstream.Play.PublishNotify":
break;
case "NetStream.Play.StreamNotFound":
if (!_ncMgr.connectAgain()){
setState(VideoState.CONNECTION_ERROR);
};
break;
case "NetStream.Play.Failed":
case "NetStream.Failed":
setState(VideoState.CONNECTION_ERROR);
break;
};
}
public function set progressInterval(_arg1:Number):void{
_updateProgressTimer.delay = _arg1;
}
flvplayback_internal function onCuePoint(_arg1:Object):void{
if (((!(_hiddenForResize)) || (((!(isNaN(_hiddenRewindPlayheadTime))) && ((playheadTime < _hiddenRewindPlayheadTime)))))){
dispatchEvent(new MetadataEvent(MetadataEvent.CUE_POINT, false, false, _arg1));
};
}
flvplayback_internal function createINCManager():void{
var theClass:Class;
theClass = null;
try {
if ((iNCManagerClass is String)){
theClass = Class(getDefinitionByName(String(iNCManagerClass)));
} else {
if ((iNCManagerClass is Class)){
theClass = Class(iNCManagerClass);
};
};
} catch(e:Error) {
theClass = null;
};
if (theClass == null){
throw (new VideoError(VideoError.INCMANAGER_CLASS_UNSET, iNCManagerClass.toString()));
};
_ncMgr = new (theClass);
_ncMgr.videoPlayer = this;
}
flvplayback_internal function doAutoResize(_arg1:TimerEvent=null):void{
var _local2:Number;
var _local3:Number;
if (_autoResizeTimer.running){
switch (_state){
case VideoState.RESIZING:
case VideoState.LOADING:
break;
case VideoState.DISCONNECTED:
case VideoState.CONNECTION_ERROR:
_autoResizeTimer.reset();
return;
default:
if (!stateResponsive){
return;
};
};
if (((((((((!((super.videoWidth == _prevVideoWidth))) || (!((super.videoHeight == _prevVideoHeight))))) || ((_bufferState == BUFFER_FULL)))) || ((_bufferState == BUFFER_FLUSH)))) || ((_ns.time > autoResizePlayheadTimeout)))){
if (((((_hiddenForResize) && ((_metadata == null)))) && ((_hiddenForResizeMetadataDelay < autoResizeMetadataDelayMax)))){
_hiddenForResizeMetadataDelay++;
return;
};
_videoWidth = super.videoWidth;
_videoHeight = super.videoHeight;
_autoResizeTimer.reset();
} else {
return;
};
};
if (_autoResizeDone){
setState(_cachedState);
return;
};
oldBounds = new Rectangle(x, y, width, height);
oldRegistrationBounds = new Rectangle(registrationX, registrationY, registrationWidth, registrationHeight);
_autoResizeDone = true;
switch (_scaleMode){
case VideoScaleMode.NO_SCALE:
super.width = _videoWidth;
super.height = _videoHeight;
break;
case VideoScaleMode.EXACT_FIT:
super.width = registrationWidth;
super.height = registrationHeight;
break;
case VideoScaleMode.MAINTAIN_ASPECT_RATIO:
default:
_local2 = ((_videoWidth * _registrationHeight) / _videoHeight);
_local3 = ((_videoHeight * _registrationWidth) / _videoWidth);
if (_local3 < _registrationHeight){
super.width = _registrationWidth;
super.height = _local3;
} else {
if (_local2 < _registrationWidth){
super.width = _local2;
super.height = _registrationHeight;
} else {
super.width = _registrationWidth;
super.height = _registrationHeight;
};
};
};
switch (_align){
case VideoAlign.CENTER:
case VideoAlign.TOP:
case VideoAlign.BOTTOM:
default:
super.x = (_registrationX + ((_registrationWidth - width) / 2));
break;
case VideoAlign.LEFT:
case VideoAlign.TOP_LEFT:
case VideoAlign.BOTTOM_LEFT:
super.x = _registrationX;
break;
case VideoAlign.RIGHT:
case VideoAlign.TOP_RIGHT:
case VideoAlign.BOTTOM_RIGHT:
super.x = (_registrationX + (_registrationWidth - width));
break;
};
switch (_align){
case VideoAlign.CENTER:
case VideoAlign.LEFT:
case VideoAlign.RIGHT:
default:
super.y = (_registrationY + ((_registrationHeight - height) / 2));
break;
case VideoAlign.TOP:
case VideoAlign.TOP_LEFT:
case VideoAlign.TOP_RIGHT:
super.y = _registrationY;
break;
case VideoAlign.BOTTOM:
case VideoAlign.BOTTOM_LEFT:
case VideoAlign.BOTTOM_RIGHT:
super.y = (_registrationY + (_registrationHeight - height));
break;
};
if (_hiddenForResize){
_hiddenRewindPlayheadTime = playheadTime;
if (_state == VideoState.LOADING){
_cachedState = VideoState.PLAYING;
};
if (!_ncMgr.isRTMP){
_pause(true);
_seek(0);
_finishAutoResizeTimer.reset();
_finishAutoResizeTimer.start();
} else {
if (!_isLive){
_currentPos = 0;
_play(0, 0);
setState(VideoState.RESIZING);
} else {
if (_autoPlay){
_finishAutoResizeTimer.reset();
_finishAutoResizeTimer.start();
} else {
finishAutoResize();
};
};
};
} else {
dispatchEvent(new AutoLayoutEvent(AutoLayoutEvent.AUTO_LAYOUT, false, false, oldBounds, oldRegistrationBounds));
};
}
public function get totalTime():Number{
return (_streamLength);
}
public function get ncMgr():INCManager{
if (_ncMgr == null){
createINCManager();
};
return (_ncMgr);
}
public function set volume(_arg1:Number):void{
var _local2:SoundTransform;
_local2 = soundTransform;
_local2.volume = _arg1;
soundTransform = _local2;
}
flvplayback_internal function _play(_arg1:int=0, _arg2:int=-1):void{
waitingForEnough = false;
_rtmpDoStopAtEndTimer.reset();
_startingPlay = true;
_ns.play(_ncMgr.streamName, (_isLive) ? -1 : _arg1, _arg2);
}
flvplayback_internal function finishAutoResize(_arg1:TimerEvent=null):void{
if (stateResponsive){
return;
};
_hiddenForResize = false;
super.visible = __visible;
volume = _volume;
dispatchEvent(new AutoLayoutEvent(AutoLayoutEvent.AUTO_LAYOUT, false, false, oldBounds, oldRegistrationBounds));
if (_autoPlay){
if (_ncMgr.isRTMP){
if (!_isLive){
_currentPos = 0;
_play(0);
};
if (_state == VideoState.RESIZING){
setState(VideoState.LOADING);
_cachedState = VideoState.PLAYING;
};
} else {
waitingForEnough = true;
_cachedState = _state;
_state = VideoState.PAUSED;
checkReadyForPlay(bytesLoaded, bytesTotal);
if (waitingForEnough){
_state = _cachedState;
setState(VideoState.PAUSED);
} else {
_cachedState = VideoState.PLAYING;
};
};
} else {
setState(VideoState.STOPPED);
};
}
public function set soundTransform(_arg1:SoundTransform):void{
if (_arg1 == null){
return;
};
if (_hiddenForResize){
_volume = _arg1.volume;
};
_soundTransform = new SoundTransform();
_soundTransform.volume = (_hiddenForResize) ? 0 : _arg1.volume;
_soundTransform.leftToLeft = _arg1.leftToLeft;
_soundTransform.leftToRight = _arg1.leftToRight;
_soundTransform.rightToLeft = _arg1.rightToLeft;
_soundTransform.rightToRight = _arg1.rightToRight;
if (_ns != null){
_ns.soundTransform = _soundTransform;
};
}
flvplayback_internal function httpDoSeek(_arg1:TimerEvent):void{
var _local2:Boolean;
_local2 = (((_state == VideoState.REWINDING)) || ((_state == VideoState.SEEKING)));
if (((((_local2) && ((_httpDoSeekCount < httpDoSeekMaxCount)))) && ((((_cachedPlayheadTime == playheadTime)) || (_invalidSeekTime))))){
_httpDoSeekCount++;
return;
};
_httpDoSeekCount = 0;
_httpDoSeekTimer.reset();
if (!_local2){
return;
};
setStateFromCachedState(false);
if (_invalidSeekTime){
_invalidSeekTime = false;
_invalidSeekRecovery = true;
seek(playheadTime);
} else {
doUpdateTime();
execQueuedCmds();
};
}
public function get bytesLoaded():uint{
if ((((_ns == null)) || (_ncMgr.isRTMP))){
return (uint.MIN_VALUE);
};
return (_ns.bytesLoaded);
}
override public function set height(_arg1:Number):void{
super.height = (_registrationHeight = _arg1);
switch (_scaleMode){
case VideoScaleMode.MAINTAIN_ASPECT_RATIO:
case VideoScaleMode.NO_SCALE:
startAutoResize();
break;
default:
super.height = _arg1;
break;
};
}
flvplayback_internal function httpNetStatus(_arg1:NetStatusEvent):void{
switch (_arg1.info.code){
case "NetStream.Play.Stop":
_delayedBufferingTimer.reset();
if (_invalidSeekTime){
_invalidSeekTime = false;
_invalidSeekRecovery = true;
setState(_cachedState);
seek(playheadTime);
} else {
switch (_state){
case VideoState.PLAYING:
case VideoState.BUFFERING:
case VideoState.SEEKING:
httpDoStopAtEnd();
break;
};
};
break;
case "NetStream.Seek.InvalidTime":
if (_invalidSeekRecovery){
_invalidSeekTime = false;
_invalidSeekRecovery = false;
setState(_cachedState);
seek(0);
} else {
_invalidSeekTime = true;
};
break;
case "NetStream.Buffer.Empty":
_bufferState = BUFFER_EMPTY;
if (_state == VideoState.PLAYING){
_delayedBufferingTimer.reset();
_delayedBufferingTimer.start();
};
break;
case "NetStream.Buffer.Full":
case "NetStream.Buffer.Flush":
_delayedBufferingTimer.reset();
_bufferState = BUFFER_FULL;
if (!_hiddenForResize){
if ((((((_state == VideoState.LOADING)) && ((_cachedState == VideoState.PLAYING)))) || ((_state == VideoState.BUFFERING)))){
setState(VideoState.PLAYING);
} else {
if (_cachedState == VideoState.BUFFERING){
_cachedState = VideoState.PLAYING;
};
};
};
break;
case "NetStream.Seek.Notify":
_invalidSeekRecovery = false;
switch (_state){
case VideoState.SEEKING:
case VideoState.REWINDING:
if (!_httpDoSeekTimer.running){
_httpDoSeekCount = 0;
_httpDoSeekTimer.start();
};
break;
};
break;
case "NetStream.Play.StreamNotFound":
setState(VideoState.CONNECTION_ERROR);
break;
};
}
public function get netConnection():NetConnection{
if (_ncMgr != null){
return (_ncMgr.netConnection);
};
return (null);
}
public function set bufferTime(_arg1:Number):void{
_bufferTime = _arg1;
if (_ns != null){
_ns.bufferTime = _bufferTime;
};
}
flvplayback_internal function onMetaData(_arg1:Object):void{
if (_metadata != null){
return;
};
_metadata = _arg1;
if (isNaN(_streamLength)){
_streamLength = _arg1.duration;
};
if (_videoWidth < 0){
_videoWidth = _arg1.width;
};
if (_videoHeight < 0){
_videoHeight = _arg1.height;
};
dispatchEvent(new MetadataEvent(MetadataEvent.METADATA_RECEIVED, false, false, _arg1));
}
flvplayback_internal function queueCmd(_arg1:Number, _arg2:String=null, _arg3:Boolean=false, _arg4:Number=NaN):void{
_cmdQueue.push(new QueuedCommand(_arg1, _arg2, _arg3, _arg4));
}
public function set registrationHeight(_arg1:Number):void{
height = _arg1;
}
override public function get visible():Boolean{
if (!_hiddenForResize){
__visible = super.visible;
};
return (__visible);
}
public function seek(_arg1:Number):void{
if (_invalidSeekTime){
return;
};
if (((isNaN(_arg1)) || ((_arg1 < 0)))){
throw (new VideoError(VideoError.INVALID_SEEK));
};
if (!isXnOK()){
if ((((((_state == VideoState.CONNECTION_ERROR)) || ((_ncMgr == null)))) || ((_ncMgr.netConnection == null)))){
throw (new VideoError(VideoError.NO_CONNECTION));
};
flushQueuedCmds();
queueCmd(QueuedCommand.SEEK, null, false, _arg1);
setState(VideoState.LOADING);
_cachedState = VideoState.LOADING;
_ncMgr.reconnect();
return;
} else {
if (_state == VideoState.EXEC_QUEUED_CMD){
_state = _cachedState;
} else {
if (!stateResponsive){
queueCmd(QueuedCommand.SEEK, null, false, _arg1);
return;
};
execQueuedCmds();
};
};
if (_ns == null){
_createStream();
};
if (((_atEnd) && ((_arg1 < playheadTime)))){
_atEnd = false;
};
switch (_state){
case VideoState.PLAYING:
_state = VideoState.BUFFERING;
case VideoState.BUFFERING:
case VideoState.PAUSED:
_seek(_arg1);
setState(VideoState.SEEKING);
break;
case VideoState.STOPPED:
if (_ncMgr.isRTMP){
_play(0);
_pause(true);
};
_seek(_arg1);
_state = VideoState.PAUSED;
setState(VideoState.SEEKING);
break;
};
}
public function get state():String{
return (_state);
}
public function set autoRewind(_arg1:Boolean):void{
_autoRewind = _arg1;
}
override public function set scaleX(_arg1:Number):void{
super.scaleX = _arg1;
_registrationWidth = width;
switch (_scaleMode){
case VideoScaleMode.MAINTAIN_ASPECT_RATIO:
case VideoScaleMode.NO_SCALE:
startAutoResize();
break;
};
}
override public function set scaleY(_arg1:Number):void{
super.scaleY = _arg1;
_registrationHeight = height;
switch (_scaleMode){
case VideoScaleMode.MAINTAIN_ASPECT_RATIO:
case VideoScaleMode.NO_SCALE:
startAutoResize();
break;
};
}
public function get registrationWidth():Number{
return (_registrationWidth);
}
flvplayback_internal function flushQueuedCmds():void{
while (_cmdQueue.length > 0) {
_cmdQueue.pop();
};
}
public function get registrationX():Number{
return (_registrationX);
}
flvplayback_internal function _setUpStream():void{
if (((!(isNaN(_ncMgr.streamLength))) && ((_ncMgr.streamLength >= 0)))){
_streamLength = _ncMgr.streamLength;
};
_videoWidth = ((_ncMgr.streamWidth)>=0) ? _ncMgr.streamWidth : -1;
_videoHeight = ((_ncMgr.streamHeight)>=0) ? _ncMgr.streamHeight : -1;
if (!_hiddenForResize){
__visible = super.visible;
super.visible = false;
_volume = volume;
volume = 0;
_hiddenForResize = true;
};
_hiddenForResizeMetadataDelay = 0;
_play(0);
if (_currentPos > 0){
_seek(_currentPos);
_currentPos = 0;
};
_autoResizeTimer.reset();
_autoResizeTimer.start();
}
public function get registrationY():Number{
return (_registrationY);
}
flvplayback_internal function httpDoStopAtEnd():void{
if ((((_atEndCheckPlayhead == playheadTime)) && (!((playheadTime == 0))))){
_atEnd = false;
_seek(0);
return;
};
_atEndCheckPlayhead = NaN;
_atEnd = true;
if (isNaN(_streamLength)){
_streamLength = _ns.time;
};
_pause(true);
setState(VideoState.STOPPED);
if (_state != VideoState.STOPPED){
return;
};
doUpdateTime();
if (_state != VideoState.STOPPED){
return;
};
dispatchEvent(new VideoEvent(VideoEvent.COMPLETE, false, false, _state, playheadTime));
if (_state != VideoState.STOPPED){
return;
};
if (_autoRewind){
_atEnd = false;
_pause(true);
_seek(0);
setState(VideoState.REWINDING);
};
}
public function ncConnected():void{
if ((((_ncMgr == null)) || ((_ncMgr.netConnection == null)))){
setState(VideoState.CONNECTION_ERROR);
} else {
_createStream();
_setUpStream();
};
}
override public function set visible(_arg1:Boolean):void{
__visible = _arg1;
if (!_hiddenForResize){
super.visible = __visible;
};
}
public function load(_arg1:String, _arg2:Number=NaN, _arg3:Boolean=false):void{
if (_arg1 == null){
throw (new VideoError(VideoError.NULL_URL_LOAD));
};
if (_state == VideoState.EXEC_QUEUED_CMD){
_state = _cachedState;
} else {
if (((((!(stateResponsive)) && (!((_state == VideoState.DISCONNECTED))))) && (!((_state == VideoState.CONNECTION_ERROR))))){
queueCmd(QueuedCommand.LOAD, _arg1, _arg3, _arg2);
return;
};
execQueuedCmds();
};
_autoPlay = false;
_load(_arg1, _arg2, _arg3);
}
override public function set x(_arg1:Number):void{
var _local2:Number;
if (this.x != _arg1){
_local2 = (_arg1 - this.x);
super.x = _arg1;
_registrationX = (_registrationX + _local2);
};
}
override public function set y(_arg1:Number):void{
var _local2:Number;
if (this.y != _arg1){
_local2 = (_arg1 - this.y);
super.y = _arg1;
_registrationY = (_registrationY + _local2);
};
}
flvplayback_internal function _pause(_arg1:Boolean):void{
_atEndCheckPlayhead = playheadTime;
_rtmpDoStopAtEndTimer.reset();
if (_arg1){
_ns.pause();
} else {
_ns.resume();
};
}
public function get playheadUpdateInterval():Number{
return (_updateTimeTimer.delay);
}
flvplayback_internal function doDelayedBuffering(_arg1:TimerEvent):void{
switch (_state){
case VideoState.LOADING:
case VideoState.RESIZING:
break;
case VideoState.PLAYING:
_delayedBufferingTimer.reset();
if (((((((((!(isNaN(totalTime))) && ((totalTime > 0)))) && ((bytesLoaded > 0)))) && ((bytesLoaded < uint.MAX_VALUE)))) && ((bytesLoaded < bytesTotal)))){
pause();
if (_state == VideoState.PAUSED){
waitingForEnough = true;
playWhenEnoughDownloaded();
};
} else {
setState(VideoState.BUFFERING);
};
break;
default:
_delayedBufferingTimer.reset();
break;
};
}
public function get align():String{
return (_align);
}
public function set registrationWidth(_arg1:Number):void{
width = _arg1;
}
public function get stateResponsive():Boolean{
switch (_state){
case VideoState.STOPPED:
case VideoState.PLAYING:
case VideoState.PAUSED:
case VideoState.BUFFERING:
return (true);
default:
return (false);
};
}
public function get volume():Number{
return (soundTransform.volume);
}
public function get soundTransform():SoundTransform{
var _local1:SoundTransform;
if (_ns != null){
_soundTransform = _ns.soundTransform;
};
_local1 = new SoundTransform();
_local1.volume = (_hiddenForResize) ? _volume : _soundTransform.volume;
_local1.leftToLeft = _soundTransform.leftToLeft;
_local1.leftToRight = _soundTransform.leftToRight;
_local1.rightToLeft = _soundTransform.rightToLeft;
_local1.rightToRight = _soundTransform.rightToRight;
return (_local1);
}
public function get bufferTime():Number{
if (_ns != null){
_bufferTime = _ns.bufferTime;
};
return (_bufferTime);
}
public function get metadata():Object{
return (_metadata);
}
public function play(_arg1:String=null, _arg2:Number=NaN, _arg3:Boolean=false):void{
if (_arg1 != null){
if (_state == VideoState.EXEC_QUEUED_CMD){
_state = _cachedState;
} else {
if (((((!(stateResponsive)) && (!((_state == VideoState.DISCONNECTED))))) && (!((_state == VideoState.CONNECTION_ERROR))))){
queueCmd(QueuedCommand.PLAY, _arg1, _arg3, _arg2);
return;
};
execQueuedCmds();
};
_autoPlay = true;
_load(_arg1, _arg2, _arg3);
return;
};
if (!isXnOK()){
if ((((((_state == VideoState.CONNECTION_ERROR)) || ((_ncMgr == null)))) || ((_ncMgr.netConnection == null)))){
throw (new VideoError(VideoError.NO_CONNECTION));
};
flushQueuedCmds();
queueCmd(QueuedCommand.PLAY);
setState(VideoState.LOADING);
_cachedState = VideoState.LOADING;
_ncMgr.reconnect();
return;
} else {
if (_state == VideoState.EXEC_QUEUED_CMD){
_state = _cachedState;
} else {
if (!stateResponsive){
queueCmd(QueuedCommand.PLAY);
return;
};
execQueuedCmds();
};
};
if (_ns == null){
_createStream();
};
switch (_state){
case VideoState.BUFFERING:
if (_ncMgr.isRTMP){
_play(0);
if (_atEnd){
_atEnd = false;
_currentPos = 0;
setState(VideoState.REWINDING);
} else {
if (_currentPos > 0){
_seek(_currentPos);
_currentPos = 0;
};
};
};
case VideoState.PLAYING:
return;
case VideoState.STOPPED:
if (_ncMgr.isRTMP){
if (_isLive){
_play(-1);
setState(VideoState.BUFFERING);
} else {
_play(0);
if (_atEnd){
_atEnd = false;
_currentPos = 0;
_state = VideoState.BUFFERING;
setState(VideoState.REWINDING);
} else {
if (_currentPos > 0){
_seek(_currentPos);
_currentPos = 0;
setState(VideoState.BUFFERING);
} else {
setState(VideoState.BUFFERING);
};
};
};
} else {
_pause(false);
if (_atEnd){
_atEnd = false;
_seek(0);
_state = VideoState.BUFFERING;
setState(VideoState.REWINDING);
} else {
if (_bufferState == BUFFER_EMPTY){
setState(VideoState.BUFFERING);
} else {
setState(VideoState.PLAYING);
};
};
};
break;
case VideoState.PAUSED:
_pause(false);
if (!_ncMgr.isRTMP){
if (_bufferState == BUFFER_EMPTY){
setState(VideoState.BUFFERING);
} else {
setState(VideoState.PLAYING);
};
} else {
setState(VideoState.BUFFERING);
};
break;
};
}
public function get isLive():Boolean{
return (_isLive);
}
flvplayback_internal function setStateFromCachedState(_arg1:Boolean=true):void{
switch (_cachedState){
case VideoState.PLAYING:
case VideoState.PAUSED:
case VideoState.BUFFERING:
setState(_cachedState, _arg1);
break;
default:
setState(VideoState.STOPPED, _arg1);
break;
};
}
public function get idleTimeout():Number{
return (_idleTimeoutTimer.delay);
}
public function get registrationHeight():Number{
return (_registrationHeight);
}
public function ncReconnected():void{
if ((((_ncMgr == null)) || ((_ncMgr.netConnection == null)))){
setState(VideoState.CONNECTION_ERROR);
} else {
_ns = null;
_state = VideoState.STOPPED;
execQueuedCmds();
};
}
flvplayback_internal function startAutoResize():void{
switch (_state){
case VideoState.DISCONNECTED:
case VideoState.CONNECTION_ERROR:
return;
default:
_autoResizeDone = false;
if (((stateResponsive) && (((((((((!((super.videoWidth == 0))) || (!((super.videoHeight == 0))))) || ((_bufferState == BUFFER_FULL)))) || ((_bufferState == BUFFER_FLUSH)))) || ((_ns.time > autoResizePlayheadTimeout)))))){
doAutoResize();
} else {
_autoResizeTimer.reset();
_autoResizeTimer.start();
break;
};
};
}
flvplayback_internal function setState(_arg1:String, _arg2:Boolean=true):void{
var _local3:String;
if (_arg1 == _state){
return;
};
_hiddenRewindPlayheadTime = NaN;
_cachedState = _state;
_cachedPlayheadTime = playheadTime;
_state = _arg1;
_local3 = _state;
dispatchEvent(new VideoEvent(VideoEvent.STATE_CHANGE, false, false, _local3, playheadTime));
if (!_readyDispatched){
switch (_local3){
case VideoState.STOPPED:
case VideoState.PLAYING:
case VideoState.PAUSED:
case VideoState.BUFFERING:
_readyDispatched = true;
dispatchEvent(new VideoEvent(VideoEvent.READY, false, false, _local3, playheadTime));
break;
};
};
switch (_cachedState){
case VideoState.REWINDING:
dispatchEvent(new VideoEvent(VideoEvent.AUTO_REWOUND, false, false, _local3, playheadTime));
if (((_ncMgr.isRTMP) && ((_local3 == VideoState.STOPPED)))){
closeNS();
};
break;
};
switch (_local3){
case VideoState.STOPPED:
case VideoState.PAUSED:
if (_ncMgr.isRTMP){
_idleTimeoutTimer.reset();
_idleTimeoutTimer.start();
};
break;
case VideoState.SEEKING:
case VideoState.REWINDING:
_bufferState = BUFFER_EMPTY;
_sawPlayStop = false;
_idleTimeoutTimer.reset();
break;
case VideoState.PLAYING:
case VideoState.BUFFERING:
_updateTimeTimer.start();
_idleTimeoutTimer.reset();
break;
case VideoState.LOADING:
case VideoState.RESIZING:
_idleTimeoutTimer.reset();
break;
};
if (_arg2){
execQueuedCmds();
};
}
flvplayback_internal function _seek(_arg1:Number):void{
_rtmpDoStopAtEndTimer.reset();
if (((((!((_metadata == null))) && (!((_metadata.audiodelay == undefined))))) && (((isNaN(_streamLength)) || (((_arg1 + _metadata.audiodelay) < _streamLength)))))){
_arg1 = (_arg1 + _metadata.audiodelay);
};
_ns.seek(_arg1);
_invalidSeekTime = false;
_bufferState = BUFFER_EMPTY;
_sawPlayStop = false;
_sawSeekNotify = false;
}
public function get autoRewind():Boolean{
return (_autoRewind);
}
flvplayback_internal function doIdleTimeout(_arg1:TimerEvent):void{
close();
}
public function playWhenEnoughDownloaded():void{
if (((!((_ncMgr == null))) && (_ncMgr.isRTMP))){
play();
return;
};
if (!isXnOK()){
throw (new VideoError(VideoError.NO_CONNECTION));
};
if (_state == VideoState.EXEC_QUEUED_CMD){
_state = _cachedState;
} else {
if (!stateResponsive){
queueCmd(QueuedCommand.PLAY_WHEN_ENOUGH);
return;
};
execQueuedCmds();
};
waitingForEnough = true;
checkReadyForPlay(bytesLoaded, bytesTotal);
}
flvplayback_internal function rtmpDoSeek(_arg1:TimerEvent):void{
if (((!((_state == VideoState.REWINDING))) && (!((_state == VideoState.SEEKING))))){
_rtmpDoSeekTimer.reset();
_sawSeekNotify = false;
} else {
if (playheadTime != _cachedPlayheadTime){
_rtmpDoSeekTimer.reset();
_sawSeekNotify = false;
setStateFromCachedState(false);
doUpdateTime();
execQueuedCmds();
};
};
}
public function get netStream():NetStream{
return (_ns);
}
override public function get videoHeight():int{
if (_readyDispatched){
_videoHeight = super.videoHeight;
};
return (_videoHeight);
}
public function set registrationX(_arg1:Number):void{
var _local2:Number;
if (_registrationX != _arg1){
_local2 = (_arg1 - _registrationX);
_registrationX = _arg1;
this.x = (this.x + _local2);
};
}
public function set registrationY(_arg1:Number):void{
var _local2:Number;
if (_registrationY != _arg1){
_local2 = (_arg1 - _registrationY);
_registrationY = _arg1;
this.y = (this.y + _local2);
};
}
flvplayback_internal function doUpdateProgress(_arg1:TimerEvent):void{
var _local2:uint;
var _local3:uint;
if (_ns == null){
return;
};
_local2 = _ns.bytesLoaded;
_local3 = _ns.bytesTotal;
if (_local3 < uint.MAX_VALUE){
dispatchEvent(new VideoProgressEvent(VideoProgressEvent.PROGRESS, false, false, _local2, _local3));
};
if ((((((_state == VideoState.DISCONNECTED)) || ((_state == VideoState.CONNECTION_ERROR)))) || ((_local2 >= _local3)))){
_updateProgressTimer.stop();
};
checkEnoughDownloaded(_local2, _local3);
}
override public function set width(_arg1:Number):void{
super.width = (_registrationWidth = _arg1);
switch (_scaleMode){
case VideoScaleMode.MAINTAIN_ASPECT_RATIO:
case VideoScaleMode.NO_SCALE:
startAutoResize();
break;
default:
super.width = _arg1;
break;
};
}
public function get isRTMP():Boolean{
if (_ncMgr == null){
return (false);
};
return (_ncMgr.isRTMP);
}
public function get bytesTotal():uint{
if ((((_ns == null)) || (_ncMgr.isRTMP))){
return (uint.MAX_VALUE);
};
return (_ns.bytesTotal);
}
public function setSize(_arg1:Number, _arg2:Number):void{
super.width = (_registrationWidth = _arg1);
super.height = (_registrationHeight = _arg2);
switch (_scaleMode){
case VideoScaleMode.MAINTAIN_ASPECT_RATIO:
case VideoScaleMode.NO_SCALE:
startAutoResize();
break;
default:
super.x = _registrationX;
super.y = _registrationY;
break;
};
}
flvplayback_internal function isXnOK():Boolean{
if (_state == VideoState.LOADING){
return (true);
};
if (_state == VideoState.CONNECTION_ERROR){
return (false);
};
if (_state != VideoState.DISCONNECTED){
if ((((((_ncMgr == null)) || ((_ncMgr.netConnection == null)))) || (!(_ncMgr.netConnection.connected)))){
setState(VideoState.DISCONNECTED);
return (false);
};
return (true);
};
return (false);
}
flvplayback_internal function _createStream():void{
var _local1:NetStream;
_ns = null;
_local1 = new NetStream(_ncMgr.netConnection);
if (_ncMgr.isRTMP){
_local1.addEventListener(NetStatusEvent.NET_STATUS, rtmpNetStatus);
} else {
_local1.addEventListener(NetStatusEvent.NET_STATUS, httpNetStatus);
};
_local1.client = new VideoPlayerClient(this);
_local1.bufferTime = _bufferTime;
_local1.soundTransform = soundTransform;
_ns = _local1;
attachNetStream(_ns);
}
flvplayback_internal function checkReadyForPlay(_arg1:uint, _arg2:uint):void{
var _local3:Number;
if (_arg1 >= _arg2){
waitingForEnough = false;
_cachedState = _state;
_state = VideoState.EXEC_QUEUED_CMD;
play();
execQueuedCmds();
return;
};
if (isNaN(baselineProgressTime)){
return;
};
if (((isNaN(totalTime)) || ((totalTime < 0)))){
waitingForEnough = false;
_cachedState = _state;
_state = VideoState.EXEC_QUEUED_CMD;
play();
execQueuedCmds();
} else {
if (totalDownloadTime > 1.5){
_local3 = ((totalProgressTime - baselineProgressTime) / totalDownloadTime);
if ((totalTime - playheadTime) > ((totalTime - totalProgressTime) / _local3)){
waitingForEnough = false;
_cachedState = _state;
_state = VideoState.EXEC_QUEUED_CMD;
play();
execQueuedCmds();
};
};
};
}
flvplayback_internal function closeNS(_arg1:Boolean=false):void{
if (_ns != null){
if (_arg1){
_updateTimeTimer.reset();
doUpdateTime();
_currentPos = _ns.time;
};
_ns.removeEventListener(NetStatusEvent.NET_STATUS, rtmpNetStatus);
_ns.removeEventListener(NetStatusEvent.NET_STATUS, httpNetStatus);
_ns.close();
_ns = null;
};
}
flvplayback_internal function _load(_arg1:String, _arg2:Number, _arg3:Boolean):void{
var _local4:Boolean;
_prevVideoWidth = super.videoWidth;
_prevVideoHeight = super.videoHeight;
_autoResizeDone = false;
_cachedPlayheadTime = 0;
_bufferState = BUFFER_EMPTY;
_sawPlayStop = false;
_metadata = null;
_startingPlay = false;
_invalidSeekTime = false;
_invalidSeekRecovery = false;
_isLive = _arg3;
_contentPath = _arg1;
_currentPos = 0;
_streamLength = (((isNaN(_arg2)) || ((_arg2 <= 0)))) ? NaN : _arg2;
_atEnd = false;
_readyDispatched = false;
_lastUpdateTime = NaN;
lastUpdateTimeStuckCount = 0;
_sawSeekNotify = false;
waitingForEnough = false;
baselineProgressTime = NaN;
startProgressTime = NaN;
totalDownloadTime = NaN;
totalProgressTime = NaN;
_updateTimeTimer.reset();
_updateProgressTimer.reset();
_idleTimeoutTimer.reset();
_autoResizeTimer.reset();
_rtmpDoStopAtEndTimer.reset();
_rtmpDoSeekTimer.reset();
_httpDoSeekTimer.reset();
_finishAutoResizeTimer.reset();
_delayedBufferingTimer.reset();
closeNS(false);
if (_ncMgr == null){
createINCManager();
};
_local4 = _ncMgr.connectToURL(_contentPath);
setState(VideoState.LOADING);
_cachedState = VideoState.LOADING;
if (_local4){
_createStream();
_setUpStream();
};
if (!_ncMgr.isRTMP){
_updateProgressTimer.start();
};
}
flvplayback_internal function rtmpDoStopAtEnd(_arg1:TimerEvent=null):void{
if (_rtmpDoStopAtEndTimer.running){
switch (_state){
case VideoState.DISCONNECTED:
case VideoState.CONNECTION_ERROR:
_rtmpDoStopAtEndTimer.reset();
return;
};
if ((((_arg1 == null)) || ((_cachedPlayheadTime == playheadTime)))){
_rtmpDoStopAtEndTimer.reset();
} else {
_cachedPlayheadTime = playheadTime;
return;
};
};
if ((((((_atEndCheckPlayhead == playheadTime)) && (!(_isLive)))) && (!((playheadTime == 0))))){
_atEnd = false;
_currentPos = 0;
_play(0);
return;
};
_atEndCheckPlayhead = NaN;
_bufferState = BUFFER_EMPTY;
_sawPlayStop = false;
_atEnd = true;
setState(VideoState.STOPPED);
if (_state != VideoState.STOPPED){
return;
};
doUpdateTime();
if (_state != VideoState.STOPPED){
return;
};
dispatchEvent(new VideoEvent(VideoEvent.COMPLETE, false, false, _state, playheadTime));
if (_state != VideoState.STOPPED){
return;
};
if (((((_autoRewind) && (!(_isLive)))) && (!((playheadTime == 0))))){
_atEnd = false;
_currentPos = 0;
_play(0, 0);
setState(VideoState.REWINDING);
} else {
closeNS();
};
}
public function set idleTimeout(_arg1:Number):void{
_idleTimeoutTimer.delay = _arg1;
}
public function set playheadUpdateInterval(_arg1:Number):void{
_updateTimeTimer.delay = _arg1;
}
flvplayback_internal function checkEnoughDownloaded(_arg1:uint, _arg2:uint):void{
if ((((_arg1 == 0)) || ((_arg2 == uint.MAX_VALUE)))){
return;
};
if (((isNaN(totalTime)) || ((totalTime <= 0)))){
if (((waitingForEnough) && (stateResponsive))){
waitingForEnough = false;
_cachedState = _state;
_state = VideoState.EXEC_QUEUED_CMD;
play();
execQueuedCmds();
};
return;
};
if (_arg1 >= _arg2){
if (waitingForEnough){
waitingForEnough = false;
_cachedState = _state;
_state = VideoState.EXEC_QUEUED_CMD;
play();
execQueuedCmds();
};
return;
};
if (isNaN(baselineProgressTime)){
baselineProgressTime = ((_arg1 / _arg2) * totalTime);
};
if (isNaN(startProgressTime)){
startProgressTime = getTimer();
} else {
totalDownloadTime = ((getTimer() - startProgressTime) / 1000);
totalProgressTime = ((_arg1 / _arg2) * totalTime);
if (waitingForEnough){
checkReadyForPlay(_arg1, _arg2);
};
};
}
public function close():void{
closeNS(true);
if (((!((_ncMgr == null))) && (_ncMgr.isRTMP))){
_ncMgr.close();
};
setState(VideoState.DISCONNECTED);
dispatchEvent(new VideoEvent(VideoEvent.CLOSE, false, false, _state, playheadTime));
}
public function pause():void{
if (!isXnOK()){
if ((((((_state == VideoState.CONNECTION_ERROR)) || ((_ncMgr == null)))) || ((_ncMgr.netConnection == null)))){
throw (new VideoError(VideoError.NO_CONNECTION));
};
return;
} else {
if (_state == VideoState.EXEC_QUEUED_CMD){
_state = _cachedState;
} else {
if (!stateResponsive){
queueCmd(QueuedCommand.PAUSE);
return;
};
execQueuedCmds();
};
};
if ((((((_state == VideoState.PAUSED)) || ((_state == VideoState.STOPPED)))) || ((_ns == null)))){
return;
};
_pause(true);
setState(VideoState.PAUSED);
}
}
}//package fl.video
Section 104
//VideoPlayerClient (fl.video.VideoPlayerClient)
package fl.video {
public dynamic class VideoPlayerClient {
private var _owner:VideoPlayer;
public function VideoPlayerClient(_arg1:VideoPlayer){
_owner = _arg1;
}
public function get owner():VideoPlayer{
return (_owner);
}
public function onCuePoint(_arg1:Object, ... _args):void{
_owner.onCuePoint(_arg1);
}
public function onMetaData(_arg1:Object, ... _args):void{
_owner.onMetaData(_arg1);
}
}
}//package fl.video
Section 105
//VideoPlayerState (fl.video.VideoPlayerState)
package fl.video {
public class VideoPlayerState {
public var autoPlay:Boolean;
public var isWaiting:Boolean;
public var isLiveSet:Boolean;
public var index:int;
public var prevState:String;
public var preSeekTime:Number;
public var minProgressPercent:Number;
public var url:String;
public var totalTime:Number;
public var owner:VideoPlayer;
public var isLive:Boolean;
public var cmdQueue:Array;
public var totalTimeSet:Boolean;
public function VideoPlayerState(_arg1:VideoPlayer, _arg2:int){
this.owner = _arg1;
this.index = _arg2;
this.url = "";
this.isLive = false;
this.isLiveSet = true;
this.totalTime = NaN;
this.totalTimeSet = true;
this.autoPlay = (_arg2 == 0);
this.isWaiting = false;
this.preSeekTime = NaN;
this.cmdQueue = null;
}
}
}//package fl.video
Section 106
//VideoProgressEvent (fl.video.VideoProgressEvent)
package fl.video {
import flash.events.*;
public class VideoProgressEvent extends ProgressEvent implements IVPEvent {
private var _vp:uint;
public static const PROGRESS:String = "progress";
public function VideoProgressEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false, _arg4:uint=0, _arg5:uint=0, _arg6:uint=0){
super(_arg1, _arg2, _arg3, _arg4, _arg5);
_vp = _arg6;
}
override public function clone():Event{
return (new VideoProgressEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal, vp));
}
public function set vp(_arg1:uint):void{
_vp = _arg1;
}
public function get vp():uint{
return (_vp);
}
}
}//package fl.video
Section 107
//VideoScaleMode (fl.video.VideoScaleMode)
package fl.video {
public final class VideoScaleMode {
public static const EXACT_FIT:String = "exactFit";
public static const MAINTAIN_ASPECT_RATIO:String = "maintainAspectRatio";
public static const NO_SCALE:String = "noScale";
}
}//package fl.video
Section 108
//VideoState (fl.video.VideoState)
package fl.video {
public final class VideoState {
public static const CONNECTION_ERROR:String = "connectionError";
public static const BUFFERING:String = "buffering";
public static const SEEKING:String = "seeking";
public static const STOPPED:String = "stopped";
public static const PAUSED:String = "paused";
public static const RESIZING:String = "resizing";
public static const PLAYING:String = "playing";
public static const DISCONNECTED:String = "disconnected";
public static const LOADING:String = "loading";
public static const REWINDING:String = "rewinding";
flvplayback_internal static var EXEC_QUEUED_CMD:String = "execQueuedCmd";
}
}//package fl.video
Section 109
//bigHeart_105 (TofuBoy_fla.bigHeart_105)
package TofuBoy_fla {
import flash.display.*;
public dynamic class bigHeart_105 extends MovieClip {
public function bigHeart_105(){
addFrameScript(3, frame4, 9, frame10);
}
function frame10(){
stop();
}
function frame4(){
stop();
}
}
}//package TofuBoy_fla
Section 110
//bigHeart_33 (TofuBoy_fla.bigHeart_33)
package TofuBoy_fla {
import flash.display.*;
public dynamic class bigHeart_33 extends MovieClip {
public function bigHeart_33(){
addFrameScript(3, frame4, 9, frame10);
}
function frame10(){
stop();
}
function frame4(){
stop();
}
}
}//package TofuBoy_fla
Section 111
//cutSceneBG_02_13 (TofuBoy_fla.cutSceneBG_02_13)
package TofuBoy_fla {
import flash.display.*;
public dynamic class cutSceneBG_02_13 extends MovieClip {
public var girl:MovieClip;
public function cutSceneBG_02_13(){
addFrameScript(8, frame9, 9, frame10, 65, frame66);
}
function frame10(){
girl.gotoAndPlay("walk");
}
function frame9(){
stop();
}
function frame66(){
girl.gotoAndStop("standing");
stop();
}
}
}//package TofuBoy_fla
Section 112
//cutSceneBG_02_89 (TofuBoy_fla.cutSceneBG_02_89)
package TofuBoy_fla {
import flash.display.*;
public dynamic class cutSceneBG_02_89 extends MovieClip {
public var girl:MovieClip;
public function cutSceneBG_02_89(){
addFrameScript(8, frame9, 65, frame66);
}
function frame9(){
stop();
}
function frame66(){
stop();
}
}
}//package TofuBoy_fla
Section 113
//cutSceneBG_03_22 (TofuBoy_fla.cutSceneBG_03_22)
package TofuBoy_fla {
import flash.display.*;
public dynamic class cutSceneBG_03_22 extends MovieClip {
public function cutSceneBG_03_22(){
addFrameScript(8, frame9, 59, frame60);
}
function frame9(){
stop();
}
function frame60(){
stop();
}
}
}//package TofuBoy_fla
Section 114
//cutSceneBG_03_97 (TofuBoy_fla.cutSceneBG_03_97)
package TofuBoy_fla {
import flash.display.*;
public dynamic class cutSceneBG_03_97 extends MovieClip {
public function cutSceneBG_03_97(){
addFrameScript(8, frame9, 59, frame60);
}
function frame9(){
stop();
}
function frame60(){
stop();
}
}
}//package TofuBoy_fla
Section 115
//cutSceneBG_03copy_24 (TofuBoy_fla.cutSceneBG_03copy_24)
package TofuBoy_fla {
import flash.display.*;
public dynamic class cutSceneBG_03copy_24 extends MovieClip {
public function cutSceneBG_03copy_24(){
addFrameScript(8, frame9, 59, frame60);
}
function frame9(){
stop();
}
function frame60(){
gotoAndPlay("animate");
}
}
}//package TofuBoy_fla
Section 116
//cutSceneBG_03copy_98 (TofuBoy_fla.cutSceneBG_03copy_98)
package TofuBoy_fla {
import flash.display.*;
public dynamic class cutSceneBG_03copy_98 extends MovieClip {
public function cutSceneBG_03copy_98(){
addFrameScript(8, frame9, 59, frame60);
}
function frame9(){
stop();
}
function frame60(){
gotoAndPlay("animate");
}
}
}//package TofuBoy_fla
Section 117
//emailIconMC_44 (TofuBoy_fla.emailIconMC_44)
package TofuBoy_fla {
import flash.display.*;
public dynamic class emailIconMC_44 extends MovieClip {
public function emailIconMC_44(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
}
}//package TofuBoy_fla
Section 118
//facebookIcon_38 (TofuBoy_fla.facebookIcon_38)
package TofuBoy_fla {
import flash.display.*;
public dynamic class facebookIcon_38 extends MovieClip {
public function facebookIcon_38(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
}
}//package TofuBoy_fla
Section 119
//girl_28 (TofuBoy_fla.girl_28)
package TofuBoy_fla {
import flash.display.*;
public dynamic class girl_28 extends MovieClip {
public var whichFrame:String;
public function girl_28(){
addFrameScript(54, frame55);
}
function frame55(){
whichFrame = ("blink" + String(Math.ceil((Math.random() * 4))));
gotoAndPlay(whichFrame);
}
}
}//package TofuBoy_fla
Section 120
//girl_83 (TofuBoy_fla.girl_83)
package TofuBoy_fla {
import flash.display.*;
public dynamic class girl_83 extends MovieClip {
public var whichFrame:String;
public function girl_83(){
addFrameScript(54, frame55);
}
function frame55(){
whichFrame = ("blink" + String(Math.ceil((Math.random() * 4))));
gotoAndPlay(whichFrame);
}
}
}//package TofuBoy_fla
Section 121
//girlBody_17 (TofuBoy_fla.girlBody_17)
package TofuBoy_fla {
import flash.display.*;
public dynamic class girlBody_17 extends MovieClip {
public function girlBody_17(){
addFrameScript(3, frame4, 18, frame19);
}
function frame19(){
gotoAndPlay("walk");
}
function frame4(){
stop();
}
}
}//package TofuBoy_fla
Section 122
//girlBody_91 (TofuBoy_fla.girlBody_91)
package TofuBoy_fla {
import flash.display.*;
public dynamic class girlBody_91 extends MovieClip {
public function girlBody_91(){
addFrameScript(3, frame4, 18, frame19);
}
function frame19(){
gotoAndPlay("walk");
}
function frame4(){
stop();
}
}
}//package TofuBoy_fla
Section 123
//heart01_102 (TofuBoy_fla.heart01_102)
package TofuBoy_fla {
import flash.display.*;
public dynamic class heart01_102 extends MovieClip {
public function heart01_102(){
addFrameScript(3, frame4, 9, frame10);
}
function frame10(){
stop();
}
function frame4(){
stop();
}
}
}//package TofuBoy_fla
Section 124
//heart01_30 (TofuBoy_fla.heart01_30)
package TofuBoy_fla {
import flash.display.*;
public dynamic class heart01_30 extends MovieClip {
public function heart01_30(){
addFrameScript(3, frame4, 9, frame10);
}
function frame10(){
stop();
}
function frame4(){
stop();
}
}
}//package TofuBoy_fla
Section 125
//innerMov_55 (TofuBoy_fla.innerMov_55)
package TofuBoy_fla {
import flash.display.*;
public dynamic class innerMov_55 extends MovieClip {
public function innerMov_55(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package TofuBoy_fla
Section 126
//innerMovRight_57 (TofuBoy_fla.innerMovRight_57)
package TofuBoy_fla {
import flash.display.*;
public dynamic class innerMovRight_57 extends MovieClip {
public function innerMovRight_57(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package TofuBoy_fla
Section 127
//innerThumper_49 (TofuBoy_fla.innerThumper_49)
package TofuBoy_fla {
import flash.display.*;
public dynamic class innerThumper_49 extends MovieClip {
public function innerThumper_49(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package TofuBoy_fla
Section 128
//innerTofu_86 (TofuBoy_fla.innerTofu_86)
package TofuBoy_fla {
import flash.display.*;
public dynamic class innerTofu_86 extends MovieClip {
public function innerTofu_86(){
addFrameScript(0, frame1, 1, frame2, 14, frame15, 15, frame16, 21, frame22, 31, frame32);
}
function frame15(){
gotoAndPlay("run");
}
function frame16(){
gotoAndPlay("run");
}
function frame1(){
stop();
}
function frame22(){
stop();
}
function frame2(){
stop();
}
function frame32(){
stop();
}
}
}//package TofuBoy_fla
Section 129
//logoMC_82 (TofuBoy_fla.logoMC_82)
package TofuBoy_fla {
import flash.display.*;
public dynamic class logoMC_82 extends MovieClip {
public function logoMC_82(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
}
}//package TofuBoy_fla
Section 130
//meatboy_25 (TofuBoy_fla.meatboy_25)
package TofuBoy_fla {
import flash.display.*;
public dynamic class meatboy_25 extends MovieClip {
public var whichFrame:String;
public function meatboy_25(){
addFrameScript(54, frame55);
}
function frame55(){
whichFrame = ("blink" + String(Math.ceil((Math.random() * 4))));
gotoAndPlay(whichFrame);
}
}
}//package TofuBoy_fla
Section 131
//meatboy_29 (TofuBoy_fla.meatboy_29)
package TofuBoy_fla {
import flash.display.*;
public dynamic class meatboy_29 extends MovieClip {
public var whichFrame:String;
public function meatboy_29(){
addFrameScript(54, frame55);
}
function frame55(){
whichFrame = ("blink" + String(Math.ceil((Math.random() * 4))));
gotoAndPlay(whichFrame);
}
}
}//package TofuBoy_fla
Section 132
//meatboyA_14 (TofuBoy_fla.meatboyA_14)
package TofuBoy_fla {
import flash.display.*;
public dynamic class meatboyA_14 extends MovieClip {
public var whichFrame:String;
public function meatboyA_14(){
addFrameScript(54, frame55);
}
function frame55(){
whichFrame = ("blink" + String(Math.ceil((Math.random() * 4))));
gotoAndPlay(whichFrame);
}
}
}//package TofuBoy_fla
Section 133
//meatBoyBody_107 (TofuBoy_fla.meatBoyBody_107)
package TofuBoy_fla {
import flash.display.*;
public dynamic class meatBoyBody_107 extends MovieClip {
public var rightLeg:MovieClip;
public var leftLeg:MovieClip;
public var rightArm:MovieClip;
public var leftArm:MovieClip;
}
}//package TofuBoy_fla
Section 134
//MySpaceMC_42 (TofuBoy_fla.MySpaceMC_42)
package TofuBoy_fla {
import flash.display.*;
public dynamic class MySpaceMC_42 extends MovieClip {
public function MySpaceMC_42(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
}
}//package TofuBoy_fla
Section 135
//soundIconMC_46 (TofuBoy_fla.soundIconMC_46)
package TofuBoy_fla {
import flash.display.*;
public dynamic class soundIconMC_46 extends MovieClip {
public function soundIconMC_46(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package TofuBoy_fla
Section 136
//TofuBoy_10 (TofuBoy_fla.TofuBoy_10)
package TofuBoy_fla {
import flash.display.*;
public dynamic class TofuBoy_10 extends MovieClip {
public var whichFrame:String;
public function TofuBoy_10(){
addFrameScript(54, frame55);
}
function frame55(){
whichFrame = ("blink" + String(Math.ceil((Math.random() * 4))));
gotoAndPlay(whichFrame);
}
}
}//package TofuBoy_fla
Section 137
//TofuBoy_112 (TofuBoy_fla.TofuBoy_112)
package TofuBoy_fla {
import flash.display.*;
public dynamic class TofuBoy_112 extends MovieClip {
public var whichFrame:String;
public function TofuBoy_112(){
addFrameScript(54, frame55);
}
function frame55(){
whichFrame = ("blink" + String(Math.ceil((Math.random() * 4))));
gotoAndPlay(whichFrame);
}
}
}//package TofuBoy_fla
Section 138
//tofuBoy_16 (TofuBoy_fla.tofuBoy_16)
package TofuBoy_fla {
import flash.display.*;
public dynamic class tofuBoy_16 extends MovieClip {
public var whichFrame:String;
public function tofuBoy_16(){
addFrameScript(54, frame55);
}
function frame55(){
whichFrame = ("blink" + String(Math.ceil((Math.random() * 4))));
gotoAndPlay(whichFrame);
}
}
}//package TofuBoy_fla
Section 139
//tofuBoy_90 (TofuBoy_fla.tofuBoy_90)
package TofuBoy_fla {
import flash.display.*;
public dynamic class tofuBoy_90 extends MovieClip {
public var whichFrame:String;
public function tofuBoy_90(){
addFrameScript(54, frame55);
}
function frame55(){
whichFrame = ("blink" + String(Math.ceil((Math.random() * 4))));
gotoAndPlay(whichFrame);
}
}
}//package TofuBoy_fla
Section 140
//TwitterIconMC_40 (TofuBoy_fla.TwitterIconMC_40)
package TofuBoy_fla {
import flash.display.*;
public dynamic class TwitterIconMC_40 extends MovieClip {
public function TwitterIconMC_40(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
}
}//package TofuBoy_fla
Section 141
//wrapperBTN_36 (TofuBoy_fla.wrapperBTN_36)
package TofuBoy_fla {
import flash.display.*;
import flash.text.*;
public dynamic class wrapperBTN_36 extends MovieClip {
public var blocker:btnBlocker;
public var btnText:TextField;
}
}//package TofuBoy_fla
Section 142
//wrapperBTNVideo_37 (TofuBoy_fla.wrapperBTNVideo_37)
package TofuBoy_fla {
import flash.display.*;
import flash.text.*;
public dynamic class wrapperBTNVideo_37 extends MovieClip {
public var btnText:TextField;
}
}//package TofuBoy_fla
Section 143
//FLVPlaybackUtils (tools.FLVPlaybackUtils)
package tools {
import fl.video.*;
import flash.utils.*;
public class FLVPlaybackUtils {
public static function resetVid(_arg1:FLVPlayback):void{
destroy(_arg1);
reSetup(_arg1);
}
private static function destroy(_arg1:FLVPlayback):void{
var _local2:VideoPlayer;
if (_arg1.playing){
_arg1.stop();
};
for each (_local2 in _arg1.flvplayback_internal::videoPlayers) {
_local2.close();
};
}
private static function reSetup(_arg1:FLVPlayback):void{
var _local2:VideoPlayer;
_local2 = new VideoPlayer(0, 0);
_local2.setSize(_arg1.width, _arg1.height);
_arg1.flvplayback_internal::videoPlayers = new Array();
_arg1.flvplayback_internal::videoPlayers[0] = _local2;
_arg1.flvplayback_internal::_firstStreamShown = false;
_arg1.flvplayback_internal::_firstStreamReady = false;
_arg1.flvplayback_internal::videoPlayerStates = new Array();
_arg1.flvplayback_internal::videoPlayerStateDict = new Dictionary(true);
var _local3 = _arg1;
_local3.flvplayback_internal::createVideoPlayer(0);
}
}
}//package tools
Section 144
//ShowFPS (tools.ShowFPS)
package tools {
import flash.events.*;
import flash.display.*;
import flash.text.*;
import flash.utils.*;
public class ShowFPS extends Sprite {
private var FPS_Timer:Timer;
private var fps_Interval:Number;
private var frameCount:Number;// = 0
public var FPS_Field:TextField;
public function ShowFPS(){
frameCount = 0;
super();
FPS_Field = new TextField();
this.addChild(FPS_Field);
FPS_Field.border = true;
FPS_Field.background = true;
FPS_Field.height = 20;
FPS_Field.y = 0;
FPS_Timer = new Timer(1000, 0);
FPS_Timer.start();
FPS_Timer.addEventListener(TimerEvent.TIMER, updateFPS);
this.addEventListener(Event.ENTER_FRAME, frameFunction);
}
private function updateFPS(_arg1:Event){
FPS_Field.text = ("FPS: " + frameCount);
frameCount = 0;
}
private function frameFunction(_arg1:Event){
frameCount++;
}
public function removeFPS():void{
FPS_Timer.removeEventListener(TimerEvent.TIMER, updateFPS);
this.removeEventListener(Event.ENTER_FRAME, frameFunction);
}
}
}//package tools
Section 145
//StringUtils (tools.StringUtils)
package tools {
public class StringUtils {
private static function _swapCase(_arg1:String, ... _args):String{
var _local3:String;
var _local4:String;
_local3 = _arg1.toLowerCase();
_local4 = _arg1.toUpperCase();
switch (_arg1){
case _local3:
return (_local4);
case _local4:
return (_local3);
default:
return (_arg1);
};
}
public static function isEmpty(_arg1:String):Boolean{
if (_arg1 == null){
return (true);
};
return (!(_arg1.length));
}
public static function remove(_arg1:String, _arg2:String, _arg3:Boolean=true):String{
var _local4:String;
var _local5:String;
if (_arg1 == null){
return ("");
};
_local4 = escapePattern(_arg2);
_local5 = (_arg3) ? "g" : "ig";
return (_arg1.replace(new RegExp(_local4, _local5), ""));
}
public static function countOf(_arg1:String, _arg2:String, _arg3:Boolean=true):uint{
var _local4:String;
var _local5:String;
if (_arg1 == null){
return (0);
};
_local4 = escapePattern(_arg2);
_local5 = (_arg3) ? "g" : "ig";
return (_arg1.match(new RegExp(_local4, _local5)).length);
}
public static function between(_arg1:String, _arg2:String, _arg3:String):String{
var _local4:String;
var _local5:int;
var _local6:int;
_local4 = "";
if (_arg1 == null){
return (_local4);
};
_local5 = _arg1.indexOf(_arg2);
if (_local5 != -1){
_local5 = (_local5 + _arg2.length);
_local6 = _arg1.indexOf(_arg3, _local5);
if (_local6 != -1){
_local4 = _arg1.substr(_local5, (_local6 - _local5));
};
};
return (_local4);
}
public static function padRight(_arg1:String, _arg2:String, _arg3:uint):String{
var _local4:String;
_local4 = _arg1;
while (_local4.length < _arg3) {
_local4 = (_local4 + _arg2);
};
return (_local4);
}
public static function isNumeric(_arg1:String):Boolean{
var _local2:RegExp;
if (_arg1 == null){
return (false);
};
_local2 = /^[-+]?\d*\.?\d+(?:[eE][-+]?\d+)?$/;
return (_local2.test(_arg1));
}
public static function block(_arg1:String, _arg2:uint, _arg3:String="."):Array{
var _local4:Array;
var _local5:uint;
var _local6:uint;
var _local7:RegExp;
var _local8:String;
_local4 = new Array();
if ((((_arg1 == null)) || (!(contains(_arg1, _arg3))))){
return (_local4);
};
_local5 = 0;
_local6 = _arg1.length;
_local7 = new RegExp((("[^" + escapePattern(_arg3)) + "]+$"));
while (_local5 < _local6) {
_local8 = _arg1.substr(_local5, _arg2);
if (!contains(_local8, _arg3)){
_local4.push(truncate(_local8, _local8.length));
_local5 = (_local5 + _local8.length);
};
_local8 = _local8.replace(_local7, "");
_local4.push(_local8);
_local5 = (_local5 + _local8.length);
};
return (_local4);
}
public static function trim(_arg1:String):String{
if (_arg1 == null){
return ("");
};
return (_arg1.replace(/^\s+|\s+$/g, ""));
}
public static function beginsWith(_arg1:String, _arg2:String):Boolean{
if (_arg1 == null){
return (false);
};
return ((_arg1.indexOf(_arg2) == 0));
}
public static function stripTags(_arg1:String):String{
if (_arg1 == null){
return ("");
};
return (_arg1.replace(/<\/?[^>]+>/igm, ""));
}
public static function afterLast(_arg1:String, _arg2:String):String{
var _local3:int;
if (_arg1 == null){
return ("");
};
_local3 = _arg1.lastIndexOf(_arg2);
if (_local3 == -1){
return ("");
};
_local3 = (_local3 + _arg2.length);
return (_arg1.substr(_local3));
}
private static function _minimum(_arg1:uint, _arg2:uint, _arg3:uint):uint{
return (Math.min(_arg1, Math.min(_arg2, Math.min(_arg3, _arg1))));
}
private static function escapePattern(_arg1:String):String{
return (_arg1.replace(/(\]|\[|\{|\}|\(|\)|\*|\+|\?|\.|\\)/g, "\\$1"));
}
public static function removeExtraWhitespace(_arg1:String):String{
var _local2:String;
if (_arg1 == null){
return ("");
};
_local2 = trim(_arg1);
return (_local2.replace(/\s+/g, " "));
}
public static function trimRight(_arg1:String):String{
if (_arg1 == null){
return ("");
};
return (_arg1.replace(/\s+$/, ""));
}
public static function endsWith(_arg1:String, _arg2:String):Boolean{
return ((_arg1.lastIndexOf(_arg2) == (_arg1.length - _arg2.length)));
}
public static function contains(_arg1:String, _arg2:String):Boolean{
if (_arg1 == null){
return (false);
};
return (!((_arg1.indexOf(_arg2) == -1)));
}
public static function properCase(_arg1:String):String{
var _local2:String;
if (_arg1 == null){
return ("");
};
_local2 = _arg1.toLowerCase().replace(/\b([^.?;!]+)/, capitalize);
return (_local2.replace(/\b[i]\b/, "I"));
}
public static function trimLeft(_arg1:String):String{
if (_arg1 == null){
return ("");
};
return (_arg1.replace(/^\s+/, ""));
}
public static function similarity(_arg1:String, _arg2:String):Number{
var _local3:uint;
var _local4:uint;
_local3 = editDistance(_arg1, _arg2);
_local4 = Math.max(_arg1.length, _arg2.length);
if (_local4 == 0){
return (100);
};
return (((1 - (_local3 / _local4)) * 100));
}
public static function wordCount(_arg1:String):uint{
if (_arg1 == null){
return (0);
};
return (_arg1.match(/\b\w+\b/g).length);
}
public static function editDistance(_arg1:String, _arg2:String):uint{
var _local3:uint;
var _local4:Array;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local8:uint;
var _local9:String;
var _local10:String;
if (_arg1 == null){
_arg1 = "";
};
if (_arg2 == null){
_arg2 = "";
};
if (_arg1 == _arg2){
return (0);
};
_local4 = new Array();
_local6 = _arg1.length;
_local7 = _arg2.length;
if (_local6 == 0){
return (_local7);
};
if (_local7 == 0){
return (_local6);
};
_local3 = 0;
while (_local3 <= _local6) {
_local4[_local3] = new Array();
_local3++;
};
_local3 = 0;
while (_local3 <= _local6) {
_local4[_local3][0] = _local3;
_local3++;
};
_local8 = 0;
while (_local8 <= _local7) {
_local4[0][_local8] = _local8;
_local8++;
};
_local3 = 1;
while (_local3 <= _local6) {
_local9 = _arg1.charAt((_local3 - 1));
_local8 = 1;
while (_local8 <= _local7) {
_local10 = _arg2.charAt((_local8 - 1));
if (_local9 == _local10){
_local5 = 0;
} else {
_local5 = 1;
};
_local4[_local3][_local8] = _minimum((_local4[(_local3 - 1)][_local8] + 1), (_local4[_local3][(_local8 - 1)] + 1), (_local4[(_local3 - 1)][(_local8 - 1)] + _local5));
_local8++;
};
_local3++;
};
return (_local4[_local6][_local7]);
}
public static function hasText(_arg1:String):Boolean{
var _local2:String;
_local2 = removeExtraWhitespace(_arg1);
return (!(!(_local2.length)));
}
public static function reverse(_arg1:String):String{
if (_arg1 == null){
return ("");
};
return (_arg1.split("").reverse().join(""));
}
public static function swapCase(_arg1:String):String{
if (_arg1 == null){
return ("");
};
return (_arg1.replace(/(\w)/, _swapCase));
}
public static function capitalize(_arg1:String, ... _args):String{
var _local3:String;
_local3 = trimLeft(_arg1);
trace("capl", _args[0]);
if (_args[0] === true){
return (_local3.replace(/^.|\b./g, _upperCase));
};
return (_local3.replace(/(^\w)/, _upperCase));
}
public static function truncate(_arg1:String, _arg2:uint, _arg3:String="..."):String{
var _local4:String;
if (_arg1 == null){
return ("");
};
_arg2 = (_arg2 - _arg3.length);
_local4 = _arg1;
if (_local4.length > _arg2){
_local4 = _local4.substr(0, _arg2);
if (/[^\s]/.test(_arg1.charAt(_arg2))){
_local4 = trimRight(_local4.replace(/\w+$|\s+$/, ""));
};
_local4 = (_local4 + _arg3);
};
return (_local4);
}
public static function reverseWords(_arg1:String):String{
if (_arg1 == null){
return ("");
};
return (_arg1.split(/\s+/).reverse().join(""));
}
public static function beforeFirst(_arg1:String, _arg2:String):String{
var _local3:int;
if (_arg1 == null){
return ("");
};
_local3 = _arg1.indexOf(_arg2);
if (_local3 == -1){
return ("");
};
return (_arg1.substr(0, _local3));
}
private static function _upperCase(_arg1:String, ... _args):String{
trace("cap latter ", _arg1);
return (_arg1.toUpperCase());
}
public static function afterFirst(_arg1:String, _arg2:String):String{
var _local3:int;
if (_arg1 == null){
return ("");
};
_local3 = _arg1.indexOf(_arg2);
if (_local3 == -1){
return ("");
};
_local3 = (_local3 + _arg2.length);
return (_arg1.substr(_local3));
}
public static function beforeLast(_arg1:String, _arg2:String):String{
var _local3:int;
if (_arg1 == null){
return ("");
};
_local3 = _arg1.lastIndexOf(_arg2);
if (_local3 == -1){
return ("");
};
return (_arg1.substr(0, _local3));
}
public static function padLeft(_arg1:String, _arg2:String, _arg3:uint):String{
var _local4:String;
_local4 = _arg1;
while (_local4.length < _arg3) {
_local4 = (_arg2 + _local4);
};
return (_local4);
}
public static function quote(_arg1:String):String{
var _local2:RegExp;
_local2 = /[\\"\r\n]/g;
return ((("\"" + _arg1.replace(_local2, _quote)) + "\""));
}
private static function _quote(_arg1:String, ... _args):String{
switch (_arg1){
case "\\":
return ("\\\\");
case "\r":
return ("\\r");
case "\n":
return ("\\n");
case "\"":
return ("\\\"");
default:
return ("");
};
}
}
}//package tools
Section 146
//arial (arial)
package {
import flash.text.*;
public dynamic class arial extends Font {
}
}//package
Section 147
//Avatar (Avatar)
package {
import flash.display.*;
public dynamic class Avatar extends MovieClip {
public var innerTofu:MovieClip;
}
}//package
Section 148
//bandAid (bandAid)
package {
import flash.media.*;
public dynamic class bandAid extends Sound {
}
}//package
Section 149
//beltLeft (beltLeft)
package {
import flash.display.*;
public dynamic class beltLeft extends MovieClip {
public var topTrack:MovieClip;
}
}//package
Section 150
//beltRight (beltRight)
package {
import flash.display.*;
public dynamic class beltRight extends MovieClip {
public var topTrack:MovieClip;
}
}//package
Section 151
//bigSlat (bigSlat)
package {
import flash.display.*;
public dynamic class bigSlat extends MovieClip {
}
}//package
Section 152
//blade (blade)
package {
import flash.display.*;
public dynamic class blade extends MovieClip {
public function blade(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 153
//bladeSound (bladeSound)
package {
import flash.media.*;
public dynamic class bladeSound extends Sound {
}
}//package
Section 154
//Blood1 (Blood1)
package {
import flash.display.*;
public dynamic class Blood1 extends MovieClip {
public function Blood1(){
addFrameScript(0, frame1, 9, frame10, 19, frame20, 29, frame30, 39, frame40);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
function frame20(){
stop();
}
function frame30(){
stop();
}
function frame40(){
stop();
}
}
}//package
Section 155
//Blood2 (Blood2)
package {
import flash.display.*;
public dynamic class Blood2 extends MovieClip {
public function Blood2(){
addFrameScript(0, frame1, 9, frame10, 19, frame20, 29, frame30, 39, frame40);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
function frame20(){
stop();
}
function frame30(){
stop();
}
function frame40(){
stop();
}
}
}//package
Section 156
//boing (boing)
package {
import flash.media.*;
public dynamic class boing extends Sound {
}
}//package
Section 157
//border1 (border1)
package {
import flash.display.*;
public dynamic class border1 extends MovieClip {
public var frame3:MovieClip;
public var frame1:MovieClip;
public var frame2:MovieClip;
}
}//package
Section 158
//border2 (border2)
package {
import flash.display.*;
public dynamic class border2 extends MovieClip {
public var frame3:MovieClip;
public var frame1:MovieClip;
public var frame2:MovieClip;
}
}//package
Section 159
//btnBlocker (btnBlocker)
package {
import flash.display.*;
public dynamic class btnBlocker extends MovieClip {
}
}//package
Section 160
//Bullet (Bullet)
package {
import flash.display.*;
public dynamic class Bullet extends MovieClip {
}
}//package
Section 161
//BulletSplat (BulletSplat)
package {
import flash.display.*;
public dynamic class BulletSplat extends MovieClip {
public function BulletSplat(){
addFrameScript(19, frame20);
}
function frame20(){
stop();
}
}
}//package
Section 162
//chapter1 (chapter1)
package {
import flash.display.*;
public dynamic class chapter1 extends MovieClip {
}
}//package
Section 163
//chapter2 (chapter2)
package {
import flash.display.*;
public dynamic class chapter2 extends MovieClip {
}
}//package
Section 164
//chapter3 (chapter3)
package {
import flash.display.*;
public dynamic class chapter3 extends MovieClip {
}
}//package
Section 165
//click (click)
package {
import flash.media.*;
public dynamic class click extends Sound {
}
}//package
Section 166
//conLeft (conLeft)
package {
import flash.display.*;
public dynamic class conLeft extends MovieClip {
public var wheel:MovieClip;
public var innerMov:MovieClip;
}
}//package
Section 167
//conRight (conRight)
package {
import flash.display.*;
public dynamic class conRight extends MovieClip {
public var wheel:MovieClip;
public var innerMov:MovieClip;
}
}//package
Section 168
//cutSceneBG1 (cutSceneBG1)
package {
import flash.display.*;
public dynamic class cutSceneBG1 extends MovieClip {
public var meatBoy:MovieClip;
public var heart2:MovieClip;
public var heart3:MovieClip;
public var heart5:MovieClip;
public var heart6:MovieClip;
public var heart7:MovieClip;
public var heart9:MovieClip;
public var heart4:MovieClip;
public var heart8:MovieClip;
public var heart1:MovieClip;
public var girl:MovieClip;
public var heart10:MovieClip;
}
}//package
Section 169
//cutSceneBG2 (cutSceneBG2)
package {
import flash.display.*;
public dynamic class cutSceneBG2 extends MovieClip {
public var meatBoy:MovieClip;
public var heart2:MovieClip;
public var heart3:MovieClip;
public var heart5:MovieClip;
public var heart6:MovieClip;
public var heart7:MovieClip;
public var heart9:MovieClip;
public var heart4:MovieClip;
public var heart8:MovieClip;
public var heart1:MovieClip;
public var girl:MovieClip;
public var heart10:MovieClip;
public function cutSceneBG2(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 170
//embedCode (embedCode)
package {
import flash.display.*;
public dynamic class embedCode extends MovieClip {
public var closeBtn:MovieClip;
}
}//package
Section 171
//endSplat (endSplat)
package {
import flash.display.*;
public dynamic class endSplat extends MovieClip {
public function endSplat(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
}
}
}//package
Section 172
//FallingTile (FallingTile)
package {
import flash.display.*;
public dynamic class FallingTile extends MovieClip {
public function FallingTile(){
addFrameScript(0, frame1, 19, frame20);
}
function frame1(){
stop();
}
function frame20(){
stop();
}
}
}//package
Section 173
//FallingTileGreese (FallingTileGreese)
package {
import flash.display.*;
public dynamic class FallingTileGreese extends MovieClip {
public function FallingTileGreese(){
addFrameScript(0, frame1, 19, frame20);
}
function frame1(){
stop();
}
function frame20(){
stop();
}
}
}//package
Section 174
//fire (fire)
package {
import flash.display.*;
public dynamic class fire extends MovieClip {
public function fire(){
addFrameScript(1, frame2, 3, frame4, 5, frame6, 7, frame8);
}
function frame6(){
gotoAndPlay(("F" + String(Math.ceil((Math.random() * 4)))));
}
function frame8(){
gotoAndPlay(("F" + String(Math.ceil((Math.random() * 4)))));
}
function frame4(){
gotoAndPlay(("F" + String(Math.ceil((Math.random() * 4)))));
}
function frame2(){
gotoAndPlay(("F" + String(Math.ceil((Math.random() * 4)))));
}
}
}//package
Section 175
//gameOverScreen (gameOverScreen)
package {
import flash.display.*;
public dynamic class gameOverScreen extends MovieClip {
public var menuBG:MovieClip;
public function gameOverScreen(){
addFrameScript(225, frame226);
}
function frame226(){
stop();
}
}
}//package
Section 176
//gameplay (gameplay)
package {
import flash.media.*;
public dynamic class gameplay extends Sound {
}
}//package
Section 177
//gfAnimation (gfAnimation)
package {
import flash.display.*;
public dynamic class gfAnimation extends MovieClip {
}
}//package
Section 178
//graphicBlocker (graphicBlocker)
package {
import flash.display.*;
public dynamic class graphicBlocker extends MovieClip {
}
}//package
Section 179
//gun (gun)
package {
import flash.display.*;
public dynamic class gun extends MovieClip {
public function gun(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 180
//gunGreese (gunGreese)
package {
import flash.display.*;
public dynamic class gunGreese extends MovieClip {
public function gunGreese(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 181
//gunSound (gunSound)
package {
import flash.media.*;
public dynamic class gunSound extends Sound {
}
}//package
Section 182
//intro (intro)
package {
import flash.media.*;
public dynamic class intro extends Sound {
}
}//package
Section 183
//jumpSplat (jumpSplat)
package {
import flash.display.*;
public dynamic class jumpSplat extends MovieClip {
public function jumpSplat(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package
Section 184
//lastScene1 (lastScene1)
package {
import flash.display.*;
public dynamic class lastScene1 extends MovieClip {
public function lastScene1(){
addFrameScript(8, frame9, 64, frame65);
}
function frame65(){
stop();
}
function frame9(){
stop();
}
}
}//package
Section 185
//lastScene2 (lastScene2)
package {
import flash.display.*;
public dynamic class lastScene2 extends MovieClip {
public function lastScene2(){
addFrameScript(8, frame9, 64, frame65);
}
function frame65(){
stop();
}
function frame9(){
stop();
}
}
}//package
Section 186
//LoadingScreen (LoadingScreen)
package {
import flash.display.*;
public dynamic class LoadingScreen extends MovieClip {
}
}//package
Section 187
//meatBoyFall (meatBoyFall)
package {
import flash.display.*;
public dynamic class meatBoyFall extends MovieClip {
public var meatBoy:MovieClip;
public function meatBoyFall(){
addFrameScript(54, frame55);
}
function frame55(){
stop();
}
}
}//package
Section 188
//menuSegment (menuSegment)
package {
import flash.display.*;
import flash.text.*;
public dynamic class menuSegment extends MovieClip {
public var segmentText:TextField;
public var splat:MovieClip;
public var padlock:MovieClip;
public var bandage:MovieClip;
public function menuSegment(){
addFrameScript(0, frame1, 9, frame10);
}
function frame10(){
stop();
}
function frame1(){
stop();
}
}
}//package
Section 189
//menuSound (menuSound)
package {
import flash.media.*;
public dynamic class menuSound extends Sound {
}
}//package
Section 190
//Particle (Particle)
package {
import flash.display.*;
public dynamic class Particle extends MovieClip {
}
}//package
Section 191
//runSplat (runSplat)
package {
import flash.display.*;
public dynamic class runSplat extends MovieClip {
public function runSplat(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package
Section 192
//sizzle (sizzle)
package {
import flash.media.*;
public dynamic class sizzle extends Sound {
}
}//package
Section 193
//splatSound (splatSound)
package {
import flash.media.*;
public dynamic class splatSound extends Sound {
}
}//package
Section 194
//startSplat (startSplat)
package {
import flash.display.*;
public dynamic class startSplat extends MovieClip {
public function startSplat(){
addFrameScript(11, frame12);
}
function frame12(){
stop();
}
}
}//package
Section 195
//thud (thud)
package {
import flash.media.*;
public dynamic class thud extends Sound {
}
}//package
Section 196
//thumper (thumper)
package {
import flash.display.*;
public dynamic class thumper extends MovieClip {
public var innerThumper:MovieClip;
}
}//package
Section 197
//tileSheet (tileSheet)
package {
import flash.display.*;
public dynamic class tileSheet extends BitmapData {
public function tileSheet(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 198
//TofuBoy (TofuBoy)
package {
import flash.net.*;
import flash.events.*;
import flash.display.*;
import com.google.analytics.*;
import flash.utils.*;
import tools.*;
import flash.system.*;
import flash.xml.*;
public class TofuBoy extends MovieClip {
public var tipsArray:Array;
public var introSound:Boolean;// = false
private var GFName:String;// = ""
public var whichVersion:Number;// = 1
public var timerArray:Array;
private var playCount:int;
public var gameSound:Boolean;// = false
public var checkLevel3:Boolean;// = false
public var animationClass;
public var checkLevel1:Boolean;// = false
public var checkLevel2:Boolean;// = false
public var online:Boolean;
public var menuScreenArray:Array;
public var pcZipPeta:String;// = "http://www.mediapeta.com/peta/Downloads/Standalones/SuperTofuBoy/TofuBoyPC.zip"
public var gameLayer:Sprite;
public var newGF;
public var bandageCount:Number;// = 0
private var numLevels:Number;// = 9
public var BackgroundLayer:Sprite;
public var level11:Boolean;// = false
public var wrapperClass;
private var showFPS:Boolean;// = false
public var level10:Boolean;// = false
public var ObjectsLayer:Sprite;
private var tileSheetLoaded:Boolean;// = false
public var bonusLevelBandages:Number;// = 0
public var menuSound:Boolean;// = false
public var bugFix:Boolean;// = false
public var pauseGame:Boolean;// = false
public var macZipPeta2:String;// = "http://www.mediapeta.com/peta2/Downloads/SuperTofuBoy/TofuBoyMac.zip"
public var bonusLevelPlayCount:Number;// = 0
public var level1:Boolean;// = false
public var level2:Boolean;// = false
public var level4:Boolean;// = false
public var level5:Boolean;// = false
public var menuLayer:Sprite;
public var level7:Boolean;// = false
public var levelArray:Array;
public var level3:Boolean;// = false
public var tracker:AnalyticsTracker;
public var level6:Boolean;// = false
public var level8:Boolean;// = false
public var controllerClass;
private var tile_Folder:String;// = "../tilesheet/"
public var level9:Boolean;// = false
public var videoAdded:Boolean;// = false
public var containerLayer:Sprite;
public var AvatarLayer:Sprite;
public var ObjectTiles:Array;
public var whichLevel:Number;
public var whichChapter:String;// = "chapter1"
public var showVideo:Boolean;// = true
public var macZipPeta:String;// = "http://www.mediapeta.com/peta/Downloads/Standalones/SuperTofuBoy/TofuBoyMac.zip"
private var constructorClass;
public var ForegroundLayer:Sprite;
private var xml_Folder:String;// = "../xml"
public var firstRun:Boolean;// = true
public var pcZipPeta2:String;// = "http://www.mediapeta.com/peta2/Downloads/SuperTofuBoy/TofuBoyPC.zip"
private var dictionLibrary:Dictionary;
public var bandageArray:Array;
public var levelHeight:Number;
public var tileSheetBitmap:Bitmap;
public var ForegroundTiles:Array;
public function TofuBoy(){
ForegroundTiles = new Array();
ObjectTiles = new Array();
timerArray = new Array();
menuScreenArray = new Array();
levelArray = new Array();
tipsArray = new Array();
dictionLibrary = new Dictionary();
xml_Folder = "../xml";
tile_Folder = "../tilesheet/";
pcZipPeta = "http://www.mediapeta.com/peta/Downloads/Standalones/SuperTofuBoy/TofuBoyPC.zip";
macZipPeta = "http://www.mediapeta.com/peta/Downloads/Standalones/SuperTofuBoy/TofuBoyMac.zip";
pcZipPeta2 = "http://www.mediapeta.com/peta2/Downloads/SuperTofuBoy/TofuBoyPC.zip";
macZipPeta2 = "http://www.mediapeta.com/peta2/Downloads/SuperTofuBoy/TofuBoyMac.zip";
pauseGame = false;
showFPS = false;
tileSheetLoaded = false;
firstRun = true;
showVideo = true;
videoAdded = false;
animationClass = new TofuBoy_Animator(this);
bandageCount = 0;
checkLevel1 = false;
checkLevel2 = false;
checkLevel3 = false;
whichChapter = "chapter1";
numLevels = 9;
bonusLevelBandages = 0;
bonusLevelPlayCount = 0;
level1 = false;
level2 = false;
level3 = false;
level4 = false;
level5 = false;
level6 = false;
level7 = false;
level8 = false;
level9 = false;
level10 = false;
level11 = false;
bandageArray = new Array();
GFName = "";
whichVersion = 1;
menuSound = false;
gameSound = false;
introSound = false;
bugFix = false;
super();
Security.allowDomain("*");
Security.loadPolicyFile("http://tools.petaf.org/crossdomain.xml");
online = true;
try {
if (whichVersion == 1){
tracker = new GATracker(this, "UA-19310662-2", "AS3", false);
} else {
tracker = new GATracker(this, "UA-19310662-3", "AS3", false);
};
} catch(error:Error) {
trace("Error setting up GA");
};
menuLayer = new Sprite();
addChild(menuLayer);
wrapperClass = new TofuBoy_Wrapper(this, menuLayer);
whichLevel = 1;
ForegroundTiles = new Array();
ObjectTiles = new Array();
addLoader();
loadXML("Foreground");
setupMenu();
trackingHandler("Game Loaded");
updatePlayCount();
}
private function removeMenu():void{
var _local1:*;
if (menuLayer.getChildByName("menu")){
_local1 = menuLayer.getChildByName("menu");
_local1.removeTool();
};
}
private function errorHandler(_arg1:Event){
var _local2:*;
_local2 = dictionLibrary[_arg1.currentTarget];
trace(("error loading reason: " + _arg1.type));
}
public function addBonusLevel():void{
level11 = true;
}
public function addLoader():void{
var _local1:*;
if (!this.getChildByName("loader")){
_local1 = new LoadingScreen();
_local1.name = "loader";
this.addChild(_local1);
this.setChildIndex(_local1, (this.numChildren - 1));
_local1.x = 21;
_local1.y = 18;
};
}
public function resetVars():void{
setupMenu();
level11 = false;
whichLevel = 1;
bandageCount = 0;
showVideo = true;
bonusLevelBandages = 0;
bonusLevelPlayCount = 0;
}
public function pauseHandler():Boolean{
if (!pauseGame){
constructMenu("Pause");
} else {
removeMenu();
controllerClass.setupControls();
pauseGame = false;
trace("pause = false root");
};
return (pauseGame);
}
private function parseXML(_arg1:String, _arg2:XML):void{
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:int;
var _local7:Array;
var _local8:int;
_local3 = _arg2.children();
_local4 = _local3.length();
_local5 = _local3[0].children().length();
_local6 = 0;
while (_local6 < _local4) {
_local7 = new Array();
_local8 = 0;
while (_local8 < _local5) {
_local7.push(_arg2.tilerow[_local6].tilecol[_local8]);
_local8++;
};
switch (_arg1){
case "Foreground":
ForegroundTiles.push(_local7);
break;
case "Background":
break;
case "Objects":
ObjectTiles.push(_local7);
break;
};
_local6++;
};
}
public function checkComplete():Boolean{
if (((((((((((((((((!(level1)) || (!(level2)))) || (!(level3)))) || (!(level4)))) || (!(level5)))) || (!(level6)))) || (!(level7)))) || (!(level8)))) || (!(level9)))){
return (false);
};
return (true);
}
public function removeGame():void{
var _local1:*;
trace("a");
if (firstRun){
trace("b");
if (menuLayer.getChildByName("lastScene")){
trace("c");
_local1 = menuLayer.getChildByName("lastScene");
_local1.parent.removeChild(_local1);
trace("d");
};
if (whichLevel == 1){
trace("1");
constructTiles();
trace("2");
} else {
trace("3");
ForegroundTiles.splice(0, ForegroundTiles.length);
trace("4");
ObjectTiles.splice(0, ObjectTiles.length);
trace("5");
loadXML("Foreground");
trace("6");
};
} else {
trace("e");
animationClass.removeTool(true);
trace("f");
controllerClass.removeAvatar();
trace("g");
constructorClass.removeTool();
trace("h");
ForegroundTiles = new Array();
trace("i");
ObjectTiles = new Array();
trace("j");
loadXML("Foreground");
trace("k");
};
}
public function trackingHandler(_arg1:String):void{
if (online){
tracker.trackPageview(_arg1);
};
}
public function addTofuGF(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:*;
if (ObjectsLayer.getChildByName(GFName)){
_local5 = ObjectsLayer.getChildByName(GFName);
ObjectsLayer.removeChild(_local5);
};
newGF = new TofuGF();
newGF.name = ((("GF" + String(_arg4)) + "_") + String(_arg3));
ObjectsLayer.addChild(newGF);
newGF.x = (_arg1 + 10);
newGF.y = (_arg2 + 10);
GFName = newGF.name;
}
private function addLastLevel():void{
level10 = true;
animationClass.removeTool(true);
controllerClass.removeAvatar();
constructorClass.removeTool();
ForegroundTiles = new Array();
ObjectTiles = new Array();
whichLevel = 10;
addLoader();
loadXML("Foreground");
}
private function loadTileSheet(_arg1:String):void{
var _local2:BitmapData;
tileSheetLoaded = true;
_local2 = new tileSheet(700, 180);
tileSheetBitmap = new Bitmap(_local2, "auto", true);
removeLoader();
if (online){
currentSceneHandler(1);
} else {
firstRun = false;
constructTiles();
};
}
public function levelHandler(_arg1:Boolean){
var _local2:Array;
var _local3:int;
var _local4:int;
var _local5:uint;
var _local6:*;
switch (whichLevel){
case 1:
level1 = true;
break;
case 2:
level2 = true;
break;
case 3:
level3 = true;
break;
case 4:
level4 = true;
break;
case 5:
level5 = true;
break;
case 6:
level6 = true;
break;
case 7:
level7 = true;
break;
case 8:
level8 = true;
break;
case 9:
level9 = true;
break;
};
_local2 = new Array();
_local4 = 0;
if (!checkLevel1){
_local3 = 2;
_local4 = 0;
_local2 = [1, 2];
} else {
if (!checkLevel2){
_local2 = [4, 5, 6];
_local4 = 0;
_local3 = 2;
} else {
if (!checkLevel3){
_local2 = [7, 8, 9];
_local4 = 0;
_local3 = 3;
};
};
};
_local5 = 0;
while (_local5 < _local2.length) {
_local6 = this[("level" + String(_local2[_local5]))];
if (_local6){
_local4 = (_local4 + 1);
};
_local5++;
};
if (_local4 >= _local3){
if (!checkLevel1){
checkLevel1 = true;
} else {
if (!checkLevel2){
checkLevel2 = true;
} else {
if (!checkLevel3){
checkLevel3 = true;
level10 = true;
};
};
};
};
}
public function addTimer(_arg1, _arg2:Function, _arg3:Number, _arg4:Number):void{
var timerInterval:Number;
var countDown:Function;
var whichMov = _arg1;
var whichFunction = _arg2;
var whichTime = _arg3;
var tick = _arg4;
countDown = function (){
if (!pauseGame){
whichTime--;
};
if (whichTime <= 0){
clearInterval(timerInterval);
whichFunction(whichMov);
};
};
timerInterval = setInterval(countDown, tick);
timerArray.push(timerInterval);
}
private function currentSceneHandler(_arg1:Number):void{
animationClass.addCutScene(_arg1);
}
public function updateBandageArray():void{
bandageArray[(whichLevel - 1)] = true;
}
private function addLayers():void{
var _local1:ShowFPS;
var _local2:*;
gameLayer = new Sprite();
ForegroundLayer = new Sprite();
ObjectsLayer = new Sprite();
AvatarLayer = new Sprite();
BackgroundLayer = new Sprite();
containerLayer = new Sprite();
addChildAt(containerLayer, (numChildren - 1));
containerLayer.addChild(gameLayer);
gameLayer.addChild(ForegroundLayer);
gameLayer.addChild(ObjectsLayer);
gameLayer.addChild(AvatarLayer);
containerLayer.x = 21;
containerLayer.y = 18;
addChildAt(BackgroundLayer, 1);
setChildIndex(menuLayer, (this.numChildren - 1));
BackgroundLayer.x = 21;
BackgroundLayer.y = 21.5;
if (showFPS){
if (this.getChildByName("FPS")){
_local2 = this.getChildByName("FPS");
_local2.removeFPS();
this.removeChild(_local2);
};
_local1 = new ShowFPS();
_local1.name = "FPS";
_local1.y = 23;
_local1.x = 21.5;
this.addChild(_local1);
};
}
public function addAvatar(_arg1:Number, _arg2:Number):void{
trace("ADDING AVATAR");
controllerClass = new TofuBoy_Controller(this, _arg1, _arg2);
if (whichLevel == 11){
bonusLevelBandages = 0;
};
if (gameSound == false){
animationClass.soundHandler("gameplay", 0.3, true);
gameSound = true;
};
}
private function loadXML(_arg1:String):void{
ForegroundTiles = TofuBoy_Levels.returnForeground(whichLevel);
ObjectTiles = TofuBoy_Levels.returnObjects(whichLevel);
if (!tileSheetLoaded){
trace("LOAD TILE SHEET");
loadTileSheet("tileSheet");
} else {
trace("CONSTRUCT TILES");
constructTiles();
};
}
public function updatePlayCount(){
var _local1:URLRequest;
var _local2:URLLoader;
var _local3:URLVariables;
if (online){
if (whichVersion == 1){
_local1 = new URLRequest("http://tools.petaf.org/SuperTofuBoy/PetaCounter.aspx");
} else {
_local1 = new URLRequest("http://tools.petaf.org/SuperTofuBoy/Peta2Counter.aspx");
};
_local1.method = URLRequestMethod.POST;
_local2 = new URLLoader();
_local2.dataFormat = URLLoaderDataFormat.VARIABLES;
_local3 = new URLVariables();
_local3.incAmount = 1;
_local1.data = _local3;
_local2.load(_local1);
};
}
public function retrievePlayCount(_arg1):void{
var myData:URLRequest;
var loader:URLLoader;
var variables:URLVariables;
var retrievedID:Function;
var whichMov = _arg1;
retrievedID = function (_arg1:Event){
var _local2:*;
_local2 = _arg1.target.data;
if (whichMov){
whichMov.text = ("Play Count: " + formatNumber(_local2.playCount));
};
};
if (whichVersion == 1){
myData = new URLRequest("http://tools.petaf.org/SuperTofuBoy/PetaCounter.aspx");
} else {
myData = new URLRequest("http://tools.petaf.org/SuperTofuBoy/Peta2Counter.aspx");
};
myData.method = URLRequestMethod.POST;
loader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, retrievedID);
variables = new URLVariables();
variables.incAmount = 0;
myData.data = variables;
loader.load(myData);
}
private function removeTimers():void{
var _local1:*;
var _local2:*;
_local1 = timerArray.length;
while (_local1--) {
_local2 = timerArray[_local1];
clearInterval(_local2);
};
timerArray.splice(0, timerArray.length);
timerArray = new Array();
}
private function setupMenu():void{
var _local1:Array;
var _local2:Array;
var _local3:Array;
var _local4:uint;
menuScreenArray = new Array();
_local1 = new Array();
_local1.push({text:"Levels", tag:0});
_local2 = new Array();
_local2.push({text:"PC / Windows", tag:1});
_local2.push({text:"Mac", tag:2});
_local3 = new Array();
_local3.push({text:"The Slaughter House", tag:0});
_local3.push({text:"1. Cruel Blood", tag:1});
_local3.push({text:"2. Slip n' Slaughter", tag:2});
_local3.push({text:"3. Flesh Mesh", tag:3});
_local3.push({text:"Golden Arches", tag:0});
_local3.push({text:"1. Filet o’ Filth", tag:4});
_local3.push({text:"2. McCardiac Arrest", tag:5});
_local3.push({text:"3. Claustrophobic Crunch", tag:6});
_local3.push({text:"The Bacon Factory", tag:0});
_local3.push({text:"1. Strip Slip", tag:7});
_local3.push({text:"2. Grease lightening", tag:8});
_local3.push({text:"3. Save the girl", tag:9});
_local3.push({text:"Bandage Bonus", tag:11});
menuScreenArray.push({text:"Menu", whichArray:_local1, yOffset:190});
menuScreenArray.push({text:"Levels", whichArray:_local3, yOffset:65});
bandageArray = new Array();
while (_local4 < 11) {
bandageArray.push(false);
_local4++;
};
}
public function findMyMov(_arg1, _arg2:String, _arg3:Function):void{
var findMC:Function;
var whichParent = _arg1;
var whichMov = _arg2;
var whichFunction = _arg3;
findMC = function (_arg1:Event){
var _local2:*;
if (whichParent){
if (whichParent.getChildByName(whichMov)){
_local2 = whichParent.getChildByName(whichMov);
removeEventListener(Event.ENTER_FRAME, findMC);
whichFunction(_local2);
};
} else {
removeEventListener(Event.ENTER_FRAME, findMC);
};
};
addEventListener(Event.ENTER_FRAME, findMC);
}
public function animationChecker(_arg1, _arg2:Number, _arg3:Function):void{
var checkFrame:Function;
var whichMov = _arg1;
var whichFrame = _arg2;
var whichFunction = _arg3;
checkFrame = function (_arg1:Event){
if (!pauseGame){
if (whichMov){
if (whichMov.currentFrame >= whichFrame){
removeEventListener(Event.ENTER_FRAME, checkFrame);
whichFunction(whichMov);
};
} else {
removeEventListener(Event.ENTER_FRAME, checkFrame);
};
};
};
addEventListener(Event.ENTER_FRAME, checkFrame);
}
private function loadedHandler(_arg1:Event){
var _local2:String;
var _local3:*;
_local2 = dictionLibrary[_arg1.currentTarget];
if (_local2 == null){
_local2 = "tileSheet";
};
switch (_local2){
case "Foreground":
_local3 = new XML(_arg1.target.data);
parseXML(_local2, _local3);
loadXML("Objects");
break;
case "Background":
_local3 = new XML(_arg1.target.data);
parseXML(_local2, _local3);
loadXML("Objects");
break;
case "Objects":
_local3 = new XML(_arg1.target.data);
parseXML(_local2, _local3);
if (!tileSheetLoaded){
loadTileSheet("tileSheet");
} else {
constructTiles();
};
break;
case "tileSheet":
tileSheetLoaded = true;
tileSheetBitmap = Bitmap(_arg1.target.loader.content);
removeLoader();
if (online){
currentSceneHandler(1);
} else {
constructTiles();
};
break;
};
}
public function changeLevel(_arg1:Number):void{
removeTimers();
whichLevel = _arg1;
if (whichLevel == 10){
animationClass.removeEndScreen();
addLastLevel();
} else {
if (whichLevel <= numLevels){
if (firstRun){
removeGame();
firstRun = false;
} else {
addLoader();
removeGame();
};
} else {
if (whichLevel != 11){
constructMenu("Outro");
} else {
addLoader();
removeGame();
};
};
};
}
public function removeLoader():void{
var _local1:*;
if (this.getChildByName("loader")){
_local1 = this.getChildByName("loader");
this.removeChild(_local1);
};
wrapperClass.checkVideo();
}
public function constructMenu(_arg1:String):void{
var _local2:*;
var _local3:*;
if (!menuLayer.getChildByName("menu")){
if (introSound){
animationClass.removeAllSounds();
};
if ((((_arg1 == "Levels")) || ((_arg1 == "Menu")))){
if (menuSound == false){
animationClass.soundHandler("menuSound", 1, true);
menuSound = true;
};
};
setChildIndex(menuLayer, (this.numChildren - 1));
if (getChildByName("embedder")){
_local3 = getChildByName("embedder");
setChildIndex(_local3, (this.numChildren - 1));
};
_local2 = new TofuBoy_Menu(this, menuLayer, _arg1);
};
}
public function resetGame(_arg1:Boolean):void{
removeTimers();
if (whichLevel != 10){
if (_arg1){
levelHandler(_arg1);
trace(("CHECK LEVEL1: " + checkLevel1));
if (!checkComplete()){
constructMenu("LevelComplete");
} else {
animationClass.removeTool(true);
controllerClass.removeAvatar();
constructorClass.removeTool();
currentSceneHandler(3);
};
} else {
if (whichLevel != 11){
animationClass.removeTool(false);
controllerClass.resetAvatar();
constructorClass.resetLevel();
} else {
constructMenu("Levels");
};
};
} else {
if (_arg1){
constructMenu("Outro");
} else {
animationClass.removeTool(false);
controllerClass.resetAvatar();
constructorClass.resetLevel();
};
};
}
private function constructTiles():void{
addLayers();
constructorClass = new TofuBoy_Constructor(this);
}
public static function formatNumber(_arg1:Number):String{
var _local2:String;
var _local3:uint;
var _local4:Array;
var _local5:uint;
var _local6:String;
var _local7:*;
var _local8:*;
_local2 = String(_arg1);
_local3 = _local2.length;
if (_arg1 >= 1000){
_local4 = getStringAsReversedArray(_local2);
_local5 = 0;
_local6 = "";
for (_local7 in _local4) {
_local5++;
_local6 = _local6.concat(_local4[_local7]);
if ((((_local5 >= 3)) && ((_local7 < (_local4.length - 1))))){
_local6 = _local6.concat(",");
_local5 = 0;
};
};
_local4 = getStringAsReversedArray(_local6);
_local2 = "";
for (_local8 in _local4) {
_local2 = _local2.concat(_local4[_local8]);
};
};
return (_local2);
}
private static function getStringAsReversedArray(_arg1:String):Array{
var _local2:Array;
var _local3:uint;
var _local4:uint;
_local2 = new Array();
_local3 = _arg1.length;
while (_local4 < _local3) {
_local2.push(_arg1.charAt(_local4));
_local4++;
};
return (_local2.reverse());
}
}
}//package
Section 199
//TofuBoy_Animator (TofuBoy_Animator)
package {
import flash.events.*;
import flash.display.*;
import caurina.transitions.*;
import flash.media.*;
import flash.utils.*;
public class TofuBoy_Animator extends MovieClip {
private var cutScenceBladeArray:Array;
private var mathFloor;
private var theRoot;
private var mathRandom;
private var mathCeil;
private var mathSqrt;
private var mathRound;
private var muted:Boolean;// = false
private var whichScene:Number;
private var mathAbs;
public var soundArray:Array;
private var particleArray:Array;
private var wheelArray:Array;
private var gunArray:Array;
public function TofuBoy_Animator(_arg1){
wheelArray = new Array();
gunArray = new Array();
cutScenceBladeArray = new Array();
particleArray = new Array();
muted = false;
mathFloor = Math.floor;
mathCeil = Math.ceil;
mathRound = Math.round;
mathAbs = Math.abs;
mathSqrt = Math.sqrt;
mathRandom = Math.random;
super();
theRoot = _arg1;
soundArray = new Array();
}
public function removeEndScreen():void{
var _local1:*;
if (theRoot.menuLayer.getChildByName("BorderMC")){
_local1 = theRoot.menuLayer.getChildByName("BorderMC");
theRoot.menuLayer.removeChild(_local1);
};
}
public function removeMC(_arg1):void{
var removeNow:Function;
var whichMov = _arg1;
removeNow = function (){
addScene2(whichMov.parent);
whichMov.parent.removeChild(whichMov);
};
Tweener.addTween(whichMov, {time:0.5, transition:"linear", alpha:0, onComplete:removeNow});
}
public function addCutScene(_arg1:Number):void{
var _local2:Class;
var _local3:*;
var _local4:uint;
var _local5:*;
if (((!(theRoot.introSound)) && ((_arg1 == 1)))){
theRoot.introSound = true;
soundHandler("intro", 1, true);
};
whichScene = _arg1;
if (whichScene != 3){
_local2 = Class(getDefinitionByName(("cutSceneBG" + String(whichScene))));
_local3 = new (_local2);
_local3.x = 21;
_local3.y = 18;
theRoot.menuLayer.addChild(_local3);
_local3.girl.alpha = 0;
_local3.meatBoy.alpha = 0;
_local3.heartCount = 0;
if (whichScene != 2){
Tweener.addTween(_local3.girl, {alpha:1, time:0.5, transition:"linear"});
Tweener.addTween(_local3.meatBoy, {alpha:1, time:0.5, transition:"linear", onComplete:popHearts, onCompleteParams:[_local3]});
} else {
_local3.alpha = 0;
_local3.girl.alpha = 1;
_local3.meatBoy.alpha = 1;
Tweener.addTween(_local3, {alpha:1, time:1, transition:"linear", onComplete:popHearts, onCompleteParams:[_local3]});
};
_local4 = 0;
while (_local4 < 10) {
_local5 = _local3.getChildByName(("heart" + String((_local4 + 1))));
_local5.alpha = 0;
_local4++;
};
} else {
addFallingScene();
};
}
private function addGameOverScreen(_arg1):void{
var oldParent:*;
var newGameOverScreen:*;
var startPlay:Function;
var whichParent = _arg1;
startPlay = function (){
oldParent.removeChild(whichParent);
newGameOverScreen.gotoAndPlay(1);
theRoot.animationChecker(newGameOverScreen, 225, removeMC);
};
trace("Adding game over");
oldParent = whichParent.parent;
newGameOverScreen = new gameOverScreen();
newGameOverScreen.x = 21;
newGameOverScreen.y = 18;
oldParent.addChild(newGameOverScreen);
newGameOverScreen.stop();
newGameOverScreen.alpha = 0;
Tweener.addTween(newGameOverScreen, {time:1, transition:"linear", alpha:1, onComplete:startPlay});
}
private function addParticles(_arg1){
var _local2:*;
var _local3:int;
var _local4:*;
var _local5:*;
_local2 = (25 + mathRound((mathRandom() * 30)));
_local3 = 0;
while (_local3 < _local2) {
_local5 = new Particle();
_local5.vx = (-5 + (mathRandom() * 10));
_local5.vy = (-2 + (mathRandom() * -4));
_local5.x = _arg1.x;
_local5.y = _arg1.y;
_arg1.parent.addChild(_local5);
particleArray.push(_local5);
_local3++;
};
_local4 = new bigSlat();
_local4.x = 0;
_local4.y = 0;
_arg1.parent.addChild(_local4);
Tweener.addTween(_local4, {delay:1, alpha:0, time:1, transition:"linear"});
}
public function removeAllSounds():void{
var _local1:*;
var _local2:*;
_local1 = soundArray.length;
while (_local1--) {
_local2 = soundArray[_local1]["channel"];
_local2.stop();
soundArray.splice(_local1, 1);
};
theRoot.menuSound = false;
theRoot.gameSound = false;
theRoot.introSound = false;
}
public function fireGun(_arg1):void{
var _local2:Boolean;
var _local3:*;
var _local4:String;
var _local5:Number;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:Object;
var _local10:Number;
theRoot.addTimer(null, fireGun, 1, 2000);
_local2 = false;
for (_local3 in gunArray) {
_local4 = gunArray[_local3]["name"];
_local5 = gunArray[_local3]["dir"];
_local6 = theRoot.ForegroundLayer.getChildByName(_local4);
_local7 = theRoot.ObjectsLayer.getChildByName(_local4);
_local7.gotoAndPlay("fire");
_local8 = new Bullet();
_local8.cacheAsBitmap = true;
if (_local5 == -1){
_local8.x = (_local6.x + (_local5 * 10));
} else {
_local8.x = (_local6.x + (_local5 * 20));
};
_local8.y = (_local6.y + 10);
theRoot.ForegroundLayer.addChild(_local8);
_local9 = new Object();
_local9.dirx = _local5;
_local9.diry = 0;
_local9.tempWidth = 5;
_local9.tempHeight = 5;
_local9.tempX = _local8.x;
_local9.tempY = _local8.y;
_local9.speed = 10;
_local9.clip = _local8;
_local9.xtile = Math.floor((_local9.clip.x / 20));
_local9.ytile = Math.floor((_local9.clip.y / 20));
_local10 = mathAbs((_local8.y - theRoot.controllerClass.char.clip.y));
if (_local10 < 480){
_local2 = true;
};
theRoot.controllerClass.bulletArray.push(_local9);
};
if (_local2){
soundHandler("gunSound", 0.5, false);
};
}
public function addScene2(_arg1):void{
var addFrame:Function;
var startAnimating:Function;
var animateFrames:Function;
var whichMov = _arg1;
addFrame = function (){
var _local1:Class;
var _local2:*;
var _local3:uint;
var _local4:*;
if (whichScene != 2){
whichMov.parent.removeChild(whichMov);
};
trace("ADDING SCENE 2");
_local1 = Class(getDefinitionByName(("border" + String(whichScene))));
_local2 = new (_local1);
_local2.x = 21;
_local2.y = 18;
_local2.alpha = 0;
_local2.name = "BorderMC";
theRoot.menuLayer.addChild(_local2);
Tweener.addTween(_local2, {alpha:1, time:1, transition:"linear", onComplete:startAnimating, onCompleteParams:[_local2]});
_local3 = 0;
while (_local3 < 3) {
_local4 = _local2.getChildByName(("frame" + String((_local3 + 1))));
_local4.alpha = 0;
_local3++;
};
};
startAnimating = function (_arg1){
var _local2:uint;
var _local3:*;
_local2 = 0;
while (_local2 < 3) {
_local3 = _arg1.getChildByName(("frame" + String((_local2 + 1))));
Tweener.addTween(_local3, {delay:(_local2 * 3), time:1, alpha:1, transition:"linear", onComplete:animateFrames, onCompleteParams:[_local3]});
_local2++;
};
};
animateFrames = function (_arg1):void{
var _local2:String;
_local2 = _arg1.name;
switch (_local2){
case "frame1":
_arg1.gotoAndPlay("animate");
break;
case "frame2":
_arg1.gotoAndPlay("animate");
break;
case "frame3":
_arg1.gotoAndPlay("animate");
theRoot.addTimer(_arg1.parent, addScene3, 1, 3000);
break;
};
};
if (whichScene != 2){
Tweener.addTween(whichMov, {alpha:0, time:1, transition:"linear", onComplete:addFrame});
} else {
addFrame();
};
}
public function thump(_arg1){
var reloadThumper:Function;
var resetThumper:Function;
var hitTestAvatar:Function;
var whichMC = _arg1;
reloadThumper = function (){
var _local1:Number;
Tweener.addTween(whichMC.innerThumper, {y:-10, time:0.5, transition:"easeOutSine", onComplete:resetThumper});
_local1 = mathAbs((whichMC.y - theRoot.controllerClass.char.clip.y));
if (_local1 < 480){
soundHandler("thud", 0.2, false);
};
};
resetThumper = function (){
theRoot.addTimer(whichMC, thump, 1, 1500);
};
hitTestAvatar = function (){
var _local1:*;
_local1 = theRoot.controllerClass.char;
if ((((_local1.clip.y > whichMC.y)) && (_local1.alive))){
if (whichMC.hitTestObject(_local1.clip)){
theRoot.controllerClass.killTofu();
};
};
};
Tweener.addTween(whichMC.innerThumper, {y:30, time:0.2, transition:"easeOutSine", onComplete:reloadThumper, onUpdate:hitTestAvatar});
}
public function soundHandler(_arg1:String, _arg2, _arg3:Boolean):void{
var ClassReference:*;
var newSound:*;
var soundChannel:SoundChannel;
var st:SoundTransform;
var soundFinished:Function;
var repeatSound:Function;
var whichSound = _arg1;
var volumeAmount = _arg2;
var repeat = _arg3;
soundFinished = function (_arg1:Event){
var _local2:Number;
var _local3:*;
_local2 = soundArray.length;
while (_local2--) {
_local3 = soundArray[_local2]["channel"];
if (_local3 == soundChannel){
soundChannel.removeEventListener(Event.SOUND_COMPLETE, soundFinished);
soundChannel.removeEventListener(Event.SOUND_COMPLETE, repeatSound);
soundArray.splice(_local2, 1);
};
};
};
repeatSound = function (_arg1:Event){
var _local2:Number;
var _local3:Number;
var _local4:*;
_local2 = soundArray.length;
while (_local2--) {
_local4 = soundArray[_local2]["channel"];
if (_local4 == soundChannel){
_local3 = soundArray[_local2]["volume"];
soundChannel.removeEventListener(Event.SOUND_COMPLETE, soundFinished);
soundChannel.removeEventListener(Event.SOUND_COMPLETE, repeatSound);
soundArray.splice(_local2, 1);
};
};
trace(((("REPEAT " + whichSound) + "VOL: ") + _local3));
soundHandler(whichSound, _local3, repeat);
};
ClassReference = getDefinitionByName(whichSound);
newSound = new (ClassReference);
soundChannel = new SoundChannel();
soundChannel = newSound.play();
soundArray.push({channel:soundChannel, volume:volumeAmount});
if (muted){
volumeAmount = 0;
};
st = new SoundTransform(volumeAmount, 0);
soundChannel.soundTransform = st;
if (repeat){
soundChannel.addEventListener(Event.SOUND_COMPLETE, repeatSound);
} else {
soundChannel.addEventListener(Event.SOUND_COMPLETE, soundFinished);
};
}
public function removeTool(_arg1:Boolean):void{
if (_arg1){
Tweener.removeAllTweens();
if (wheelArray.length > 0){
wheelArray.splice(0, wheelArray.length);
wheelArray = new Array();
};
if (gunArray.length > 0){
gunArray.splice(0, gunArray.length);
gunArray = new Array();
};
};
if (theRoot){
theRoot.removeEventListener(Event.ENTER_FRAME, animate);
};
}
private function spinBlades(_arg1:Event){
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
_local2 = _arg1.currentTarget;
if ((((_local2.y >= 480)) && (!((_local2.alpha == 0))))){
_local2.alpha = 0;
addParticles(_local2);
theRoot.animationClass.soundHandler("bladeSound", 0.7, false);
theRoot.addTimer(_local2, removeFallingScene, 1, 3000);
} else {
if (_local2.alpha == 1){
_local2.y = (_local2.y + _local2.vy);
_local2.vy = (_local2.vy + 0.05);
_local2.rotation = (_local2.rotation + _local2.vy);
};
};
for (_local3 in cutScenceBladeArray) {
_local5 = cutScenceBladeArray[_local3];
cutScenceBladeArray[_local3].rotation = (_local5.rotation + 10);
};
_local4 = particleArray.length;
while (_local4--) {
_local6 = particleArray[_local4];
particleArray[_local4].x = (_local6.x + _local6.vx);
_local6.y = (_local6.y + _local6.vy);
_local6.vy = (_local6.vy + 0.1);
if ((((((_local6.y > 500)) || ((_local6.x < 0)))) || ((_local6.x > 300)))){
_local6.parent.removeChild(_local6);
particleArray.splice(_local4, 1);
};
};
}
private function addFallingScene():void{
var whichMov:MovieClip;
var startFall:Function;
var newGraphicBlocker:*;
startFall = function (){
var _local1:Number;
var _local2:Number;
var _local3:int;
var _local4:*;
var _local5:*;
cutScenceBladeArray = new Array();
theRoot.menuLayer.addChild(whichMov);
_local1 = 10;
_local2 = 470;
_local3 = 0;
while (_local3 < 30) {
_local5 = new blade();
_local5.x = _local1;
_local5.y = _local2;
_local1 = (_local1 + 20);
if (_local3 == 14){
_local1 = 10;
_local2 = 490;
};
whichMov.addChild(_local5);
cutScenceBladeArray.push(_local5);
_local3++;
};
_local4 = whichMov.getChildByName("meatBoy");
_local4.vy = 0;
_local4.scaleX = (_local4.scaleY = 0.5);
_local4.addEventListener(Event.ENTER_FRAME, spinBlades);
};
removeAllSounds();
soundHandler("intro", 1, true);
whichMov = new meatBoyFall();
whichMov.x = 21;
whichMov.y = 18;
startFall();
newGraphicBlocker = new graphicBlocker();
newGraphicBlocker.name = "newGraphicBlocker";
whichMov.addChild(newGraphicBlocker);
Tweener.addTween(newGraphicBlocker, {alpha:0, time:1.5, transition:"linear"});
}
public function animatHeart(_arg1):void{
if (!_arg1.heartPopped){
_arg1.alpha = 1;
theRoot.addTimer(_arg1, animatHeart, 1, 2000);
_arg1.heartPopped = true;
} else {
_arg1.gotoAndPlay("pop");
_arg1.parent.heartCount = (_arg1.parent.heartCount + 1);
if (_arg1.parent.heartCount == 10){
if (whichScene == 1){
theRoot.addTimer(_arg1.parent, addScene2, 1, 1000);
} else {
theRoot.addTimer(_arg1.parent, addGameOverScreen, 1, 1000);
};
};
};
}
public function popHearts(_arg1){
var _local2:uint;
var _local3:*;
if (whichScene == 2){
Tweener.addTween(_arg1.girl, {x:148, time:1, transition:"linear"});
Tweener.addTween(_arg1.meatBoy, {x:157, time:1, transition:"linear"});
};
_local2 = 0;
while (_local2 < 10) {
_local3 = _arg1.getChildByName(("heart" + String((_local2 + 1))));
_local3.alpha = 0;
_local3.heartPopped = false;
theRoot.addTimer(_local3, animatHeart, 1, (150 * _local2));
_local2++;
};
}
public function playSoundsAgain():void{
var _local1:*;
var _local2:*;
var _local3:Number;
var _local4:SoundTransform;
muted = false;
for (_local1 in soundArray) {
_local2 = soundArray[_local1]["channel"];
_local3 = soundArray[_local1]["volume"];
trace(("VOL" + _local3));
_local4 = new SoundTransform(_local3, 0);
_local2.soundTransform = _local4;
};
}
public function addThumper(_arg1:Array):void{
var _local2:*;
var _local3:Number;
var _local4:Number;
var _local5:*;
for (_local2 in _arg1) {
_local3 = (_local2 % 2);
_local5 = _arg1[_local2]["mc"];
_local5.innerThumper.y = -10;
switch (_local3){
case 0:
_local4 = 1500;
break;
case 1:
_local4 = 3000;
break;
};
_local5.randTime = _local4;
theRoot.addTimer(_local5, thump, 1, _local4);
};
}
public function animateWheels(_arg1:Array):void{
wheelArray = new Array();
wheelArray = _arg1;
theRoot.addEventListener(Event.ENTER_FRAME, animate);
}
public function muteSounds():void{
var _local1:*;
var _local2:*;
var _local3:SoundTransform;
muted = true;
for (_local1 in soundArray) {
_local2 = soundArray[_local1]["channel"];
_local3 = new SoundTransform(0.01, 0);
_local2.soundTransform = _local3;
};
}
public function addScene3(_arg1):void{
var addSceneNow:Function;
var animateNow:Function;
var removeNow:Function;
var whichMov = _arg1;
addSceneNow = function (){
var _local1:Class;
var _local2:*;
whichMov.parent.removeChild(whichMov);
if (whichScene == 1){
_local1 = Class(getDefinitionByName(("lastScene" + String(whichScene))));
_local2 = new (_local1);
_local2.alpha = 0;
_local2.x = 21;
_local2.y = 18;
_local2.name = "lastScene";
theRoot.menuLayer.addChild(_local2);
Tweener.addTween(_local2, {alpha:1, time:1, transition:"linear", onComplete:animateNow, onCompleteParams:[_local2]});
};
};
animateNow = function (_arg1){
_arg1.gotoAndPlay("animate");
Tweener.addTween(_arg1, {delay:3, alpha:1, time:1, transition:"linear", onComplete:removeNow, onCompleteParams:[_arg1]});
};
removeNow = function (_arg1){
if (theRoot.firstRun){
theRoot.constructMenu("Menu");
};
};
if (whichScene == 1){
Tweener.addTween(whichMov, {alpha:0, time:1, transition:"linear", onComplete:addSceneNow});
} else {
removeAllSounds();
theRoot.menuScreenArray[1]["whichArray"] = [{text:"Tofu Scramble: The Final Feat", tag:10}];
theRoot.constructMenu("Levels");
};
}
public function pauseSounds():void{
var _local1:*;
var _local2:*;
for (_local1 in soundArray) {
_local2 = soundArray[_local1]["channel"];
_local2.stop();
};
}
private function animate(_arg1:Event){
var _local2:*;
var _local3:*;
var _local4:Number;
for (_local2 in wheelArray) {
_local3 = wheelArray[_local2];
_local4 = mathAbs((_local3.y - theRoot.controllerClass.char.clip.y));
if (_local4 < 480){
if (!_local3.visible){
_local3.visible = true;
};
_local3.rotation = (_local3.rotation + 10);
} else {
if (_local3.visible){
_local3.visible = false;
};
};
};
}
public function removeFallingScene(_arg1):void{
var graphicBlocker:*;
var removeNow:Function;
var whichMov = _arg1;
removeNow = function (){
var _local1:*;
graphicBlocker.parent.removeChild(graphicBlocker);
_local1 = whichMov.parent.parent;
whichMov.removeEventListener(Event.ENTER_FRAME, spinBlades);
particleArray = new Array();
cutScenceBladeArray = new Array();
whichMov.parent.parent.removeChild(whichMov.parent);
addCutScene(2);
};
graphicBlocker = whichMov.parent.getChildByName("newGraphicBlocker");
whichMov.parent.setChildIndex(graphicBlocker, (whichMov.parent.numChildren - 1));
Tweener.addTween(graphicBlocker, {alpha:1, time:0.5, transition:"linear", onComplete:removeNow});
}
public function addGun(_arg1:Array):void{
gunArray = _arg1;
theRoot.addTimer(null, fireGun, 1, 2000);
}
}
}//package
Section 200
//TofuBoy_Constructor (TofuBoy_Constructor)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import caurina.transitions.*;
import flash.utils.*;
public class TofuBoy_Constructor extends MovieClip {
private var mathFloor;
private var theRoot;
private var beltArray:Array;
private var mathCeil;
private var thumperArray:Array;
private var mathRound;
private var movingTileArray:Array;
private var wheelArray:Array;
private var tilesHigh:Number;// = 30
private var gunArray:Array;
private var tilesWide:Number;// = 35
public function TofuBoy_Constructor(_arg1){
wheelArray = new Array();
gunArray = new Array();
thumperArray = new Array();
movingTileArray = new Array();
beltArray = new Array();
mathFloor = Math.floor;
mathCeil = Math.ceil;
mathRound = Math.round;
tilesHigh = (600 / 20);
tilesWide = (700 / 20);
super();
theRoot = _arg1;
buildForeground();
buildBackround();
buildSpecialObjects();
}
private function checkTypeArray(_arg1:Number, _arg2:Array):Boolean{
var _local3:*;
var _local4:*;
for (_local3 in _arg2) {
_local4 = _arg2[_local3];
if (_local4 == _arg1){
return (true);
};
};
return (false);
}
private function buildSpecialObjects():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:String;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:*;
var _local10:*;
var _local11:Boolean;
var _local12:MovieClip;
_local1 = theRoot.ObjectTiles;
wheelArray = new Array();
gunArray = new Array();
movingTileArray = new Array();
for (_local2 in _local1) {
_local3 = _local1[_local2];
for (_local4 in _local3) {
_local5 = ((("t_" + String(_local2)) + "_") + String(_local4));
_local6 = _local1[_local2][_local4];
_local7 = (_local4 * 20);
_local8 = (_local2 * 20);
_local9 = mathFloor((_local7 / 20));
_local10 = mathFloor((_local8 / 20));
_local11 = false;
switch (_local6){
case 3:
addFallingTile(_local5, _local7, _local8);
break;
case 281:
theRoot.levelHeight = theRoot.gameLayer.height;
theRoot.addAvatar(_local7, _local8);
break;
case 282:
addBlade(_local5, _local7, _local8);
break;
case 283:
theRoot.addTofuGF(_local7, _local8, _local9, _local10);
break;
case 284:
addGun(_local5, _local7, _local8, _local6);
break;
case 285:
addGun(_local5, _local7, _local8, _local6);
break;
case 286:
addTrampoline(_local5, _local7, _local8);
break;
case 287:
if (theRoot.bandageArray[(theRoot.whichLevel - 1)] == false){
_local11 = true;
setBonus(_local5, _local7, _local8);
};
break;
case 288:
movingTileArray.push({dirx:-1, diry:0, x:_local9, y:_local10, type:288, name:_local5});
break;
case 289:
movingTileArray.push({dirx:1, diry:0, x:_local9, y:_local10, type:289, name:_local5});
break;
case 290:
addFlames(_local5, _local7, _local8);
break;
case 291:
movingTileArray.push({dirx:1, diry:0, x:_local9, y:_local10, type:291, name:_local5});
break;
case 292:
movingTileArray.push({dirx:1, diry:0, x:_local9, y:_local10, type:292, name:_local5});
break;
case 293:
movingTileArray.push({dirx:-1, diry:0, x:_local9, y:_local10, type:291, name:_local5});
break;
case 294:
movingTileArray.push({dirx:-1, diry:0, x:_local9, y:_local10, type:292, name:_local5});
break;
case 295:
addThumper(_local5, _local7, _local8, _local6);
break;
};
if (_local11){
_local12 = createNewTile((_local6 - 1));
_local12.name = _local5;
_local12.x = _local7;
_local12.y = _local8;
theRoot.ObjectsLayer.addChild(_local12);
if (_local6 == 287){
_local12.bonus = true;
};
};
};
};
if (wheelArray.length > 0){
theRoot.animationClass.animateWheels(wheelArray);
};
if (gunArray.length > 0){
theRoot.animationClass.addGun(gunArray);
};
if (thumperArray.length > 0){
theRoot.animationClass.addThumper(thumperArray);
};
if (movingTileArray.length > 0){
addMovingTiles();
};
theRoot.removeLoader();
if ((((((theRoot.whichLevel == 1)) || ((theRoot.whichLevel == 2)))) || ((theRoot.whichLevel == 11)))){
theRoot.constructMenu("Intro");
};
}
private function addBlade(_arg1:String, _arg2:Number, _arg3:Number):void{
var _local4:*;
var _local5:*;
var _local6:*;
_local4 = new blade();
_local4.name = _arg1;
_local4.x = (_arg2 + 10);
_local4.y = (_arg3 + 10);
theRoot.ObjectsLayer.addChild(_local4);
wheelArray.push(_local4);
if (theRoot.whichLevel > 6){
_local4.gotoAndStop(2);
};
if (theRoot.ForegroundLayer.getChildByName(_arg1)){
_local5 = theRoot.ForegroundLayer.getChildByName(_arg1);
_local5.blade = true;
_local5.bladeHit = false;
} else {
_local6 = addBlankTile();
_local6.name = _arg1;
_local6.x = _arg2;
_local6.y = _arg3;
_local6.blade = true;
_local6.bladeHit = false;
_local6.walkable = true;
theRoot.ForegroundLayer.addChild(_local6);
};
_local4.cacheAsBitmap = true;
}
private function setProperties(_arg1, _arg2){
var _local3:Array;
var _local4:Boolean;
_local3 = [1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21];
_local4 = false;
if (checkTypeArray(_arg2, _local3)){
_arg1.walkable = false;
_arg1.blood = true;
_arg1.allowSplat = true;
_arg1.leftBlood = true;
_arg1.rightBlood = true;
_arg1.upBlood = true;
_arg1.downBlood = true;
_local4 = true;
};
if (!_local4){
_arg1.walkable = true;
_arg1.blood = false;
};
}
public function removeTool():void{
var _local1:int;
var _local2:*;
resetMovs();
wheelArray.splice(0, wheelArray.length);
wheelArray = new Array();
gunArray.splice(0, gunArray.length);
gunArray = new Array();
movingTileArray.splice(0, movingTileArray.length);
movingTileArray = new Array();
thumperArray.splice(0, thumperArray.length);
thumperArray = new Array();
theRoot.containerLayer.y = 0;
theRoot.gameLayer.y = 0;
if (theRoot.getChildByName("chapterMC")){
_local2 = theRoot.getChildByName("chapterMC");
_local2.parent.removeChild(_local2);
};
_local1 = theRoot.BackgroundLayer.numChildren;
while (_local1--) {
_local2 = theRoot.BackgroundLayer.getChildAt(_local1);
theRoot.BackgroundLayer.removeChild(_local2);
};
_local1 = theRoot.ForegroundLayer.numChildren;
while (_local1--) {
_local2 = theRoot.ForegroundLayer.getChildAt(_local1);
theRoot.ForegroundLayer.removeChild(_local2);
};
_local1 = theRoot.ObjectsLayer.numChildren;
while (_local1--) {
_local2 = theRoot.ObjectsLayer.getChildAt(_local1);
theRoot.ObjectsLayer.removeChild(_local2);
};
_local1 = theRoot.gameLayer.numChildren;
while (_local1--) {
_local2 = theRoot.gameLayer.getChildAt(_local1);
theRoot.gameLayer.removeChild(_local2);
};
if (theRoot){
if (theRoot.containerLayer){
if (theRoot.gameLayer){
if (theRoot.gameLayer.parent){
theRoot.gameLayer.parent.removeChild(theRoot.gameLayer);
};
};
};
};
if (theRoot){
if (theRoot.containerLayer){
if (theRoot.containerLayer.parent){
theRoot.containerLayer.parent.removeChild(theRoot.containerLayer);
};
};
};
}
private function buildBackround():void{
var _local1:Number;
var _local2:*;
var _local3:*;
var _local4:*;
if (theRoot.BackgroundLayer.getChildByName("chapterMC")){
_local4 = theRoot.BackgroundLayer.getChildByName("chapterMC");
theRoot.BackgroundLayer.removeChild(_local4);
};
_local1 = 0;
if (theRoot.whichLevel <= 3){
theRoot.whichChapter = "chapter1";
} else {
if ((((theRoot.whichLevel > 3)) && ((theRoot.whichLevel <= 6)))){
theRoot.whichChapter = "chapter2";
_local1 = -3;
} else {
theRoot.whichChapter = "chapter3";
_local1 = -5;
};
};
_local2 = getDefinitionByName(theRoot.whichChapter);
_local3 = new (_local2);
_local3.name = "chapterMC";
theRoot.BackgroundLayer.addChildAt(_local3, 0);
_local3.y = _local1;
}
public function resetLevel():void{
resetMovs();
theRoot.animationClass.animateWheels(wheelArray);
if (gunArray.length > 0){
theRoot.animationClass.addGun(gunArray);
};
if (thumperArray.length > 0){
Tweener.removeAllTweens();
theRoot.animationClass.addThumper(thumperArray);
};
}
private function addMovingTiles():void{
var _local1:*;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:String;
var _local8:Number;
var _local9:Number;
var _local10:*;
var _local11:Object;
var _local12:*;
var _local13:*;
for (_local1 in movingTileArray) {
_local2 = movingTileArray[_local1]["x"];
_local3 = movingTileArray[_local1]["y"];
_local4 = movingTileArray[_local1]["dirx"];
_local5 = movingTileArray[_local1]["diry"];
_local6 = movingTileArray[_local1]["type"];
_local7 = movingTileArray[_local1]["name"];
if (theRoot.ForegroundLayer.getChildByName(_local7)){
_local12 = theRoot.ForegroundLayer.getChildByName(_local7);
_local12.walkable = false;
} else {
_local13 = addBlankTile();
_local13.name = _local7;
_local13.x = (_local2 * 20);
_local13.y = (_local3 * 20);
_local13.walkable = false;
theRoot.ForegroundLayer.addChild(_local13);
};
switch (_local6){
case 288:
_local10 = new beltRight();
_local10.type = "belt";
_local10.dirx = _local4;
_local8 = 0;
_local9 = 0;
break;
case 289:
_local10 = new beltLeft();
_local10.type = "belt";
_local10.dirx = _local4;
_local8 = 0;
_local9 = 0;
break;
case 291:
_local10 = new conRight();
_local10.type = "wheel";
_local10.dirx = _local4;
_local8 = 10;
_local9 = 10;
if (theRoot.whichLevel > 6){
_local10.innerMov.gotoAndStop(3);
} else {
_local10.innerMov.gotoAndStop(2);
};
break;
case 292:
_local10 = new conLeft();
if (theRoot.whichLevel > 6){
_local10.innerMov.gotoAndStop(3);
} else {
_local10.innerMov.gotoAndStop(2);
};
_local10.type = "wheel";
_local10.dirx = _local4;
_local8 = 10;
_local9 = 10;
break;
};
_local11 = new Object();
_local11.xtile = _local2;
_local11.ytile = _local3;
_local11.minx = 10;
_local11.maxx = 14;
_local11.tempHeight = 20;
_local11.tempWidth = 20;
_local11.dirx = _local4;
_local11.diry = _local5;
_local11.speed = 3;
_local11.clip = _local10;
_local11.tempX = (_local11.xtile * 20);
if (_local4 == -1){
_local11.tempX = ((_local11.xtile * 20) + 20);
};
_local11.tempY = ((_local11.ytile * 20) + 20);
_local11.clip.x = ((_local11.xtile * 20) + _local8);
_local11.clip.y = ((_local11.ytile * 20) + _local9);
theRoot.ForegroundLayer.addChild(_local10);
theRoot.controllerClass.movingTileArray.push(_local11);
};
}
private function addFallingTile(_arg1:String, _arg2:Number, _arg3:Number):void{
var _local4:*;
var _local5:*;
if (theRoot.ForegroundLayer.getChildByName(_arg1)){
_local5 = theRoot.ForegroundLayer.getChildByName(_arg1);
theRoot.ForegroundLayer.removeChild(_local5);
};
if (theRoot.whichLevel > 6){
_local4 = new FallingTileGreese();
} else {
_local4 = new FallingTile();
};
_local4.name = _arg1;
_local4.x = _arg2;
_local4.y = _arg3;
theRoot.ForegroundLayer.addChild(_local4);
_local4.walkable = false;
_local4.fallingTile = true;
_local4.falling = false;
_local4.blood = false;
}
private function buildForeground():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:String;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:MovieClip;
theRoot.animationClass.removeAllSounds();
_local1 = theRoot.ForegroundTiles;
for (_local2 in _local1) {
_local3 = _local1[_local2];
for (_local4 in _local3) {
_local5 = ((("t_" + String(_local2)) + "_") + String(_local4));
_local6 = _local1[_local2][_local4];
_local7 = (_local4 * 20);
_local8 = (_local2 * 20);
if ((_local6 - 1) != -1){
_local9 = createNewTile((_local6 - 1));
_local9.name = _local5;
_local9.x = _local7;
_local9.y = _local8;
theRoot.ForegroundLayer.addChild(_local9);
setProperties(_local9, _local6);
};
};
};
theRoot.ForegroundTiles = null;
}
private function addBlankTile():MovieClip{
var _local1:MovieClip;
_local1 = new MovieClip();
return (_local1);
}
private function addFlames(_arg1:String, _arg2:Number, _arg3:Number):void{
var _local4:*;
var _local5:*;
var _local6:*;
_local4 = new fire();
_local4.x = (_arg2 + 10);
_local4.y = (_arg3 + 18);
_local4.name = _arg1;
theRoot.ObjectsLayer.addChild(_local4);
if (theRoot.ForegroundLayer.getChildByName(_arg1)){
_local5 = theRoot.ForegroundLayer.getChildByName(_arg1);
_local5.flame = true;
_local5.bladeHit = false;
} else {
_local6 = addBlankTile();
_local6.name = _arg1;
_local6.x = _arg2;
_local6.y = _arg3;
_local6.flame = true;
_local6.bladeHit = false;
_local6.walkable = true;
theRoot.ForegroundLayer.addChild(_local6);
};
}
private function addThumper(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:*;
_local5 = new thumper();
_local5.x = (_arg2 + 10);
_local5.y = _arg3;
_local5.name = _arg1;
theRoot.ObjectsLayer.addChild(_local5);
if (theRoot.whichLevel > 6){
_local5.innerThumper.gotoAndStop(3);
} else {
_local5.innerThumper.gotoAndStop(2);
};
thumperArray.push({mc:_local5, name:_arg1});
}
private function createNewTile(_arg1:int):MovieClip{
var _local2:MovieClip;
var _local3:*;
var _local4:Number;
var _local5:Number;
var _local6:BitmapData;
var _local7:Bitmap;
var _local8:Rectangle;
_local2 = new MovieClip();
if (_arg1 != -1){
_local3 = theRoot.tileSheetBitmap;
_local4 = ((_arg1 % tilesWide) * 20);
_local5 = (_arg1 / tilesWide);
_local5 = mathFloor(_local5);
_local5 = (_local5 * 20);
_local6 = new BitmapData(20, 20, true, 0);
_local7 = new Bitmap(_local6, "auto", true);
_local8 = new Rectangle(_local4, _local5, 20, 20);
_local7.bitmapData.copyPixels(_local3.bitmapData, _local8, new Point(0, 0));
_local2.addChild(_local7);
};
return (_local2);
}
private function resetMovs():void{
var _local1:Number;
var _local2:int;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
_local1 = theRoot.ForegroundLayer.numChildren;
_local2 = 0;
while (_local2 < _local1) {
if (theRoot.ForegroundLayer.getChildAt(_local2)){
_local3 = theRoot.ForegroundLayer.getChildAt(_local2);
_local3.visible = true;
if (((_local3.fallingTile) && (_local3))){
_local3.gotoAndStop(1);
_local3.falling = false;
_local3.walkable = false;
};
if ((((_local3.numChildren > 1)) && (_local3))){
_local4 = _local3.numChildren;
_local3.blood = true;
_local3.allowSplat = true;
_local3.leftBlood = true;
_local3.rightBlood = true;
_local3.upBlood = true;
_local3.downBlood = true;
while (_local4--) {
if (_local3.getChildAt(_local4)){
_local5 = _local3.getChildAt(_local4);
if (_local5.name == "blood"){
_local3.removeChild(_local5);
};
};
};
};
if (((_local3.blade) || (((_local3.flame) && (_local3))))){
_local3.bladeHit = false;
};
if (((_local3.bonus) && (_local3))){
if (theRoot.ObjectsLayer.getChildByName(_local3.name)){
_local6 = theRoot.ObjectsLayer.getChildByName(_local3.name);
_local6.visible = true;
};
};
};
_local2++;
};
}
private function addTrampoline(_arg1:String, _arg2:Number, _arg3:Number):void{
var _local4:*;
var _local5:*;
var _local6:*;
if (theRoot.ForegroundLayer.getChildByName(_arg1)){
_local5 = theRoot.ForegroundLayer.getChildByName(_arg1);
_local5.trampoline = true;
} else {
_local6 = addBlankTile();
_local6.name = _arg1;
_local6.x = _arg2;
_local6.y = _arg3;
_local6.trampoline = true;
_local6.walkable = true;
theRoot.ForegroundLayer.addChild(_local6);
};
_local4 = new trampoline();
theRoot.ObjectsLayer.addChild(_local4);
_local4.x = _arg2;
_local4.y = (_arg3 + 10);
_local4.name = _arg1;
}
private function setBonus(_arg1:String, _arg2:Number, _arg3:Number):void{
var _local4:*;
var _local5:*;
if (theRoot.ForegroundLayer.getChildByName(_arg1)){
_local4 = theRoot.ForegroundLayer.getChildByName(_arg1);
_local4.bonus = true;
} else {
_local5 = addBlankTile();
_local5.name = _arg1;
_local5.x = _arg2;
_local5.y = _arg3;
_local5.bonus = true;
_local5.walkable = true;
theRoot.ForegroundLayer.addChild(_local5);
};
}
private function addGun(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Number;
var _local6:Number;
var _local7:*;
var _local8:*;
if (!theRoot.ForegroundLayer.getChildByName(_arg1)){
_local8 = addBlankTile();
_local8.name = _arg1;
_local8.x = _arg2;
_local8.y = _arg3;
_local8.walkable = false;
theRoot.ForegroundLayer.addChild(_local8);
};
if (_arg4 == 284){
_local5 = -1;
_local6 = 1;
} else {
_local5 = 1;
_local6 = -1;
};
if (theRoot.whichLevel > 6){
_local7 = new gunGreese();
} else {
_local7 = new gun();
};
_local7.name = _arg1;
_local7.x = (_arg2 + 10);
_local7.y = (_arg3 + 10);
_local7.scaleX = _local6;
theRoot.ObjectsLayer.addChild(_local7);
gunArray.push({name:_arg1, dir:_local5});
}
}
}//package
Section 201
//TofuBoy_Controller (TofuBoy_Controller)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
import tools.*;
public class TofuBoy_Controller extends MovieClip {
private const sideDecay:Number = 0.1;
private const sideSpeedGravity:Number = 0.4;
private var left:Boolean;// = false
private var right:Boolean;// = false
private var jumpVar;// = 0
private var mathCeil;
private var mathSqrt;
private var mathAbs;
private var speed:Number;// = 6
public var bulletArray:Array;
private var rightKey:Boolean;// = false
private var jumpSide:Boolean;// = false
private var escKey:Number;
private var leftKey:Boolean;// = false
private var theRoot;
private var space:Boolean;// = false
public var char:Object;
private var checkJump:Boolean;// = true
private var mathRound;
private var allowScroll:Boolean;// = false
private var scrollSpeed:Number;
private var dirx:Number;
public var movingTileArray:Array;
private var updateBandage:Boolean;// = false
private var scrollOffset:Number;// = 0
private var startScroll:Boolean;// = false
private var needToScroll:Boolean;// = false
private var mathRandom;
private var game:Object;
private var mathFloor;
public function TofuBoy_Controller(_arg1, _arg2:Number, _arg3:Number){
bulletArray = new Array();
movingTileArray = new Array();
speed = 6;
jumpVar = 0;
scrollOffset = 0;
mathFloor = Math.floor;
mathCeil = Math.ceil;
mathRound = Math.round;
mathAbs = Math.abs;
mathSqrt = Math.sqrt;
mathRandom = Math.random;
left = false;
right = false;
space = false;
checkJump = true;
rightKey = false;
leftKey = false;
startScroll = false;
allowScroll = false;
needToScroll = false;
jumpSide = false;
updateBandage = false;
super();
theRoot = _arg1;
game = new Object();
game.tileW = 20;
game.tileH = 20;
addAvatar(_arg2, _arg3);
if (theRoot.online){
escKey = 27;
} else {
escKey = 16;
};
}
private function getMyMov(_arg1:String, _arg2:String, _arg3:Object){
var _local4:*;
var _local5:*;
var _local6:Number;
var _local7:String;
var _local8:Number;
_local4 = theRoot.ForegroundLayer;
if (_local4.getChildByName(_arg1)){
_local5 = _local4.getChildByName(_arg1);
switch (_arg2){
case "walk":
return (_local5.walkable);
case "blood":
return (_local5.blood);
case "allowSplat":
return (_local5.allowSplat);
case "falling":
return (_local5.fallingTile);
case "blade":
return (_local5.blade);
case "trampoline":
return (_local5.trampoline);
};
} else {
if (_arg2 == "walk"){
_local6 = Number(StringUtils.afterLast(_arg1, "_"));
_local7 = StringUtils.afterFirst(_arg1, "_");
_local8 = Number(StringUtils.beforeLast(_local7, "_"));
if ((((_local6 < 0)) || ((_local6 > 14)))){
return (false);
};
if (_local8 < 0){
return (false);
};
return (true);
} else {
return (false);
};
};
}
private function addTofuSplat(_arg1:Boolean):void{
var _local2:*;
_local2 = new endSplat();
_local2.x = char.clip.x;
_local2.y = (char.clip.y + 10);
theRoot.ObjectsLayer.addChild(_local2);
_local2.result = _arg1;
theRoot.animationChecker(_local2, 12, removeTofuSplat);
char.clip.visible = false;
}
private function addGFAnimation():void{
var _local1:*;
_local1 = new gfAnimation();
_local1.x = theRoot.newGF.x;
_local1.y = (theRoot.newGF.y + 10);
theRoot.ObjectsLayer.addChild(_local1);
_local1.result = true;
theRoot.animationChecker(_local1, 35, removeGFanimation);
}
private function jump(_arg1:Object):void{
_arg1.jumpspeed = (_arg1.jumpspeed + _arg1.gravity);
if (_arg1.jumpspeed > 20){
_arg1.jumpspeed = 20;
};
if (((((((!(left)) && (!(right)))) && (_arg1.side))) && (jumpSide))){
if (_arg1.sideSpeed > 0){
moveChar(_arg1, _arg1.sideJump, 0, 1);
_arg1.sideSpeed = (_arg1.sideSpeed - sideSpeedGravity);
if (_arg1.sideSpeed < 0){
jumpSide = false;
};
} else {
char.sideSpeed = 0;
};
if ((((((char.reverse == "left")) && ((char.sideSpeed < 4)))) && (rightKey))){
char.reverse = "";
right = true;
_arg1.sideJump = 0;
};
if ((((((char.reverse == "right")) && ((char.sideSpeed < 4)))) && (leftKey))){
char.reverse = "";
left = true;
_arg1.sideJump = 0;
};
};
if (_arg1.jumpspeed < 0){
_arg1.jumpVar = -1;
moveChar(_arg1, 0, -1, -1);
} else {
if (_arg1.jumpspeed > 0){
_arg1.jumpVar = 1;
moveChar(_arg1, 0, 1, 1);
};
};
}
private function moveTiles():void{
var _local1:*;
var _local2:*;
var _local3:Number;
for (_local1 in movingTileArray) {
_local2 = movingTileArray[_local1];
getMyCorners((_local2.tempX + (_local2.speed * _local2.dirx)), (_local2.tempY + (_local2.speed * _local2.diry)), _local2);
if (_local2.clip.type == "wheel"){
_local3 = mathAbs((_local2.clip.y - char.clip.y));
if (_local3 < 480){
if (!_local2.clip.visible){
_local2.clip.visible = true;
};
_local2.clip.wheel.rotation = (_local2.clip.wheel.rotation + (_local2.dirx * 3));
} else {
if (_local2.clip.visible){
_local2.clip.visible = false;
};
};
};
if (_local2.diry == -1){
checkMovingTiles(0);
};
};
if (char.onMovingTile){
getMyCorners(char.tempX, (char.tempY + (char.onMovingTile.speed * char.onMovingTile.diry)), char);
if (char.onMovingTile.diry == -1){
if (((char.upleft) && (char.upright))){
char.tempY = ((char.onMovingTile.tempY - char.onMovingTile.tempHeight) - char.tempHeight);
} else {
char.tempY = ((char.ytile * game.tileH) + char.tempHeight);
char.jumpspeed = 0;
char.jump = true;
char.onMovingTile = false;
};
};
if (char.onMovingTile.diry == 1){
if (((char.downleft) && (char.downright))){
char.tempY = ((char.onMovingTile.tempY - char.onMovingTile.tempHeight) - char.tempHeight);
} else {
char.onMovingTile = false;
char.tempY = (((char.ytile + 1) * game.tileH) - char.tempHeight);
};
};
getMyCorners((char.tempX + (char.onMovingTile.speed * char.onMovingTile.dirx)), char.tempY, char);
if (char.onMovingTile.dirx == -1){
if (((char.downleft) && (char.upleft))){
char.tempX = (char.tempX + (char.onMovingTile.speed * char.onMovingTile.dirx));
char.tempY = ((char.onMovingTile.tempY - char.onMovingTile.tempHeight) - char.tempHeight);
} else {
fall(char);
char.tempX = ((char.xtile * game.tileW) + char.tempWidth);
};
};
if (char.onMovingTile.dirx == 1){
if (((char.upright) && (char.downright))){
char.tempX = (char.tempX + (char.onMovingTile.speed * char.onMovingTile.dirx));
char.tempY = ((char.onMovingTile.tempY - char.onMovingTile.tempHeight) - char.tempHeight);
} else {
fall(char);
char.tempX = (((char.xtile + 1) * game.tileW) - char.tempWidth);
};
};
updateChar(char, char.dirx, char.diry);
};
}
private function checkKey(_arg1:KeyboardEvent){
var _local2:*;
var _local3:*;
if (!theRoot.pauseGame){
_local2 = _arg1.type;
_local3 = _arg1.keyCode;
if (_local3 == 39){
if (_local2 == "keyUp"){
right = false;
rightKey = false;
} else {
right = true;
rightKey = true;
if (char.reverse == "right"){
char.reverse = "";
};
};
};
if (_local3 == 37){
if (_local2 == "keyUp"){
left = false;
leftKey = false;
} else {
left = true;
leftKey = true;
if (char.reverse == "left"){
char.reverse = "";
};
};
};
if (_local3 == 32){
if (_local2 == "keyUp"){
checkJump = true;
} else {
if (checkJump){
checkJump = false;
space = true;
};
};
};
if (_local3 == escKey){
if (_local2 == "keyDown"){
theRoot.pauseHandler();
removeControls();
};
};
};
}
private function checkWallJump(_arg1:Object):Boolean{
var _local2:Boolean;
var _local3:Number;
_local2 = false;
if (_arg1.sideSpeed <= 0){
_local3 = 3;
} else {
_local3 = _arg1.sideSpeed;
};
getMyCorners((_arg1.clip.x + _local3), _arg1.clip.y, _arg1);
if (((!(_arg1.downright)) && (!(_local2)))){
char.allowJump = true;
char.isJumping = false;
_local2 = true;
char.sideSpeed = 7;
checkJump = true;
char.sideJump = -1;
char.reverse = "";
_arg1.reverse = "";
char.side = true;
_arg1.side = true;
if (right){
_arg1.reverse = "left";
char.sideSpeed = 7;
right = false;
};
};
getMyCorners((_arg1.clip.x - _local3), _arg1.clip.y, _arg1);
if (((!(_arg1.downleft)) && (!(_local2)))){
char.allowJump = true;
char.isJumping = false;
_local2 = true;
char.sideSpeed = 7;
checkJump = true;
char.sideJump = 1;
char.reverse = "";
_arg1.reverse = "";
char.side = true;
_arg1.side = true;
if (left){
_arg1.reverse = "right";
left = false;
char.sideSpeed = 7;
};
};
return (_local2);
}
private function checkForScrolling():void{
var _local1:*;
var _local2:Point;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:Point;
var _local7:*;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Point;
var _local15:*;
var _local16:Number;
var _local17:Number;
_local1 = theRoot.gameLayer;
_local2 = new Point(char.clip.x, char.clip.y);
_local3 = theRoot.ForegroundLayer.localToGlobal(_local2);
_local4 = _local3.x;
_local5 = _local3.y;
_local6 = new Point(_local4, _local5);
_local7 = theRoot.containerLayer.localToGlobal(_local6);
_local8 = (_local7.y - 250);
_local9 = 1;
_local10 = 0;
_local11 = (_local1.y + _local9);
_local12 = (_local1.y - _local9);
_local13 = (_local1.height - 500);
_local14 = new Point(_local1.x, _local1.y);
_local15 = theRoot.containerLayer.localToGlobal(_local14);
if (startScroll){
if (_local15.y >= 18){
startScroll = false;
_local1.y = (_local1.y - (_local15.y - 18));
theRoot.containerLayer.y = (theRoot.containerLayer.y - (_local15.y - 18));
} else {
scrollOffset = (scrollOffset + scrollSpeed);
theRoot.containerLayer.y = (theRoot.containerLayer.y + scrollSpeed);
_local16 = (_local7.y - theRoot.containerLayer.y);
if (_local16 < 150){
_local17 = (150 - _local16);
theRoot.containerLayer.y = (theRoot.containerLayer.y + _local17);
};
};
};
if ((_local7.y - theRoot.containerLayer.y) > 540){
killTofu();
};
}
private function moveBullet(_arg1:Object, _arg2:Number, _arg3:Number):void{
_arg1.dirx = _arg2;
_arg1.diry = _arg3;
getMyCorners(_arg1.tempX, (_arg1.tempY + (_arg1.speed * _arg3)), _arg1);
if (_arg3 == -1){
if (((_arg1.upleft) && (_arg1.upright))){
_arg1.tempY = (_arg1.tempY + (_arg1.speed * _arg3));
} else {
_arg1.tempY = ((_arg1.ytile * game.tileH) + _arg1.height);
};
};
if (_arg3 == 1){
if (((_arg1.downleft) && (_arg1.downright))){
_arg1.tempY = (_arg1.tempY + (_arg1.speed * _arg3));
} else {
_arg1.tempY = (((_arg1.ytile + 1) * game.tileH) - _arg1.tempHeight);
};
};
getMyCorners((_arg1.tempX + (_arg1.speed * _arg2)), _arg1.tempY, _arg1);
if (_arg2 == -1){
if (((_arg1.downleft) && (_arg1.upleft))){
_arg1.tempX = (_arg1.tempX + (_arg1.speed * _arg2));
} else {
_arg1.tempX = ((_arg1.xtile * game.tileW) + _arg1.tempWidth);
};
};
if (_arg2 == 1){
if (((_arg1.upright) && (_arg1.downright))){
_arg1.tempX = (_arg1.tempX + (_arg1.speed * _arg2));
} else {
_arg1.tempX = (((_arg1.xtile + 1) * game.tileW) - _arg1.tempWidth);
};
};
_arg1.clip.x = _arg1.tempX;
_arg1.clip.y = _arg1.tempY;
_arg1.xtile = mathFloor((_arg1.clip.x / game.tileW));
_arg1.ytile = mathFloor((_arg1.clip.y / game.tileH));
}
public function setupControls():void{
trace("ADDING CONTROLS");
theRoot.stage.addEventListener(KeyboardEvent.KEY_DOWN, checkKey);
theRoot.stage.addEventListener(KeyboardEvent.KEY_UP, checkKey);
theRoot.addEventListener(Event.ENTER_FRAME, detectKeys);
}
private function addStartSplat(_arg1:Number, _arg2:Number){
var _local3:*;
_local3 = new startSplat();
_local3.x = _arg1;
_local3.y = _arg2;
theRoot.ForegroundLayer.addChild(_local3);
theRoot.animationChecker(_local3, 12, removeStartSplat);
}
public function removeStartSplat(_arg1):void{
if (_arg1.parent){
_arg1.parent.removeChild(_arg1);
char.clip.visible = true;
};
}
public function removeGFanimation(_arg1):void{
if (updateBandage){
theRoot.bandageCount = (theRoot.bandageCount + 1);
if (theRoot.bandageCount == 3){
theRoot.addBonusLevel();
};
theRoot.updateBandageArray();
};
_arg1.parent.removeChild(_arg1);
theRoot.resetGame(_arg1.result);
}
private function moveBullets():void{
var _local1:int;
var _local2:Object;
var _local3:*;
var _local4:*;
_local1 = bulletArray.length;
while (_local1--) {
_local2 = bulletArray[_local1];
getMyCorners((_local2.tempX + (_local2.speed * _local2.dirx)), (_local2.tempY + (_local2.speed * _local2.diry)), _local2);
if (((((((_local2.downleft) && (_local2.upleft))) && (_local2.downright))) && (_local2.upright))){
moveBullet(_local2, _local2.dirx, _local2.diry);
} else {
addBulletSplat(_local2.clip.x, _local2.clip.y, _local2.dirx);
_local2.clip.parent.removeChild(_local2.clip);
bulletArray.splice(_local1, 1);
};
_local3 = (_local2.tempX - char.tempX);
_local4 = (_local2.tempY - char.tempY);
if (mathSqrt(((_local3 * _local3) + (_local4 * _local4))) < (_local2.tempWidth + char.tempWidth)){
killTofu();
};
};
}
public function addBonusLevelTimer():void{
theRoot.addTimer("bonus", bonusLevelExpired, 1, 20000);
}
private function getMyCorners(_arg1:Number, _arg2:Number, _arg3:Object):void{
_arg3.downY = mathFloor((((_arg2 + _arg3.tempHeight) - 1) / game.tileH));
_arg3.upY = mathFloor(((_arg2 - _arg3.tempHeight) / game.tileH));
_arg3.leftX = mathFloor(((_arg1 - _arg3.tempWidth) / game.tileW));
_arg3.rightX = mathFloor((((_arg1 + _arg3.tempWidth) - 1) / game.tileW));
_arg3.upleft = getMyMov(((("t_" + _arg3.upY) + "_") + _arg3.leftX), "walk", _arg3);
_arg3.downleft = getMyMov(((("t_" + _arg3.downY) + "_") + _arg3.leftX), "walk", _arg3);
_arg3.upright = getMyMov(((("t_" + _arg3.upY) + "_") + _arg3.rightX), "walk", _arg3);
_arg3.downright = getMyMov(((("t_" + _arg3.downY) + "_") + _arg3.rightX), "walk", _arg3);
}
private function moveChar(_arg1:Object, _arg2:Number, _arg3:Number, _arg4){
if (allowScroll){
startScroll = true;
allowScroll = false;
if (theRoot.whichLevel == 11){
addBonusLevelTimer();
};
};
if (_arg2 != 0){
_arg1.dirx = _arg2;
};
if (mathAbs(_arg4) == 1){
_arg1.speed = (_arg1.jumpspeed * _arg1.jumpVar);
} else {
speed = _arg1.speed;
};
if ((((_arg4 == null)) || ((_arg4 == undefined)))){
speed = _arg1.speed;
};
if ((((_arg1.jumpVar == -1)) || ((_arg1.jumpVar == 1)))){
speed = _arg1.speed;
};
if (_arg1.side){
};
_arg1.lasty = _arg1.tempY;
getMyCorners(_arg1.tempX, (_arg1.tempY + (speed * _arg3)), _arg1);
if (_arg3 == -1){
if (((_arg1.upleft) && (_arg1.upright))){
_arg1.tempY = (_arg1.tempY + (speed * _arg3));
} else {
_arg1.tempY = ((_arg1.ytile * game.tileH) + _arg1.tempHeight);
_arg1.jumpspeed = 0;
};
};
if (_arg3 == 1){
if (((((_arg1.downleft) && (_arg1.downright))) && (!(checkMovingTiles((speed * _arg3)))))){
_arg1.tempY = (_arg1.tempY + (speed * _arg3));
} else {
_arg1.jump = false;
if (_arg1.onMovingTile){
_arg1.tempY = ((_arg1.onMovingTile.tempY - _arg1.onMovingTile.tempHeight) - _arg1.tempHeight);
} else {
_arg1.tempY = (((_arg1.ytile + 1) * game.tileH) - _arg1.tempHeight);
char.reverse = "";
_arg1.reverse = "";
char.side = false;
_arg1.side = false;
char.sideSpeed = 0;
_arg1.sideSpeed = 0;
char.sideJump = 0;
_arg1.sideJump = 0;
char.jump = false;
checkJump = true;
_arg1.whichAnimation = "";
char.speed = 5;
jumpSide = false;
char.allowJump = true;
char.isJumping = false;
};
};
};
if (jumpSide){
getMyCorners((_arg1.tempX + (_arg1.sideSpeed * _arg2)), _arg1.tempY, _arg1);
if (_arg2 == -1){
if (((_arg1.downleft) && (_arg1.upleft))){
_arg1.tempX = (_arg1.tempX + (_arg1.sideSpeed * _arg2));
fall(_arg1);
} else {
_arg1.tempX = ((_arg1.xtile * game.tileW) + _arg1.tempWidth);
fall(_arg1);
};
};
if (_arg2 == 1){
if (((_arg1.downright) && (_arg1.upright))){
_arg1.tempX = (_arg1.tempX + (_arg1.sideSpeed * _arg2));
fall(_arg1);
} else {
_arg1.tempX = (((_arg1.xtile + 1) * game.tileW) - _arg1.tempHeight);
fall(_arg1);
};
};
} else {
getMyCorners((_arg1.tempX + (speed * _arg2)), _arg1.tempY, _arg1);
if (_arg2 == -1){
if (((_arg1.downleft) && (_arg1.upleft))){
_arg1.tempX = (_arg1.tempX + (speed * _arg2));
fall(_arg1);
} else {
_arg1.tempX = ((_arg1.xtile * game.tileW) + _arg1.tempWidth);
fall(_arg1);
};
};
if (_arg2 == 1){
if (((_arg1.downright) && (_arg1.upright))){
_arg1.tempX = (_arg1.tempX + (speed * _arg2));
fall(_arg1);
} else {
_arg1.tempX = (((_arg1.xtile + 1) * game.tileW) - _arg1.tempHeight);
fall(_arg1);
};
};
};
updateChar(_arg1, _arg2, _arg3);
return (true);
}
public function bonusLevelExpired(_arg1:String):void{
startScroll = false;
removeControls();
if (char.alive){
char.alive = false;
if (theRoot.bonusLevelBandages >= 10){
theRoot.resetGame(true);
} else {
theRoot.resetGame(false);
};
};
}
private function addBulletSplat(_arg1:Number, _arg2:Number, _arg3:Number):void{
var _local4:*;
_local4 = new BulletSplat();
_local4.name = "bulletSplat";
_local4.x = _arg1;
_local4.y = _arg2;
_local4.play();
_local4.scaleX = _arg3;
theRoot.ForegroundLayer.addChild(_local4);
theRoot.animationChecker(_local4, 15, removeBulletSplat);
}
public function removeAvatar():void{
var _local1:*;
var _local2:*;
var _local3:*;
var _local4:*;
removeControls();
_local1 = bulletArray.length;
while (_local1--) {
_local2 = bulletArray[_local1];
_local2.clip.parent.removeChild(_local2.clip);
bulletArray.splice(_local1, 1);
_local2 = null;
};
bulletArray = new Array();
_local1 = movingTileArray.length;
while (_local1--) {
_local3 = movingTileArray[_local1];
_local3.clip.parent.removeChild(_local3.clip);
movingTileArray.splice(_local1, 1);
_local3 = null;
};
movingTileArray = new Array();
if (theRoot.AvatarLayer.getChildByName("avatar")){
_local4 = theRoot.AvatarLayer.getChildByName("avatar");
_local4.parent.removeChild(_local4);
};
}
public function killTofu():void{
char.alive = false;
startScroll = false;
removeControls();
addTofuSplat(false);
}
private function checkObjects(_arg1:Number, _arg2:Number):void{
var _local3:String;
var _local4:Boolean;
var _local5:*;
_local3 = ((("t_" + String(_arg2)) + "_") + String(_arg1));
if (theRoot.ForegroundLayer.getChildByName(_local3)){
_local5 = theRoot.ForegroundLayer.getChildByName(_local3);
if ((((_local5.flame == true)) && (_local5.visible))){
_local5.visible = false;
if (!_local5.bladeHit){
_local5.bladeHit = true;
killTofu();
theRoot.animationClass.soundHandler("sizzle", 0.7, false);
};
};
};
_local3 = ((("t_" + String(_arg2)) + "_") + String(_arg1));
if (theRoot.ObjectsLayer.getChildByName(_local3)){
_local5 = theRoot.ObjectsLayer.getChildByName(_local3);
if ((((_local5.bonus == true)) && (_local5.visible))){
_local5.visible = false;
theRoot.animationClass.soundHandler("bandAid", 0.7, false);
if (theRoot.whichLevel != 11){
updateBandage = true;
} else {
theRoot.bonusLevelBandages = (theRoot.bonusLevelBandages + 1);
};
};
};
_local3 = ((("t_" + String(_arg2)) + "_") + String(_arg1));
_local4 = getMyMov(_local3, "trampoline", char);
if (((_local4) && (!(char.jump)))){
char.isJumping = false;
char.allowJump = false;
char.jump = true;
char.jumpspeed = -15;
char.sideSpeed = 0;
char.reverse = "";
char.reverse = "";
char.side = true;
jump(char);
theRoot.animationClass.soundHandler("boing", 0.7, false);
_local5 = theRoot.ObjectsLayer.getChildByName(_local3);
_local5.gotoAndPlay("on");
};
_local3 = ((("GF" + String(_arg2)) + "_") + String(_arg1));
if (theRoot.ObjectsLayer.getChildByName(_local3)){
if (theRoot.ObjectsLayer.getChildByName(_local3).visible){
startScroll = false;
theRoot.ObjectsLayer.getChildByName(_local3).visible = false;
removeControls();
addGFAnimation();
char.clip.y = theRoot.ObjectsLayer.getChildByName(_local3).y;
};
};
_local3 = ((("t_" + String((_arg2 + 1))) + "_") + String(_arg1));
_local4 = getMyMov(_local3, "falling", char);
if (_local4){
_local5 = theRoot.ForegroundLayer.getChildByName(_local3);
if (!_local5.falling){
_local5.falling = true;
theRoot.addTimer(_local5, makeTileFall, 1, 450);
};
};
_local3 = ((("t_" + String((_arg2 + 1))) + "_") + String((_arg1 + 1)));
_local4 = getMyMov(_local3, "falling", char);
if (_local4){
_local5 = theRoot.ForegroundLayer.getChildByName(_local3);
if (!_local5.falling){
_local5.falling = true;
theRoot.addTimer(_local5, makeTileFall, 1, 450);
};
};
_local3 = ((("t_" + String((_arg2 + 1))) + "_") + String((_arg1 - 1)));
_local4 = getMyMov(_local3, "falling", char);
if (_local4){
_local5 = theRoot.ForegroundLayer.getChildByName(_local3);
if (!_local5.falling){
_local5.falling = true;
theRoot.addTimer(_local5, makeTileFall, 1, 450);
};
};
_local3 = ((("t_" + String(_arg2)) + "_") + String((_arg1 - 1)));
_local4 = getMyMov(_local3, "falling", char);
if (_local4){
_local5 = theRoot.ForegroundLayer.getChildByName(_local3);
if (!_local5.falling){
_local5.falling = true;
theRoot.addTimer(_local5, makeTileFall, 1, 450);
};
};
_local3 = ((("t_" + String(_arg2)) + "_") + String((_arg1 + 1)));
_local4 = getMyMov(_local3, "falling", char);
if (_local4){
_local5 = theRoot.ForegroundLayer.getChildByName(_local3);
if (!_local5.falling){
_local5.falling = true;
theRoot.addTimer(_local5, makeTileFall, 1, 450);
};
};
_local3 = ((("t_" + String(_arg2)) + "_") + String(_arg1));
_local4 = getMyMov(_local3, "falling", char);
if (_local4){
_local5 = theRoot.ForegroundLayer.getChildByName(_local3);
if (!_local5.falling){
_local5.falling = true;
theRoot.addTimer(_local5, makeTileFall, 1, 450);
};
};
_local3 = ((("t_" + String(_arg2)) + "_") + String(_arg1));
_local4 = getMyMov(_local3, "blade", char);
if (_local4){
_local5 = theRoot.ForegroundLayer.getChildByName(_local3);
if (!_local5.bladeHit){
_local5.bladeHit = true;
theRoot.animationClass.soundHandler("bladeSound", 0.7, false);
killTofu();
};
};
}
private function addParticles(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
var xTile:Number;
var yTile:Number;
var whichName:String;
var allowSplat:Boolean;
var addJumpSplat:Function;
var addSplat:Function;
var X = _arg1;
var Y = _arg2;
var dirX = _arg3;
var dirY = _arg4;
addJumpSplat = function (_arg1:String, _arg2:Number, _arg3:Number){
var _local4:*;
var _local5:*;
_local4 = new jumpSplat();
_local4.name = "splat";
_local4.x = (_local4.x + _arg2);
_local4.y = (_local4.y + _arg3);
_local5 = theRoot.ForegroundLayer.getChildByName(_arg1);
_local5.allowSplat = false;
_local5.addChild(_local4);
_local5.allowSplat = false;
theRoot.animationChecker(_local4, 13, removeSplat);
};
addSplat = function (_arg1:String, _arg2:Number, _arg3:Number){
var _local4:*;
var _local5:*;
_local4 = new runSplat();
_local4.name = "splat";
_local4.x = (_local4.x + (_arg2 - (dirX * 10)));
_local4.y = (_local4.y + _arg3);
_local5 = theRoot.ForegroundLayer.getChildByName(_arg1);
_local5.allowSplat = false;
_local5.addChild(_local4);
_local5.allowSplat = false;
theRoot.animationChecker(_local4, 13, removeSplat);
};
xTile = X;
yTile = Y;
whichName = ((("t_" + String(yTile)) + "_") + String((xTile - 1)));
allowSplat = getMyMov(whichName, "allowSplat", char);
if (allowSplat){
addSplat(whichName, 20, 20);
};
whichName = ((("t_" + String(yTile)) + "_") + String((xTile + 1)));
allowSplat = getMyMov(whichName, "allowSplat", char);
if (allowSplat){
addSplat(whichName, -20, 20);
};
whichName = ((("t_" + String((yTile + 1))) + "_") + String(xTile));
allowSplat = getMyMov(whichName, "allowSplat", char);
if (allowSplat){
if (char.jump){
addJumpSplat(whichName, 10, 0);
} else {
addSplat(whichName, 0, 0);
};
};
}
public function removeBulletSplat(_arg1):void{
_arg1.parent.removeChild(_arg1);
}
private function detectKeys(_arg1:Event){
var _local2:*;
var _local3:*;
if (((!(theRoot.pauseGame)) && (theRoot.bugFix))){
moveTiles();
_local2 = char;
_local3 = false;
if (space){
space = false;
if (((!(_local2.jump)) && (_local2.allowJump))){
char.isJumping = false;
char.allowJump = false;
_local2.jump = true;
_local2.jumpspeed = _local2.jumpstart;
_local2.sideSpeed = _local2.speed;
char.reverse = "";
_local2.reverse = "";
char.side = true;
char.onMovingTile = false;
_local2.onMovingTile = false;
theRoot.animationClass.soundHandler("splatSound", 1.5, false);
jumpSide = true;
} else {
if (checkWallJump(_local2)){
char.isJumping = false;
char.allowJump = false;
_local2.jump = true;
_local2.jumpspeed = -6;
char.side = true;
jumpSide = true;
_local2.onMovingTile = false;
theRoot.animationClass.soundHandler("splatSound", 1, false);
} else {
char.reverse = "";
_local2.reverse = "";
};
};
};
if (_local2.jump){
_local3 = jump(_local2);
};
if (left){
_local2.left = true;
getMyCorners((_local2.tempX - _local2.speed), _local2.tempY, _local2);
if (_local2.jump){
if (_local2.sideSpeed < 7){
_local2.sideSpeed = (_local2.sideSpeed + sideDecay);
};
_local2.sideJump = -1;
getMyCorners((_local2.tempX - _local2.sideSpeed), _local2.tempY, _local2);
} else {
_local2.reverse = "";
char.reverse = "";
char.sideSpeed = 0;
char.side = 0;
_local2.sideSpeed = 0;
_local2.side = 0;
};
if (((((!(_local2.climb)) || (((((((_local2.upright) && (_local2.downright))) && (_local2.downleft))) && (_local2.upleft))))) && (left))){
_local2.jumpVar = null;
if (!checkMovingTiles(1)){
char.onMovingTile = false;
} else {
char.reverse = "";
_local2.reverse = "";
char.side = false;
_local2.side = false;
char.sideSpeed = 0;
_local2.sideSpeed = 0;
char.sideJump = 0;
_local2.sideJump = 0;
char.jump = false;
checkJump = true;
_local2.whichAnimation = "";
char.speed = 5;
jumpSide = false;
char.allowJump = true;
char.isJumping = false;
};
_local3 = moveChar(_local2, -1, 0, 0);
};
};
if (right){
_local2.right = true;
getMyCorners((_local2.tempX - _local2.speed), _local2.tempY, _local2);
if (_local2.jump){
if (_local2.sideSpeed < 7){
_local2.sideSpeed = (_local2.sideSpeed + sideDecay);
};
_local2.sideJump = 1;
getMyCorners((_local2.tempX - _local2.sideSpeed), _local2.tempY, _local2);
} else {
_local2.reverse = "";
char.reverse = "";
char.sideSpeed = 0;
char.side = 0;
_local2.sideSpeed = 0;
_local2.side = 0;
};
if (((((!(_local2.climb)) || (((((((_local2.upright) && (_local2.downright))) && (_local2.downleft))) && (_local2.upleft))))) && (right))){
_local2.jumpVar = null;
if (!checkMovingTiles(1)){
char.onMovingTile = false;
} else {
char.reverse = "";
_local2.reverse = "";
char.side = false;
_local2.side = false;
char.sideSpeed = 0;
_local2.sideSpeed = 0;
char.sideJump = 0;
_local2.sideJump = 0;
char.jump = false;
checkJump = true;
_local2.whichAnimation = "";
char.speed = 5;
jumpSide = false;
char.allowJump = true;
char.isJumping = false;
};
_local3 = moveChar(_local2, 1, 0, 0);
};
};
fall(_local2);
if (!_local3){
char.whichAnimation = "";
_local2.whichAnimation = "";
};
animateCharacter(_local2);
if (needToScroll){
checkForScrolling();
};
moveBullets();
};
}
private function animateCharacter(_arg1:Object):void{
var _local2:*;
var _local3:String;
_local2 = _arg1.clip.getChildByName("innerTofu");
_local3 = "";
if (!_arg1.jump){
if (((!((_arg1.currentAnimation == "run"))) && (((right) || (left))))){
_local3 = "run";
} else {
if (((!(right)) && (!(left)))){
_local3 = "standing";
};
};
} else {
if (_arg1.jumpspeed < 0){
_local3 = "jumpDown";
} else {
_local3 = "jumpUp";
};
};
if (_local3 != ""){
_arg1.currentAnimation = _local3;
_local2.gotoAndPlay(_local3);
};
}
private function makeTileFall(_arg1):void{
_arg1.walkable = true;
fall(char);
_arg1.gotoAndPlay("fall");
}
private function addAvatar(_arg1:Number, _arg2:Number):void{
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
trace(("GAMELAYER" + theRoot.gameLayer.height));
_local3 = bulletArray.length;
while (_local3--) {
_local5 = bulletArray[_local3];
_local5.clip.parent.removeChild(_local5.clip);
bulletArray.splice(_local3, 1);
_local5 = null;
};
bulletArray = new Array();
left = false;
right = false;
space = false;
checkJump = true;
rightKey = false;
leftKey = false;
jumpSide = false;
startScroll = false;
allowScroll = false;
updateBandage = false;
speed = 6;
jumpVar = 0;
dirx;
scrollOffset = 0;
if (theRoot.AvatarLayer.getChildByName("avatar")){
_local6 = theRoot.AvatarLayer.getChildByName("avatar");
_local6.parent.removeChild(_local6);
};
_local4 = new Avatar();
_local4.name = "avatar";
theRoot.AvatarLayer.addChild(_local4);
char = new Object();
char.originalX = _arg1;
char.originalY = _arg2;
char.clip = _local4;
char.speed = 5;
char.jumpstart = -5;
char.gravity = 0.25;
char.jump = false;
char.tempWidth = 10;
char.tempHeight = 10;
char.tempX = (_arg1 + char.tempWidth);
char.tempY = (_arg2 + char.tempHeight);
char.jumpDir = "";
char.clip.x = char.tempX;
char.clip.y = char.tempY;
char.xtile = Math.floor((char.clip.x / game.tileW));
char.ytile = Math.floor((char.clip.y / game.tileH));
char.isJumping = false;
char.allowJump = true;
char.climb = false;
char.sideJump = 0;
char.sideSpeed = 0;
char.reverse = "";
char.side = false;
char.clip.visible = false;
char.onMovingTile = false;
char.alive = true;
addStartSplat(char.clip.x, char.clip.y);
trace(theRoot.levelHeight);
trace(theRoot.gameLayer.height);
if (theRoot.levelHeight > 500){
theRoot.containerLayer.y = 18;
theRoot.gameLayer.y = -((theRoot.levelHeight - 500));
allowScroll = true;
needToScroll = true;
};
if (theRoot.whichLevel != 11){
scrollSpeed = 1.5;
} else {
scrollSpeed = 1;
};
setupControls();
theRoot.trackingHandler((("Level" + theRoot.whichLevel) + " started"));
}
public function removeControls():void{
trace("REMOVE CONTROLS");
theRoot.stage.removeEventListener(KeyboardEvent.KEY_DOWN, checkKey);
theRoot.stage.removeEventListener(KeyboardEvent.KEY_UP, checkKey);
theRoot.removeEventListener(Event.ENTER_FRAME, detectKeys);
}
private function fall(_arg1:Object):void{
if (!_arg1.jump){
getMyCorners(_arg1.tempX, (_arg1.tempY + 1), _arg1);
if (((((_arg1.downleft) && (_arg1.downright))) && (!(checkMovingTiles(1))))){
_arg1.jumpspeed = 0;
_arg1.jump = true;
char.isJumping = true;
_arg1.climb = false;
_arg1.sideSpeed = _arg1.speed;
char.side = true;
jumpSide = true;
_arg1.onMovingTile = false;
char.onMovingTile = false;
} else {
getMyCorners(_arg1.tempX, (_arg1.tempY + 1), _arg1);
if (((((!(_arg1.downleft)) && (!(_arg1.downright)))) && (!(checkMovingTiles(1))))){
char.onMovingTile = false;
};
};
};
}
public function resetAvatar():void{
addAvatar(char.originalX, char.originalY);
}
public function removeTofuSplat(_arg1):void{
theRoot.resetGame(_arg1.result);
_arg1.parent.removeChild(_arg1);
}
private function checkMovingTiles(_arg1:Number){
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Boolean;
var _local6:*;
var _local7:*;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
if (char.diry != -1){
_local2 = ((char.tempY + char.tempHeight) + _arg1);
_local3 = (char.tempX + char.tempWidth);
_local4 = (char.tempX - char.tempWidth);
_local5 = false;
for (_local6 in movingTileArray) {
_local7 = movingTileArray[_local6];
_local8 = (_local7.tempY + _local7.tempHeight);
_local9 = (_local7.tempY - _local7.tempHeight);
_local10 = (_local7.tempX + _local7.tempWidth);
_local11 = (_local7.tempX - _local7.tempWidth);
if ((char.lasty + char.tempHeight) <= _local9){
if ((((_local2 <= _local8)) && ((_local2 >= _local9)))){
if ((((_local3 > _local11)) && ((_local3 < _local10)))){
char.onMovingTile = _local7;
_local5 = true;
break;
} else {
if ((((_local4 > _local11)) && ((_local4 < _local10)))){
char.onMovingTile = _local7;
_local5 = true;
break;
};
};
};
};
};
return (_local5);
};
}
private function updateChar(_arg1:Object, _arg2:Number, _arg3:Number):void{
_arg1.clip.x = _arg1.tempX;
_arg1.clip.y = _arg1.tempY;
_arg1.dirx = _arg2;
_arg1.diry = _arg3;
if (_arg1.dirx == 1){
_arg1.clip.scaleX = -1;
} else {
if (_arg1.dirx == -1){
_arg1.clip.scaleX = 1;
};
};
_arg1.xtile = mathFloor((_arg1.clip.x / game.tileW));
_arg1.ytile = mathFloor((_arg1.clip.y / game.tileH));
addBlood(_arg1.xtile, _arg1.ytile);
addParticles(_arg1.xtile, _arg1.ytile, _arg1.dirx, _arg1.diry);
checkObjects(_arg1.xtile, _arg1.ytile);
}
private function addBlood(_arg1:Number, _arg2:Number):void{
var whichTile:*;
var whichName:String;
var whichMov:*;
var whichFrame:String;
var attachBlood:Function;
var X = _arg1;
var Y = _arg2;
attachBlood = function (_arg1:MovieClip, _arg2:String){
var _local3:Boolean;
var _local4:*;
var _local5:*;
var _local6:*;
_local3 = false;
switch (_arg2){
case "UP":
_local3 = _arg1.upBlood;
_arg1.upBlood = false;
break;
case "DOWN":
_local3 = _arg1.downBlood;
_arg1.downBlood = false;
break;
case "LEFT":
_local3 = _arg1.leftBlood;
_arg1.leftBlood = false;
break;
case "RIGHT":
_local3 = _arg1.rightBlood;
_arg1.rightBlood = false;
break;
};
if (_local3){
_local4 = mathCeil((mathRandom() * 2));
_local5 = getDefinitionByName(("Blood" + String(_local4)));
_local6 = new (_local5);
_arg1.addChild(_local6);
_local6.gotoAndStop(_arg2);
_local6.name = "blood";
};
if (_arg1.numChildren == 5){
_arg1.blood = false;
};
};
whichName = ((("t_" + Y) + "_") + (X + 1));
whichTile = getMyMov(whichName, "blood", char);
if (whichTile){
whichMov = theRoot.ForegroundLayer.getChildByName(whichName);
whichFrame = "LEFT";
attachBlood(whichMov, whichFrame);
};
whichName = ((("t_" + Y) + "_") + (X - 1));
whichTile = getMyMov(whichName, "blood", char);
if (whichTile){
whichMov = theRoot.ForegroundLayer.getChildByName(whichName);
whichFrame = "RIGHT";
attachBlood(whichMov, whichFrame);
};
whichName = ((("t_" + (Y + 1)) + "_") + X);
whichTile = getMyMov(whichName, "blood", char);
if (whichTile){
whichMov = theRoot.ForegroundLayer.getChildByName(whichName);
whichFrame = "UP";
attachBlood(whichMov, whichFrame);
};
whichName = ((("t_" + (Y - 1)) + "_") + X);
whichTile = getMyMov(whichName, "blood", char);
if (whichTile){
whichMov = theRoot.ForegroundLayer.getChildByName(whichName);
whichFrame = "DOWN";
attachBlood(whichMov, whichFrame);
};
}
public function removeSplat(_arg1):void{
_arg1.parent.allowSplat = true;
_arg1.parent.removeChild(_arg1);
}
}
}//package
Section 202
//TofuBoy_Levels (TofuBoy_Levels)
package {
public class TofuBoy_Levels {
public static function returnForeground(_arg1:Number):Array{
var _local2:Array;
_local2 = new Array();
switch (_arg1){
case 1:
_local2 = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 4, 8, 7, 8, 8, 9, 0, 0, 0, 0, 0, 0, 0, 1], [1, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 1], [1, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 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, 1, 1, 1, 1, 1, 1, 1]];
break;
case 11:
_local2 = [[13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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 0, 0, 0, 0, 0], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 18, 14, 0, 0, 0, 14, 17, 0, 0, 0, 13], [13, 0, 0, 14, 14, 14, 0, 0, 0, 14, 14, 14, 0, 0, 13], [13, 0, 0, 0, 0, 14, 0, 0, 0, 14, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 14, 0, 0, 0, 14, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 14, 0, 0, 0, 14, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 14, 0, 0, 0, 14, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 14, 0, 0, 0, 14, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 14, 0, 0, 0, 14, 0, 0, 0, 0, 13], [13, 0, 0, 0, 14, 0, 0, 0, 0, 0, 14, 0, 0, 0, 13], [13, 0, 0, 0, 14, 0, 0, 0, 0, 0, 14, 0, 0, 0, 13], [13, 14, 14, 14, 14, 0, 0, 0, 0, 0, 14, 14, 14, 14, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 14, 14, 14, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 14, 14, 0, 0, 14, 14, 0, 0, 0, 0, 0, 13], [13, 0, 0, 14, 14, 0, 0, 14, 14, 0, 0, 0, 0, 0, 13], [13, 0, 0, 14, 14, 0, 0, 14, 14, 0, 0, 0, 0, 0, 13], [13, 0, 0, 14, 14, 0, 0, 14, 14, 0, 0, 0, 0, 0, 13], [13, 0, 0, 14, 14, 0, 0, 14, 14, 0, 0, 0, 0, 0, 13], [13, 14, 14, 14, 14, 14, 14, 14, 14, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 20, 20, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 20, 20, 21, 21, 21, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13], [13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13]];
break;
};
return (_local2);
}
public static function returnObjects(_arg1:Number):Array{
var _local2:Array;
_local2 = new Array();
switch (_arg1){
case 1:
_local2 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 283, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0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 0, 0, 0, 0, 0, 0, 0, 282], [282, 3, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 282], [282, 3, 0, 0, 0, 0, 0, 282, 282, 282, 282, 282, 282, 282, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 3, 3, 3, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 3, 3, 3, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 3, 3, 3, 0, 0, 0, 0, 0, 3, 3, 3, 3, 282], [282, 282, 282, 282, 282, 0, 0, 281, 0, 0, 282, 282, 282, 282, 282], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
break;
case 5:
_local2 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 283, 0, 282], [282, 3, 0, 0, 0, 0, 3, 3, 3, 3, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 3, 3, 3, 3, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 284], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 284], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 284], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 0], [282, 3, 0, 0, 0, 0, 0, 3, 282, 282, 282, 282, 282, 282, 0], [0, 0, 0, 0, 0, 0, 0, 3, 282, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 282, 282, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 282, 282, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 287, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 282, 282, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 3, 282, 282, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 3, 282, 282, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 282, 282, 0, 0, 0, 0, 0, 0], [282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 282], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 282], [0, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 281, 0, 282], [0, 282, 282, 282, 282, 282, 282, 282, 282, 282, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
break;
case 6:
_local2 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282, 0, 0, 0, 0, 282, 282, 0], [282, 3, 0, 0, 0, 0, 3, 282, 0, 0, 0, 0, 3, 3, 0], [282, 3, 0, 0, 0, 0, 3, 282, 0, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282, 0, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282, 0, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282, 0, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282, 0, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282, 0, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282, 282, 282, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282, 3, 3, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282, 3, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282, 3, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282, 3, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282, 3, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282,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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 295, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 292, 289, 289, 289, 289, 289, 289, 289, 289, 291, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 287, 0, 0, 0, 0, 0], [0, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0], [0, 282, 282, 282, 282, 282, 282, 282, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 0, 282, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 0, 282, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 282, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 282, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 3, 3, 3, 282, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 3, 3, 3, 282, 0, 0, 0, 0, 0, 0], [0, 285, 0, 0, 0, 3, 282, 282, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 3, 282, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 3, 282, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 3, 282, 0, 0, 0, 0, 0, 0, 0, 0], [0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, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 285, 0, 0, 0, 0, 0, 0, 0, 0, 287, 282], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 3, 3, 3, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 282, 282, 282, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [3, 3, 3, 3, 3, 3, 0, 0, 0, 3, 3, 3, 3, 3, 3], [282, 282, 282, 282, 282, 3, 0, 0, 0, 3, 282, 282, 282, 282, 282], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 281, 0, 0, 0, 0, 0, 0, 0], [282, 282, 282, 282, 282, 282, 282, 0, 282, 282, 282, 282, 282, 282, 282]];
break;
case 8:
_local2 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [283, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 3, 282], [0, 0, 282, 282, 282, 282, 282, 282, 282, 3, 0, 0, 0, 3, 282], [0, 0, 0, 0, 0, 0, 0, 0, 282, 3, 0, 0, 0, 3, 282], [0, 0, 0, 0, 0, 0, 0, 0, 282, 3, 0, 0, 0, 3, 282], [0, 0, 0, 0, 0, 0, 0, 0, 282, 3, 0, 0, 0, 3, 282], [0, 0, 0, 0, 0, 0, 0, 0, 282, 3, 0, 0, 0, 3, 282], [0, 0, 0, 0, 0, 0, 0, 0, 282, 3, 0, 0, 0, 3, 282], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 282, 0, 0, 0, 3, 0], [0, 0, 0, 0, 294, 288, 288, 288, 288, 288, 288, 288, 288, 288, 293], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [282, 287, 0, 0, 0, 282, 0, 0, 0, 0, 0, 0, 0, 0, 0], [292, 289, 289, 289, 289, 289, 289, 289, 289, 289, 291, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 282, 282, 282, 0, 0, 0, 0], [0, 0, 0, 0, 294, 288, 288, 288, 288, 288, 288, 288, 288, 288, 293], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 282], [282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 282], [0, 0, 0, 0, 282, 282, 282, 0, 0, 0, 0, 0, 0, 0, 282], [294, 288, 288, 288, 288, 288, 288, 288, 288, 288, 293, 0, 0, 0, 0], [282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 292, 289, 289, 289, 289, 289, 289, 289, 289, 289, 291], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [294, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 293, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 282, 0, 0, 0], [282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 0, 281, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
break;
case 9:
_local2 = [[281, 0, 0, 0, 0, 282, 3, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 282, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 282, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 282, 0, 282, 3, 0, 0, 0, 0, 3, 282, 0, 0], [0, 0, 0, 0, 0, 282, 3, 0, 0, 0, 0, 3, 282, 0, 0], [0, 0, 0, 0, 0, 282, 0, 0, 0, 0, 0, 3, 282, 0, 0], [0, 0, 0, 0, 0, 282, 3, 0, 0, 0, 0, 0, 282, 0, 0], [0, 282, 0, 0, 0, 282, 3, 0, 0, 0, 0, 3, 282, 0, 0], [0, 0, 0, 0, 0, 282, 3, 0, 0, 0, 0, 3, 282, 0, 0], [0, 0, 0, 0, 0, 282, 0, 0, 0, 0, 0, 0, 282, 0, 0], [0, 0, 0, 0, 0, 282, 0, 0, 0, 0, 0, 3, 282, 0, 0], [0, 0, 0, 0, 0, 282, 3, 0, 0, 0, 0, 3, 282, 0, 0], [0, 0, 0, 282, 0, 282, 3, 0, 0, 0, 0, 3, 282, 0, 0], [0, 0, 0, 0, 0, 282, 3, 0, 0, 0, 0, 0, 282, 0, 0], [0, 0, 0, 0, 0, 282, 0, 0, 0, 0, 0, 3, 282, 0, 0], [0, 0, 0, 287, 0, 282, 3, 0, 0, 0, 0, 3, 282, 0, 0], [0, 0, 0, 0, 0, 282, 3, 0, 0, 0, 0, 3, 282, 0, 0], [0, 282, 0, 0, 0, 282, 3, 0, 0, 0, 0, 0, 282, 0, 0], [0, 0, 0, 0, 0, 282, 0, 0, 0, 0, 0, 0, 282, 0, 0], [0, 0, 0, 0, 0, 282, 3, 0, 0, 0, 0, 3, 282, 0, 0], [0, 0, 0, 0, 0, 282, 3, 0, 0, 0, 0, 3, 282, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 285, 0, 0], [0, 0, 0, 282, 0, 0, 0, 0, 0, 0, 0, 0, 285, 0, 0], [285, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 283, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
break;
case 10:
_local2 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282, 0, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282, 0, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282, 0, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282, 0, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282, 282, 282, 282, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282, 3, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282, 3, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282, 3, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282, 3, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282, 3, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282, 3, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282, 3, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282, 3, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282, 3, 0, 0, 0, 282, 282, 0], [282, 3, 0, 0, 0, 0, 3, 282, 3, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 3, 282, 3, 0, 0, 0, 0, 283, 0], [282, 0, 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 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 3, 3, 3, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 282], [282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 3, 3, 3, 0, 0, 0, 0, 3, 282], [282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 3, 3, 3, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 282], [282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 282], [282, 282, 0, 0, 0, 0, 0, 0, 0, 0, 282, 282, 282, 282, 282], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 285, 0, 0, 0, 3, 282, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 3, 282, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 285, 0, 0, 0, 3, 282, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 3, 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, 0, 292, 289, 289, 289, 289, 289, 289, 289, 289, 289, 291], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 282], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 282], [0, 282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 282], [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0], [282, 282, 282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 282, 0, 0, 0, 0, 0, 0], [0, 0, 0, 294, 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, 293], [0, 0, 0, 282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 281, 0, 282, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
break;
case 11:
_local2 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 287, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 287, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 287, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 287, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0], [0, 287, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 287, 0], [0, 287, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 287, 0], [0, 0, 0, 0, 0, 0, 0, 287, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 287, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 287, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 287, 0], [0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0], [0, 282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282, 0], [0, 282, 282, 3, 0, 0, 0, 0, 0, 0, 0, 3, 282, 282, 0], [0, 282, 282, 282, 3, 0, 0, 0, 0, 0, 3, 282, 282, 282, 0], [0, 282, 282, 282, 282, 3, 0, 0, 0, 3, 282, 282, 282, 282, 0], [0, 282, 282, 282, 282, 282, 0, 0, 0, 282, 282, 282, 282, 282, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 287, 0, 0, 0, 0, 0, 0, 0, 0, 0, 287, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 287, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 287, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 287, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 287, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 287, 286, 287, 0, 0, 0, 0, 3, 282], [282, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 282], [0, 287, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 287, 0], [0, 287, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 287, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 287, 0, 0, 0, 287, 0, 0, 0, 0, 0], [0, 0, 0, 290, 0, 0, 0, 0, 0, 0, 0, 290, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 287, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 287, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 287, 0, 0, 0, 0, 0, 287, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 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, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 287, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 290, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 287, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 287, 0], [0, 287, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 290, 290, 0, 0, 0, 0, 0, 0, 0, 0, 0, 281, 287, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
break;
};
return (_local2);
}
}
}//package
Section 203
//TofuBoy_Menu (TofuBoy_Menu)
package {
import flash.net.*;
import flash.events.*;
import flash.display.*;
import caurina.transitions.*;
import flash.text.*;
import flash.utils.*;
import flash.system.*;
import flash.xml.*;
public class TofuBoy_Menu extends MovieClip {
public var menuBG:MovieClip;
public var playCountText:TextField;
private var theRoot;
private var menuHolder:Sprite;
private var focusObject;
private var currentScreen:String;
private var tabbedIndex:int;// = 0
private var enterKey:Number;
public var TitleText:TextField;
private var escKey:Number;
public var logo:MovieClip;
public function TofuBoy_Menu(_arg1, _arg2, _arg3:String){
tabbedIndex = 0;
super();
addFrameScript(0, frame1, 1, frame2, 10, frame11, 20, frame21, 30, frame31, 40, frame41, 50, frame51);
theRoot = _arg1;
if (theRoot.online){
enterKey = 27;
escKey = 13;
} else {
enterKey = 220;
escKey = 16;
};
_arg2.addChild(this);
this.x = 21;
this.y = 18;
this.name = "menu";
menuHolder = new Sprite();
this.gotoAndStop(_arg3);
this.addChild(menuHolder);
if (!theRoot.firstRun){
this.menuBG.alpha = 0;
Tweener.addTween(this.menuBG, {transition:"linear", time:0.5, alpha:0.8, onComplete:completeHandler, onCompleteParams:[_arg3]});
} else {
this.menuBG.alpha = 0.8;
completeHandler(_arg3);
};
theRoot.stage.addEventListener(KeyboardEvent.KEY_DOWN, checkKey);
}
private function updateLogo(_arg1){
trace("FOUND LOGO");
_arg1.gotoAndStop(("peta" + theRoot.whichVersion));
}
private function menuHandler(_arg1:MouseEvent){
var _local2:*;
var _local3:*;
var _local4:*;
_local2 = _arg1.currentTarget;
_local3 = _arg1.target.tag;
_local4 = _arg1.type;
switch (_local4){
case "mouseOver":
_local2.gotoAndStop("on");
focusObject = _local2;
theRoot.animationClass.soundHandler("click", 1, false);
break;
case "mouseOut":
_local2.gotoAndStop("off");
focusObject = _local2;
break;
case "click":
if (_local3 == 0){
if (_local2.name != "Embed"){
constructMenu(_local2.name);
} else {
clearMenu();
populateText(_local2.name);
};
} else {
removeTool();
theRoot.changeLevel(_local3);
trace("SETTING PAUSE TO FALSE");
theRoot.pauseGame = false;
theRoot.stage.focus = theRoot;
};
break;
};
}
public function removeTool(){
if (currentScreen == "Intro"){
theRoot.bugFix = true;
};
clearMenu();
theRoot.stage.removeEventListener(KeyboardEvent.KEY_DOWN, checkKey);
this.removeChild(menuHolder);
this.parent.removeChild(this);
theRoot.stage.focus = theRoot.stage;
}
private function clearMenu():void{
var _local1:int;
var _local2:*;
_local1 = menuHolder.numChildren;
while (_local1--) {
_local2 = menuHolder.getChildAt(_local1);
_local2.removeEventListener(MouseEvent.CLICK, menuHandler);
_local2.removeEventListener(MouseEvent.MOUSE_OVER, menuHandler);
_local2.removeEventListener(MouseEvent.MOUSE_OUT, menuHandler);
_local2.addEventListener(FocusEvent.FOCUS_IN, focusHandler);
_local2.addEventListener(FocusEvent.FOCUS_OUT, focusHandler);
menuHolder.removeChild(_local2);
};
}
private function returnIntroText():String{
var _local1:String;
switch (theRoot.whichLevel){
case 1:
_local1 = "<P ALIGN='CENTER'><FONT SIZE='18'><B>Welcome to Super Tofu Boy!</B></FONT><br><br>";
_local1 = (_local1 + "<FONT SIZE='12'>There will be blood - lots of it. So let's begin by getting used to the basic controls.</FONT><br><br>");
_local1 = (_local1 + "<FONT SIZE='12'>You can walk left and right using the arrow keys, and you can jump using the space bar.</FONT><br><br>");
_local1 = (_local1 + "<FONT SIZE='12'>Press Enter to Continue</FONT></P>");
break;
case 2:
_local1 = "<P ALIGN='CENTER'><FONT SIZE='12'><B>Not bad, but simple jumps won't cut it. It's time to step up your game.</B></FONT><br><br>";
_local1 = (_local1 + "<FONT SIZE='12'><B>Jump against a wall and then press the space bar to wall jump</B> your way to Bandage Girl's rescue.</FONT><br><br>");
_local1 = (_local1 + "<FONT SIZE='12'>After you pass the level, you'll be able to skip and revisit levels. As you complete levels, you'll unlock levels</FONT><br><br>");
_local1 = (_local1 + "<FONT SIZE='12'>Press Enter to Continue</FONT></P>");
break;
case 11:
_local1 = "<P ALIGN='CENTER'><FONT SIZE='18'><B>Bandage Bonus Level!</B></FONT><br><br>";
_local1 = (_local1 + "<FONT SIZE='12'>You have 20 seconds to collect bandages</FONT><br><br>");
_local1 = (_local1 + "<FONT SIZE='12'>Tip: You need 10 bandages to unlock a hidden video.</FONT><br><br>");
_local1 = (_local1 + "<FONT SIZE='12'>Press Enter to Continue</FONT></P>");
break;
};
return (_local1);
}
private function focusHandler(_arg1:FocusEvent){
var _local2:*;
var _local3:*;
_local2 = _arg1.type;
_local3 = _arg1.currentTarget;
switch (_local2){
case "focusIn":
if ((_local3 is MovieClip)){
_local3.gotoAndStop("on");
focusObject = _local3;
};
break;
case "focusOut":
if ((_local3 is MovieClip)){
_local3.gotoAndStop("off");
};
break;
};
}
function frame1(){
stop();
}
private function checkProgress():void{
var _local1:Boolean;
_local1 = true;
if (!theRoot.checkLevel1){
if (theRoot.whichLevel == 2){
_local1 = true;
trace(1);
};
} else {
if (!theRoot.checkLevel2){
if (theRoot.whichLevel == 6){
_local1 = true;
trace(2);
};
} else {
if (!theRoot.checkLevel3){
if (theRoot.whichLevel == 9){
_local1 = true;
trace(3);
};
};
};
};
if (_local1){
constructMenu("Levels");
} else {
removeTool();
theRoot.whichLevel = (theRoot.whichLevel + 1);
theRoot.changeLevel(theRoot.whichLevel);
theRoot.pauseGame = false;
trace("Setting pause game to false 2");
theRoot.stage.focus = theRoot;
};
}
private function populateText(_arg1:String):void{
var _local2:String;
var _local3:Boolean;
var _local4:TextFormat;
var _local5:TextField;
_local3 = false;
switch (_arg1){
case "Pause":
_local2 = "<P ALIGN='CENTER'><FONT SIZE='18'><B>Game Paused</FONT><br><br><FONT SIZE='12'>(press enter to exit)<br>(press escape to return)<br><br><br>";
_local2 = (_local2 + (("Tip: " + returnFact()) + "</B></FONT></P>"));
_local3 = true;
break;
case "GameOver":
_local3 = true;
break;
case "LevelComplete":
_local3 = true;
_local2 = "<P ALIGN='CENTER'><FONT SIZE='18'><B>Level Complete</FONT><br><br><FONT SIZE='12'>(press enter to advance)<br>(press escape to return)<br><br><br>";
_local2 = (_local2 + (("Tip: " + returnFact()) + "</B></FONT></P>"));
trace(theRoot.bonusLevelBandages);
if ((((theRoot.bonusLevelBandages >= 1)) && (theRoot.showVideo))){
trace("OPEN VIDEO");
theRoot.showVideo = false;
theRoot.wrapperClass.openVideoPlayer();
};
break;
case "Intro":
currentScreen = "Intro";
theRoot.pauseGame = true;
_local3 = true;
_local2 = returnIntroText();
break;
case "Outro":
currentScreen = "Outro";
_local3 = true;
_local2 = returnOutroText();
this.gotoAndStop("GameOver");
break;
};
if (_local3){
_local4 = new TextFormat();
_local4.font = "arial";
_local4.color = "0xFFFFFF";
_local5 = new TextField();
_local5.type = TextFieldType.DYNAMIC;
_local5.antiAliasType = AntiAliasType.ADVANCED;
_local5.wordWrap = true;
_local5.selectable = false;
_local5.defaultTextFormat = _local4;
_local5.embedFonts = true;
_local5.width = 200;
_local5.height = 400;
_local5.multiline = true;
_local5.x = (150 - (_local5.width / 2));
_local5.y = (350 - (_local5.height / 2));
_local5.htmlText = _local2;
_local5.autoSize = TextFieldAutoSize.CENTER;
menuHolder.addChild(_local5);
} else {
theRoot.findMyMov(this, "playCountText", theRoot.retrievePlayCount);
theRoot.findMyMov(this, "logo", updateLogo);
};
}
function frame21(){
stop();
}
function frame2(){
stop();
}
private function returnOutroText():String{
var _local1:String;
switch (theRoot.whichVersion){
case 1:
_local1 = "<P ALIGN='CENTER'>";
_local1 = (_local1 + "<FONT SIZE='12'>A Winner Is You.</FONT><br>");
_local1 = (_local1 + "<FONT SIZE='12'>And they lived healthily ever after</FONT><br><br>");
_local1 = (_local1 + "<FONT SIZE='12'>Now <b><u><a href = 'http://www.peta.org/living/vegetarian-living/free-vegetarian-starter-kit.aspx?c=PVSKstb' target = '_blank'>go vegan</a></u></b>, already.</FONT></P>");
break;
case 2:
_local1 = "<P ALIGN='CENTER'>";
_local1 = (_local1 + "<FONT SIZE='12'>A Winner Is You.</FONT><br>");
_local1 = (_local1 + "<FONT SIZE='12'>And they lived healthily ever after</FONT><br><br>");
_local1 = (_local1 + "<FONT SIZE='12'>Now <b><u><a href = 'http://www.peta2.com/p2vsk_flash/index2.html?c=P2VSKstb' target = '_blank'>go vegan</a></u></b>, already.</FONT></P>");
break;
};
return (_local1);
}
private function checkKey(_arg1:KeyboardEvent){
var _local2:*;
var _local3:*;
var _local4:*;
_local2 = _arg1.type;
_local3 = _arg1.keyCode;
if (!theRoot.videoAdded){
switch (_local3){
case enterKey:
if (currentScreen == "Pause"){
if (_local2 == "keyDown"){
theRoot.pauseHandler();
};
} else {
if (currentScreen == "LevelComplete"){
constructMenu("Levels");
} else {
if (currentScreen == "Outro"){
theRoot.resetVars();
constructMenu("Menu");
};
};
};
break;
case escKey:
if (currentScreen == "Pause"){
if (_local2 == "keyDown"){
constructMenu("Menu");
};
} else {
if (currentScreen == "LevelComplete"){
checkProgress();
} else {
if (currentScreen == "Levels"){
if (focusObject != null){
_local4 = focusObject.tag;
if (_local4 == 0){
constructMenu(focusObject.name);
} else {
removeTool();
theRoot.changeLevel(_local4);
trace("setting pause to false");
theRoot.pauseGame = false;
theRoot.stage.focus = theRoot;
};
};
} else {
if (currentScreen == "Menu"){
constructMenu("Levels");
} else {
if (currentScreen == "Intro"){
trace("setting pause to false 1");
theRoot.pauseGame = false;
removeTool();
} else {
if (currentScreen == "Outro"){
constructMenu("Menu");
theRoot.resetVars();
};
};
};
};
};
};
break;
};
};
}
function frame11(){
stop();
}
private function addBackButton(_arg1:Number, _arg2:Number):void{
var _local3:*;
_local3 = new menuSegment();
_local3.x = _arg1;
_local3.y = (_arg2 + 24);
_local3.segmentText.text = "Back";
_local3.segmentText.mouseEnabled = false;
menuHolder.addChild(_local3);
_local3.tag = 0;
_local3.buttonMode = true;
_local3.addEventListener(MouseEvent.MOUSE_OVER, menuHandler);
_local3.addEventListener(MouseEvent.CLICK, menuHandler);
_local3.addEventListener(MouseEvent.MOUSE_OUT, menuHandler);
_local3.addEventListener(FocusEvent.FOCUS_IN, focusHandler);
_local3.addEventListener(FocusEvent.FOCUS_OUT, focusHandler);
_local3.focusRect = false;
_local3.name = "Menu";
_local3.tabIndex = tabbedIndex;
_local3.padlock.visible = false;
_local3.splat.visible = false;
_local3.bandage.visible = false;
}
function frame31(){
stop();
}
function frame41(){
stop();
}
private function returnFact():String{
var _local1:Array;
var _local2:int;
var _local3:String;
_local1 = new Array();
if (currentScreen == "Pause"){
_local1.push("Vegans do it better!");
_local1.push("Hurry back: Meat Boy is starting to draw flies.");
_local1.push("You could save 200 animals per year by adopting a meat-free diet.");
_local1.push("Tofu doesn't scream when you cut it!");
_local1.push("Cows are pumped full of drugs to make them grow abnormally large.");
_local1.push("Heart disease, cancer, obesity, and strokes are linked to a meat-based diet.");
_local1.push("Don't eat anything with a face!");
_local1.push("On average, vegans are 10 to 20 pounds lighter than meat-eaters.");
} else {
_local1.push("Red meat can lead to impotence, obesity, and loss of girlfriend.");
_local1.push("Vegetarians make better lovers.");
_local1.push("LOL@ Meat Boy's bad breath.");
_local1.push("Not only is Tofu Boy sexy, he tastes good too!");
_local1.push("Impressive. But don't keep Bandage Girl waiting...");
_local1.push("Firm, extra firm, or silken—tofu meets all your needs!");
_local1.push("More than 55 billion animals are slaughtered for food every year in the U.S.");
_local1.push("A dress made of raw, rotting animal flesh would stink and attract maggots.");
};
_local2 = Math.floor((_local1.length * Math.random()));
_local3 = _local1[_local2];
return (_local3);
}
function frame51(){
stop();
}
private function completeHandler(_arg1):void{
theRoot.pauseGame = true;
if ((((_arg1 == "Menu")) || ((_arg1 == "Levels")))){
constructMenu(_arg1);
} else {
currentScreen = _arg1;
this.gotoAndStop("Pause");
populateText(_arg1);
};
if (theRoot.whichLevel == 11){
trace(("BANDAGE COUNT" + theRoot.bonusLevelBandages));
if (theRoot.bonusLevelBandages >= 10){
theRoot.showVideo = false;
theRoot.wrapperClass.openVideoPlayer();
};
};
}
private function constructMenu(_arg1:String):void{
var _local2:int;
var _local3:int;
var _local4:*;
var _local5:Array;
var _local6:*;
var _local7:String;
var _local8:Array;
var _local9:*;
var _local10:*;
var _local11:Boolean;
var _local12:int;
var _local13:String;
var _local14:Boolean;
var _local15:*;
var _local16:*;
var _local17:Boolean;
var _local18:*;
currentScreen = _arg1;
if ((((_arg1 == "Levels")) || ((_arg1 == "Menu")))){
if (theRoot.gameSound){
theRoot.animationClass.removeAllSounds();
};
if (theRoot.menuSound == false){
theRoot.animationClass.soundHandler("menuSound", 1, true);
theRoot.menuSound = true;
};
};
clearMenu();
_local3 = 150;
tabbedIndex = 0;
if (currentScreen == "Levels"){
if (!theRoot.checkLevel1){
_local4 = [1, 2];
} else {
if (!theRoot.checkLevel2){
_local4 = [1, 2, 3, 4, 5, 6];
} else {
_local4 = [1, 2, 3, 4, 5, 6, 7, 8];
};
};
if (((((((((((((((theRoot.level1) && (theRoot.level2))) && (theRoot.level3))) && (theRoot.level4))) && (theRoot.level5))) && (theRoot.level6))) && (theRoot.level7))) && (theRoot.level8))){
_local4 = [1, 2, 3, 4, 5, 6, 7, 8, 9];
};
};
_local5 = theRoot.menuScreenArray;
for (_local6 in _local5) {
_local7 = _local5[_local6]["text"];
_local2 = _local5[_local6]["yOffset"];
if (_local7 == _arg1){
if (_local7 != "Menu"){
_local10 = new menuSegment();
_local10.x = _local3;
_local10.y = _local2;
_local10.segmentText.text = _local7;
menuHolder.addChild(_local10);
_local10.padlock.visible = false;
_local10.splat.visible = false;
_local10.bandage.visible = false;
_local2 = (_local2 + _local10.height);
};
_local8 = _local5[_local6]["whichArray"];
for (_local9 in _local8) {
_local11 = true;
_local12 = _local8[_local9]["tag"];
if ((((_local12 == 10)) && (!(theRoot.level10)))){
_local11 = false;
};
_local13 = _local8[_local9]["text"];
_local10 = new menuSegment();
_local10.tag = _local12;
_local10.x = _local3;
_local10.y = _local2;
if (_local13 == "Levels"){
_local10.segmentText.text = "Play Now";
} else {
_local10.segmentText.text = _local13;
};
if (_local10.segmentText.text == "Bandage Bonus"){
trace("ADDING ON HEIGHT");
_local10.y = (_local10.y + _local10.height);
_local2 = (_local2 + _local10.height);
};
_local10.segmentText.mouseEnabled = false;
_local10.name = _local13;
_local14 = false;
if ((((currentScreen == "Levels")) && ((_local4.length > 0)))){
for (_local15 in _local4) {
_local16 = _local4[_local15];
if (_local16 == _local12){
_local14 = true;
_local10.padlock.visible = false;
break;
};
};
} else {
_local14 = true;
_local10.padlock.visible = false;
};
if (((theRoot.level10) && ((_local12 == 10)))){
_local10.padlock.visible = false;
_local14 = true;
};
if (_local12 == 11){
if (theRoot.level11){
_local14 = true;
_local10.padlock.visible = false;
} else {
_local14 = false;
_local10.padlock.visible = true;
};
};
if ((((((((currentScreen == "Levels")) && (!((_local12 == 0))))) && (!((_local12 == 11))))) && (!((_local12 == 10))))){
_local17 = theRoot[("level" + String(_local12))];
_local10.splat.visible = _local17;
_local10.bandage.visible = theRoot.bandageArray[(_local12 - 1)];
if (theRoot.bandageArray[(_local12 - 1)] == true){
trace((_local12 + " VISIBLE"));
};
} else {
_local10.splat.visible = false;
_local10.bandage.visible = false;
};
if (((!((_local12 == 0))) || ((_arg1 == "Menu")))){
if (_local14){
_local10.buttonMode = true;
_local10.addEventListener(MouseEvent.MOUSE_OVER, menuHandler);
_local10.addEventListener(MouseEvent.CLICK, menuHandler);
_local10.addEventListener(MouseEvent.MOUSE_OUT, menuHandler);
_local10.addEventListener(FocusEvent.FOCUS_IN, focusHandler);
_local10.addEventListener(FocusEvent.FOCUS_OUT, focusHandler);
_local10.focusRect = false;
if (tabbedIndex == 0){
};
_local10.tabIndex = tabbedIndex;
tabbedIndex = (tabbedIndex + 1);
};
if (_arg1 != "Menu"){
_local10.segmentText.autoSize = TextFieldAutoSize.LEFT;
};
if (_local10.segmentText.text == "Bandage Bonus"){
trace("Setting centre");
_local10.segmentText.autoSize = TextFieldAutoSize.CENTER;
};
} else {
_local18 = _local10.segmentText.defaultTextFormat;
_local18.underline = true;
_local10.segmentText.setTextFormat(_local18, 0, _local10.segmentText.text.length);
_local10.segmentText.defaultTextFormat = _local18;
_local10.padlock.visible = false;
};
if (_local11){
menuHolder.addChild(_local10);
_local2 = (_local2 + _local10.height);
};
};
if (currentScreen != "Menu"){
addBackButton(_local3, _local2);
};
this.gotoAndStop(_arg1);
break;
};
};
populateText(_arg1);
}
}
}//package
Section 204
//TofuBoy_Wrapper (TofuBoy_Wrapper)
package {
import flash.net.*;
import flash.events.*;
import flash.display.*;
import fl.video.*;
import flash.text.*;
import flash.utils.*;
import tools.*;
import flash.system.*;
public class TofuBoy_Wrapper extends MovieClip {
private var theRoot;
private var videoURL:String;// = "rtmp://cp80241.edgefcs.net/ondemand/media/Legacy/meet_your_meat_v2_high.flv"
public var myVideo:FLVPlayback;
private var myParent;
private var stream:NetStream;
private var connection:NetConnection;
public function TofuBoy_Wrapper(_arg1, _arg2){
var _local3:*;
var _local4:Array;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
var _local10:*;
videoURL = "rtmp://cp80241.edgefcs.net/ondemand/media/Legacy/meet_your_meat_v2_high.flv";
super();
theRoot = _arg1;
myParent = _arg2;
_local3 = new wrapper();
_local3.name = "wrapper";
_arg2.addChild(_local3);
_local3.width = 604;
_local3.height = 535;
_local4 = new Array();
if (theRoot.whichVersion == 1){
_local4.push((((("DOWNLOAD <u><a href='" + theRoot.pcZipPeta) + "' target='_blank'>PC</a></u>/<u><a href='") + theRoot.macZipPeta) + "' target='_blank'>MAC</a></u>"));
} else {
_local4.push((((("DOWNLOAD <u><a href='" + theRoot.pcZipPeta2) + "' target='_blank'>PC</a></u>/<u><a href='") + theRoot.macZipPeta2) + "' target='_blank'>MAC</a></u>"));
};
_local4.push("PLEDGE TO BE VEGAN!");
_local4.push("PUT THIS ON YOUR PAGE!");
for (_local5 in _local4) {
_local8 = _local3.getChildByName(("btn" + String((_local5 + 1))));
_local9 = _local4[_local5];
if (_local5 == 0){
_local8.blocker.mouseEnabled = false;
};
_local8.btnText.htmlText = (("<b>" + String(_local9)) + "</b>");
_local8.buttonMode = true;
_local8.addEventListener(MouseEvent.CLICK, mouseHandler);
};
_local4 = new Array();
_local4.push("facebook");
_local4.push("twitter");
_local4.push("email");
_local4.push("mySpace");
_local4.push("muteMC");
for (_local6 in _local4) {
_local10 = _local3.getChildByName(_local4[_local6]);
_local10.buttonMode = true;
_local10.addEventListener(MouseEvent.CLICK, mouseHandler);
if (_local4[_local6] != "muteMC"){
_local10.addEventListener(MouseEvent.MOUSE_OVER, mouseHandler);
_local10.addEventListener(MouseEvent.MOUSE_OUT, mouseHandler);
};
_local10.muted = false;
};
_local7 = _local3.getChildByName("videoBtn");
_local7.visible = false;
}
private function openMySpace():void{
var _local1:URLRequest;
trace("MY SPACE");
theRoot.trackingHandler("MySpace button");
if (theRoot.whichVersion == 1){
_local1 = new URLRequest("http://www.myspace.com/Modules/PostTo/Pages/?u=http://www.features.peta.org/super-meat-boy-parody?c=STBpms");
} else {
if (theRoot.whichVersion == 2){
_local1 = new URLRequest("http://www.myspace.com/Modules/PostTo/Pages/?u=features.peta2.com/super-meat-boy-parody?c=STBpms");
};
};
navigateToURL(_local1, "_blank");
}
private function connectStream():void{
}
private function errHandler(_arg1:VideoError){
trace(_arg1);
}
public function removeVideoPlayer():void{
var _local1:*;
if (theRoot.getChildByName("newVideoPlayer")){
_local1 = theRoot.getChildByName("newVideoPlayer");
_local1.video.removeEventListener(VideoEvent.COMPLETE, closeVideo);
_local1.video.removeEventListener(VideoEvent.COMPLETE, closeVideo);
_local1.video.removeEventListener(VideoError.NO_CONNECTION, errHandler);
_local1.video.removeEventListener(VideoError.NULL_URL_LOAD, errHandler);
_local1.video.removeEventListener(VideoError.DELETE_DEFAULT_PLAYER, errHandler);
_local1.video.removeEventListener(VideoEvent.STATE_CHANGE, onStateChange);
_local1.video.stop();
FLVPlaybackUtils.resetVid(_local1.video);
_local1.removeChild(_local1.video);
theRoot.removeChild(_local1);
theRoot.pauseGame = false;
theRoot.stage.focus = theRoot.stage;
theRoot.videoAdded = false;
};
}
private function openEmbedCode():void{
var _local1:*;
if (!theRoot.getChildByName("embedder")){
_local1 = new embedCode();
_local1.x = 302;
_local1.y = 270;
_local1.name = "embedder";
theRoot.addChild(_local1);
_local1.closeBtn.buttonMode = true;
_local1.closeBtn.addEventListener(MouseEvent.CLICK, mouseHandler);
theRoot.pauseGame = true;
};
}
private function openFacebook():void{
var _local1:URLRequest;
theRoot.trackingHandler("Facebook button");
if (theRoot.whichVersion == 1){
_local1 = new URLRequest("http://www.facebook.com/share.php?u=features.peta.org/super-meat-boy-parody/Default.aspx?c=STBPfb");
} else {
if (theRoot.whichVersion == 2){
_local1 = new URLRequest("http://www.facebook.com/share.php?u=features.peta2.com/super-meat-boy-parody/Default.aspx?c=STBP2fb");
};
};
navigateToURL(_local1, "_blank");
}
private function netStatusHandler(_arg1:NetStatusEvent):void{
trace(_arg1.info.code);
switch (_arg1.info.code){
case "NetConnection.Connect.Success":
connectStream();
break;
case "NetStream.Play.StreamNotFound":
trace(("Stream not found: " + videoURL));
break;
};
}
private function closeVideo(_arg1:VideoEvent){
trace(1);
removeVideoPlayer();
trace(2);
theRoot.animationClass.playSoundsAgain();
trace(3);
}
public function checkVideo(){
var _local1:*;
if (theRoot.getChildByName("newVideoPlayer")){
_local1 = theRoot.getChildByName("newVideoPlayer");
theRoot.setChildIndex(_local1, (theRoot.numChildren - 1));
};
}
private function removeEmbedCode():void{
var _local1:*;
if (theRoot.getChildByName("embedder")){
_local1 = theRoot.getChildByName("embedder");
theRoot.removeChild(_local1);
theRoot.pauseGame = false;
theRoot.stage.focus = theRoot.stage;
};
}
private function openEmail():void{
var _local1:URLRequest;
trace("EMAIL");
theRoot.trackingHandler("Email button");
if (theRoot.whichVersion == 1){
_local1 = new URLRequest("http://features.peta.org/super-meat-boy-parody/share.aspx?c=STBPs");
} else {
if (theRoot.whichVersion == 2){
_local1 = new URLRequest("http://features.peta2.com/super-meat-boy-parody/share.aspx?c=STBP2s");
};
};
navigateToURL(_local1, "_blank");
}
private function securityErrorHandler(_arg1:SecurityErrorEvent):void{
trace("ERROR");
trace(("securityErrorHandler: " + _arg1));
}
public function openVideoPlayer():void{
var _local1:*;
var _local2:*;
var _local3:*;
if (!theRoot.videoAdded){
_local1 = myParent.getChildByName("wrapper");
_local2 = _local1.getChildByName("videoBtn");
_local2.visible = true;
_local2.alpha = 1;
_local2.buttonMode = true;
_local2.addEventListener(MouseEvent.CLICK, mouseHandler);
};
if (!theRoot.getChildByName("newVideoPlayer")){
theRoot.trackingHandler("Video watched");
theRoot.pauseGame = true;
_local3 = new videoBG();
_local3.name = "newVideoPlayer";
_local3.x = 302;
_local3.y = 267;
theRoot.animationClass.muteSounds();
_local3.video.source = videoURL;
_local3.video.autoPlay = true;
_local3.video.skin = "http://features.peta.org/super-meat-boy-parody/Media/Download/SkinUnderPlayStopSeekMuteVol.swf";
_local3.video.addEventListener(VideoEvent.COMPLETE, closeVideo);
_local3.video.addEventListener(VideoError.NO_CONNECTION, errHandler);
_local3.video.addEventListener(VideoError.NULL_URL_LOAD, errHandler);
_local3.video.addEventListener(VideoError.DELETE_DEFAULT_PLAYER, errHandler);
_local3.video.addEventListener(VideoEvent.STATE_CHANGE, onStateChange);
_local3.closeButton.buttonMode = true;
_local3.closeButton.addEventListener(MouseEvent.CLICK, mouseHandler);
theRoot.addChild(_local3);
theRoot.videoAdded = true;
};
}
private function onStateChange(_arg1:VideoEvent){
trace(_arg1);
}
private function openTwitter():void{
var _local1:URLRequest;
trace("TWITTER");
theRoot.trackingHandler("Twitter button");
if (theRoot.whichVersion == 1){
_local1 = new URLRequest("http://twitter.com/home?status=Join the bloody fun. Play PETAs Super Tofu Boy game here: http://bit.ly/d0vfxd");
} else {
if (theRoot.whichVersion == 2){
_local1 = new URLRequest("http://twitter.com/home?status=Join the bloody fun. Play peta2s Super Tofu Boy game here: http://bit.ly/cAspEh");
};
};
navigateToURL(_local1, "_blank");
}
private function mouseHandler(_arg1:MouseEvent){
var _local2:*;
var _local3:URLRequest;
var _local4:String;
_local2 = _arg1.currentTarget;
_local4 = _arg1.type;
switch (_local4){
case "mouseOver":
_local2.gotoAndStop("on");
break;
case "mouseOut":
_local2.gotoAndStop("off");
break;
case "click":
switch (_local2.name){
case "btn1":
theRoot.trackingHandler("Download clicked");
break;
case "btn2":
theRoot.trackingHandler("Pledge to be vegan clicked");
if (theRoot.whichVersion == 1){
_local3 = new URLRequest("https://secure.peta.org/site/Advocacy?cmd=display&page=UserAction&id=2055&c=STBpvp&s_src=ppmisc");
} else {
if (theRoot.whichVersion == 2){
_local3 = new URLRequest("https://secure.peta.org/site/Advocacy?cmd=display&page=UserAction&id=2523&c=STBp2vp&s_src=p2pmisc");
};
};
navigateToURL(_local3, "_blank");
break;
case "btn3":
openEmbedCode();
theRoot.trackingHandler("Open embed clicked");
break;
case "closeBtn":
removeEmbedCode();
break;
case "twitter":
openTwitter();
break;
case "facebook":
openFacebook();
break;
case "email":
openEmail();
break;
case "mySpace":
openMySpace();
break;
case "muteMC":
if (_local2.muted){
theRoot.animationClass.playSoundsAgain();
_local2.muted = false;
_local2.gotoAndStop(1);
trace(1);
} else {
theRoot.animationClass.muteSounds();
_local2.muted = true;
trace(2);
_local2.gotoAndStop(2);
};
break;
case "closeButton":
theRoot.animationClass.playSoundsAgain();
removeVideoPlayer();
break;
case "videoBtn":
openVideoPlayer();
break;
};
break;
};
}
}
}//package
Section 205
//TofuGF (TofuGF)
package {
import flash.display.*;
public dynamic class TofuGF extends MovieClip {
}
}//package
Section 206
//trampoline (trampoline)
package {
import flash.display.*;
public dynamic class trampoline extends MovieClip {
public function trampoline(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 207
//videoBG (videoBG)
package {
import flash.display.*;
import fl.video.*;
public dynamic class videoBG extends MovieClip {
public var closeButton:MovieClip;
public var video:FLVPlayback;
public function videoBG(){
__setProp_video_videoBG_videoPlayer_1();
}
function __setProp_video_videoBG_videoPlayer_1(){
try {
video["componentInspectorSetting"] = true;
} catch(e:Error) {
};
video.align = "center";
video.autoPlay = false;
video.scaleMode = "exactFit";
video.skin = "http://features.peta.org/super-meat-boy-parody/SkinUnderPlayStopSeekMuteVol.swf";
video.skinAutoHide = false;
video.skinBackgroundAlpha = 1;
video.skinBackgroundColor = 14096903;
video.source = "";
video.volume = 1;
try {
video["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 208
//wrapper (wrapper)
package {
import flash.display.*;
public dynamic class wrapper extends MovieClip {
public var btn3:MovieClip;
public var btn2:MovieClip;
public var btn1:MovieClip;
public var muteMC:MovieClip;
public var twitter:MovieClip;
public var mySpace:MovieClip;
public var email:MovieClip;
public var facebook:MovieClip;
public var videoBtn:MovieClip;
}
}//package