mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-19 01:27:51 -05:00
Brought up to date with the private repository (feea4c7)
This commit is contained in:
1 parent
1aa738d692
commit
1b1df1ae48
7925 files changed
+2617237
-20
No files matched your search
@@ -0,0 +1,42 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
|
||||
public class AutoAlphaPlugin extends TweenPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
protected var _target:Object;
|
||||
|
||||
protected var _ignoreVisible:Boolean;
|
||||
|
||||
public function AutoAlphaPlugin()
|
||||
{
|
||||
super("autoAlpha,alpha,visible");
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
_target = param1;
|
||||
_addTween(param1,"alpha",param1.alpha,param2,"alpha");
|
||||
return true;
|
||||
}
|
||||
|
||||
override public function _kill(param1:Object) : Boolean
|
||||
{
|
||||
_ignoreVisible = "visible" in param1;
|
||||
return super._kill(param1);
|
||||
}
|
||||
|
||||
override public function setRatio(param1:Number) : void
|
||||
{
|
||||
super.setRatio(param1);
|
||||
if(!_ignoreVisible)
|
||||
{
|
||||
_target.visible = _target.alpha != 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
import flash.filters.BevelFilter;
|
||||
|
||||
public class BevelFilterPlugin extends FilterPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
private static var _propNames:Array = ["distance","angle","highlightColor","highlightAlpha","shadowColor","shadowAlpha","blurX","blurY","strength","quality"];
|
||||
|
||||
public function BevelFilterPlugin()
|
||||
{
|
||||
super("bevelFilter");
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
return _initFilter(param1,param2,param3,BevelFilter,new BevelFilter(0,0,16777215,0.5,0,0.5,2,2,0,param2.quality || 2),_propNames);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,790 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
import flash.geom.Point;
|
||||
|
||||
public class BezierPlugin extends TweenPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
protected static const _RAD2DEG:Number = 57.29577951308232;
|
||||
|
||||
protected static var _r1:Array = [];
|
||||
|
||||
protected static var _r2:Array = [];
|
||||
|
||||
protected static var _r3:Array = [];
|
||||
|
||||
protected static var _corProps:Object = {};
|
||||
|
||||
protected var _target:Object;
|
||||
|
||||
protected var _autoRotate:Array;
|
||||
|
||||
protected var _round:Object;
|
||||
|
||||
protected var _lengths:Array;
|
||||
|
||||
protected var _segments:Array;
|
||||
|
||||
protected var _length:Number;
|
||||
|
||||
protected var _func:Object;
|
||||
|
||||
protected var _props:Array;
|
||||
|
||||
protected var _l1:Number;
|
||||
|
||||
protected var _l2:Number;
|
||||
|
||||
protected var _li:Number;
|
||||
|
||||
protected var _curSeg:Array;
|
||||
|
||||
protected var _s1:Number;
|
||||
|
||||
protected var _s2:Number;
|
||||
|
||||
protected var _si:Number;
|
||||
|
||||
protected var _beziers:Object;
|
||||
|
||||
protected var _segCount:int;
|
||||
|
||||
protected var _prec:Number;
|
||||
|
||||
protected var _timeRes:int;
|
||||
|
||||
protected var _initialRotations:Array;
|
||||
|
||||
protected var _startRatio:int;
|
||||
|
||||
public function BezierPlugin()
|
||||
{
|
||||
super("bezier");
|
||||
this._overwriteProps.pop();
|
||||
this._func = {};
|
||||
this._round = {};
|
||||
}
|
||||
|
||||
public static function bezierThrough(param1:Array, param2:Number = 1, param3:Boolean = false, param4:Boolean = false, param5:String = "x,y,z", param6:Object = null) : Object
|
||||
{
|
||||
var _loc13_:Array = null;
|
||||
var _loc10_:int = 0;
|
||||
var _loc14_:String = null;
|
||||
var _loc11_:int = 0;
|
||||
var _loc7_:Array = null;
|
||||
var _loc12_:int = 0;
|
||||
var _loc15_:Number = NaN;
|
||||
var _loc8_:Boolean = false;
|
||||
var _loc9_:Object = null;
|
||||
var _loc16_:Object = {};
|
||||
var _loc17_:Object = param6 || param1[0];
|
||||
param5 = "," + param5 + ",";
|
||||
if(_loc17_ is Point)
|
||||
{
|
||||
_loc13_ = ["x","y"];
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc13_ = [];
|
||||
for(_loc14_ in _loc17_)
|
||||
{
|
||||
_loc13_.push(_loc14_);
|
||||
}
|
||||
}
|
||||
if(param1.length > 1)
|
||||
{
|
||||
_loc9_ = param1[param1.length - 1];
|
||||
_loc8_ = true;
|
||||
_loc10_ = int(_loc13_.length);
|
||||
while(--_loc10_ > -1)
|
||||
{
|
||||
_loc14_ = _loc13_[_loc10_];
|
||||
if(Math.abs(_loc17_[_loc14_] - _loc9_[_loc14_]) > 0.05)
|
||||
{
|
||||
_loc8_ = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(_loc8_)
|
||||
{
|
||||
param1 = param1.concat();
|
||||
if(param6)
|
||||
{
|
||||
param1.unshift(param6);
|
||||
}
|
||||
param1.push(param1[1]);
|
||||
param6 = param1[param1.length - 3];
|
||||
}
|
||||
}
|
||||
_r1.length = _r2.length = _r3.length = 0;
|
||||
_loc10_ = int(_loc13_.length);
|
||||
while(--_loc10_ > -1)
|
||||
{
|
||||
_loc14_ = _loc13_[_loc10_];
|
||||
_corProps[_loc14_] = param5.indexOf("," + _loc14_ + ",") !== -1;
|
||||
_loc16_[_loc14_] = _parseAnchors(param1,_loc14_,_corProps[_loc14_],param6);
|
||||
}
|
||||
_loc10_ = int(_r1.length);
|
||||
while(--_loc10_ > -1)
|
||||
{
|
||||
_r1[_loc10_] = Math.sqrt(_r1[_loc10_]);
|
||||
_r2[_loc10_] = Math.sqrt(_r2[_loc10_]);
|
||||
}
|
||||
if(!param4)
|
||||
{
|
||||
_loc10_ = int(_loc13_.length);
|
||||
while(--_loc10_ > -1)
|
||||
{
|
||||
if(_corProps[_loc14_])
|
||||
{
|
||||
_loc7_ = _loc16_[_loc13_[_loc10_]];
|
||||
_loc12_ = _loc7_.length - 1;
|
||||
_loc11_ = 0;
|
||||
while(_loc11_ < _loc12_)
|
||||
{
|
||||
_loc15_ = _loc7_[_loc11_ + 1].da / _r2[_loc11_] + _loc7_[_loc11_].da / _r1[_loc11_];
|
||||
_r3[_loc11_] = (_r3[_loc11_] || 0) + _loc15_ * _loc15_;
|
||||
_loc11_++;
|
||||
}
|
||||
}
|
||||
}
|
||||
_loc10_ = int(_r3.length);
|
||||
while(--_loc10_ > -1)
|
||||
{
|
||||
_r3[_loc10_] = Math.sqrt(_r3[_loc10_]);
|
||||
}
|
||||
}
|
||||
_loc10_ = int(_loc13_.length);
|
||||
_loc11_ = param3 ? 4 : 1;
|
||||
while(--_loc10_ > -1)
|
||||
{
|
||||
_loc14_ = _loc13_[_loc10_];
|
||||
_loc7_ = _loc16_[_loc14_];
|
||||
_calculateControlPoints(_loc7_,param2,param3,param4,_corProps[_loc14_]);
|
||||
if(_loc8_)
|
||||
{
|
||||
_loc7_.splice(0,_loc11_);
|
||||
_loc7_.splice(_loc7_.length - _loc11_,_loc11_);
|
||||
}
|
||||
}
|
||||
return _loc16_;
|
||||
}
|
||||
|
||||
public static function _parseBezierData(param1:Array, param2:String, param3:Object = null) : Object
|
||||
{
|
||||
var _loc4_:Number = NaN;
|
||||
var _loc6_:Number = NaN;
|
||||
var _loc7_:Number = NaN;
|
||||
var _loc8_:Number = NaN;
|
||||
var _loc5_:Array = null;
|
||||
var _loc13_:Array = null;
|
||||
var _loc10_:int = 0;
|
||||
var _loc11_:int = 0;
|
||||
var _loc12_:int = 0;
|
||||
var _loc14_:String = null;
|
||||
var _loc9_:int = 0;
|
||||
var _loc15_:Object = null;
|
||||
param2 ||= "soft";
|
||||
var _loc16_:Object = {};
|
||||
var _loc17_:int = param2 === "cubic" ? 3 : 2;
|
||||
var _loc18_:Boolean = param2 === "soft";
|
||||
if(_loc18_ && param3)
|
||||
{
|
||||
param1 = [param3].concat(param1);
|
||||
}
|
||||
if(param1 == null || param1.length < _loc17_ + 1)
|
||||
{
|
||||
throw new Error("invalid Bezier data");
|
||||
}
|
||||
if(param1[1] is Point)
|
||||
{
|
||||
_loc13_ = ["x","y"];
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc13_ = [];
|
||||
for(_loc14_ in param1[0])
|
||||
{
|
||||
_loc13_.push(_loc14_);
|
||||
}
|
||||
}
|
||||
_loc10_ = int(_loc13_.length);
|
||||
while(--_loc10_ > -1)
|
||||
{
|
||||
_loc14_ = _loc13_[_loc10_];
|
||||
_loc16_[_loc14_] = _loc5_ = [];
|
||||
_loc9_ = 0;
|
||||
_loc12_ = int(param1.length);
|
||||
_loc11_ = 0;
|
||||
while(_loc11_ < _loc12_)
|
||||
{
|
||||
_loc15_ = param1[_loc11_][_loc14_];
|
||||
_loc4_ = Number(param3 == null ? param1[_loc11_][_loc14_] : (typeof _loc15_ === "string" && _loc15_.charAt(1) === "=" ? param3[_loc14_] + (_loc15_.charAt(0) + _loc15_.substr(2)) : Number(_loc15_)));
|
||||
if(_loc18_)
|
||||
{
|
||||
if(_loc11_ > 1)
|
||||
{
|
||||
if(_loc11_ < _loc12_ - 1)
|
||||
{
|
||||
_loc5_[_loc9_++] = (_loc4_ + _loc5_[_loc9_ - 2]) / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
_loc5_[_loc9_++] = _loc4_;
|
||||
_loc11_++;
|
||||
}
|
||||
_loc12_ = _loc9_ - _loc17_ + 1;
|
||||
_loc9_ = 0;
|
||||
_loc11_ = 0;
|
||||
while(_loc11_ < _loc12_)
|
||||
{
|
||||
_loc4_ = Number(_loc5_[_loc11_]);
|
||||
_loc6_ = Number(_loc5_[_loc11_ + 1]);
|
||||
_loc7_ = Number(_loc5_[_loc11_ + 2]);
|
||||
_loc8_ = Number(_loc17_ === 2 ? 0 : _loc5_[_loc11_ + 3]);
|
||||
_loc5_[_loc9_++] = _loc17_ === 3 ? new Segment(_loc4_,_loc6_,_loc7_,_loc8_) : new Segment(_loc4_,(2 * _loc6_ + _loc4_) / 3,(2 * _loc6_ + _loc7_) / 3,_loc7_);
|
||||
_loc11_ += _loc17_;
|
||||
}
|
||||
_loc5_.length = _loc9_;
|
||||
}
|
||||
return _loc16_;
|
||||
}
|
||||
|
||||
protected static function _parseAnchors(param1:Array, param2:String, param3:Boolean, param4:Object) : Array
|
||||
{
|
||||
var _loc11_:int = 0;
|
||||
var _loc10_:int = 0;
|
||||
var _loc5_:Number = NaN;
|
||||
var _loc7_:Number = NaN;
|
||||
var _loc8_:Number = NaN;
|
||||
var _loc9_:Object = null;
|
||||
var _loc6_:Array = [];
|
||||
if(param4)
|
||||
{
|
||||
param1 = [param4].concat(param1);
|
||||
_loc10_ = int(param1.length);
|
||||
while(--_loc10_ > -1)
|
||||
{
|
||||
_loc9_ = param1[_loc10_][param2];
|
||||
if(typeof _loc9_ === "string")
|
||||
{
|
||||
if(_loc9_.charAt(1) === "=")
|
||||
{
|
||||
param1[_loc10_][param2] = param4[param2] + (_loc9_.charAt(0) + _loc9_.substr(2));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_loc11_ = param1.length - 2;
|
||||
if(_loc11_ < 0)
|
||||
{
|
||||
_loc6_[0] = new Segment(param1[0][param2],0,0,param1[_loc11_ < -1 ? 0 : 1][param2]);
|
||||
return _loc6_;
|
||||
}
|
||||
_loc10_ = 0;
|
||||
while(_loc10_ < _loc11_)
|
||||
{
|
||||
_loc5_ = Number(param1[_loc10_][param2]);
|
||||
_loc7_ = Number(param1[_loc10_ + 1][param2]);
|
||||
_loc6_[_loc10_] = new Segment(_loc5_,0,0,_loc7_);
|
||||
if(param3)
|
||||
{
|
||||
_loc8_ = Number(param1[_loc10_ + 2][param2]);
|
||||
_r1[_loc10_] = (_r1[_loc10_] || 0) + (_loc7_ - _loc5_) * (_loc7_ - _loc5_);
|
||||
_r2[_loc10_] = (_r2[_loc10_] || 0) + (_loc8_ - _loc7_) * (_loc8_ - _loc7_);
|
||||
}
|
||||
_loc10_++;
|
||||
}
|
||||
_loc6_[_loc10_] = new Segment(param1[_loc10_][param2],0,0,param1[_loc10_ + 1][param2]);
|
||||
return _loc6_;
|
||||
}
|
||||
|
||||
protected static function _calculateControlPoints(param1:Array, param2:Number = 1, param3:Boolean = false, param4:Boolean = false, param5:Boolean = false) : void
|
||||
{
|
||||
var _loc16_:int = 0;
|
||||
var _loc9_:Number = NaN;
|
||||
var _loc10_:Number = NaN;
|
||||
var _loc11_:Number = NaN;
|
||||
var _loc19_:Segment = null;
|
||||
var _loc12_:Number = NaN;
|
||||
var _loc15_:Number = NaN;
|
||||
var _loc7_:Number = NaN;
|
||||
var _loc13_:Number = NaN;
|
||||
var _loc18_:Array = null;
|
||||
var _loc21_:Number = NaN;
|
||||
var _loc8_:Number = NaN;
|
||||
var _loc20_:Number = NaN;
|
||||
var _loc17_:int = param1.length - 1;
|
||||
var _loc6_:int = 0;
|
||||
var _loc14_:Number = Number(param1[0].a);
|
||||
_loc16_ = 0;
|
||||
while(_loc16_ < _loc17_)
|
||||
{
|
||||
_loc19_ = param1[_loc6_];
|
||||
_loc9_ = _loc19_.a;
|
||||
_loc10_ = _loc19_.d;
|
||||
_loc11_ = Number(param1[_loc6_ + 1].d);
|
||||
if(param5)
|
||||
{
|
||||
_loc21_ = Number(_r1[_loc16_]);
|
||||
_loc8_ = Number(_r2[_loc16_]);
|
||||
_loc20_ = (_loc8_ + _loc21_) * param2 * 0.25 / (param4 ? 0.5 : _r3[_loc16_] || 0.5);
|
||||
_loc12_ = _loc10_ - (_loc10_ - _loc9_) * (param4 ? param2 * 0.5 : (_loc21_ !== 0 ? _loc20_ / _loc21_ : 0));
|
||||
_loc15_ = _loc10_ + (_loc11_ - _loc10_) * (param4 ? param2 * 0.5 : (_loc8_ !== 0 ? _loc20_ / _loc8_ : 0));
|
||||
_loc7_ = _loc10_ - (_loc12_ + ((_loc15_ - _loc12_) * (_loc21_ * 3 / (_loc21_ + _loc8_) + 0.5) / 4 || 0));
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc12_ = _loc10_ - (_loc10_ - _loc9_) * param2 * 0.5;
|
||||
_loc15_ = _loc10_ + (_loc11_ - _loc10_) * param2 * 0.5;
|
||||
_loc7_ = _loc10_ - (_loc12_ + _loc15_) / 2;
|
||||
}
|
||||
_loc12_ += _loc7_;
|
||||
_loc15_ += _loc7_;
|
||||
_loc19_.c = _loc13_ = _loc12_;
|
||||
if(_loc16_ != 0)
|
||||
{
|
||||
_loc19_.b = _loc14_;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc19_.b = _loc14_ = _loc19_.a + (_loc19_.c - _loc19_.a) * 0.6;
|
||||
}
|
||||
_loc19_.da = _loc10_ - _loc9_;
|
||||
_loc19_.ca = _loc13_ - _loc9_;
|
||||
_loc19_.ba = _loc14_ - _loc9_;
|
||||
if(param3)
|
||||
{
|
||||
_loc18_ = cubicToQuadratic(_loc9_,_loc14_,_loc13_,_loc10_);
|
||||
param1.splice(_loc6_,1,_loc18_[0],_loc18_[1],_loc18_[2],_loc18_[3]);
|
||||
_loc6_ += 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc6_++;
|
||||
}
|
||||
_loc14_ = _loc15_;
|
||||
_loc16_++;
|
||||
}
|
||||
_loc19_ = param1[_loc6_];
|
||||
_loc19_.b = _loc14_;
|
||||
_loc19_.c = _loc14_ + (_loc19_.d - _loc14_) * 0.4;
|
||||
_loc19_.da = _loc19_.d - _loc19_.a;
|
||||
_loc19_.ca = _loc19_.c - _loc19_.a;
|
||||
_loc19_.ba = _loc14_ - _loc19_.a;
|
||||
if(param3)
|
||||
{
|
||||
_loc18_ = cubicToQuadratic(_loc19_.a,_loc14_,_loc19_.c,_loc19_.d);
|
||||
param1.splice(_loc6_,1,_loc18_[0],_loc18_[1],_loc18_[2],_loc18_[3]);
|
||||
}
|
||||
}
|
||||
|
||||
public static function cubicToQuadratic(param1:Number, param2:Number, param3:Number, param4:Number) : Array
|
||||
{
|
||||
var _loc5_:Object = {"a":param1};
|
||||
var _loc6_:Object = {};
|
||||
var _loc7_:Object = {};
|
||||
var _loc8_:Object = {"c":param4};
|
||||
var _loc12_:Number = (param1 + param2) / 2;
|
||||
var _loc13_:Number = (param2 + param3) / 2;
|
||||
var _loc14_:Number = (param3 + param4) / 2;
|
||||
var _loc10_:Number = (_loc12_ + _loc13_) / 2;
|
||||
var _loc9_:Number = (_loc13_ + _loc14_) / 2;
|
||||
var _loc11_:Number = (_loc9_ - _loc10_) / 8;
|
||||
_loc5_.b = _loc12_ + (param1 - _loc12_) / 4;
|
||||
_loc6_.b = _loc10_ + _loc11_;
|
||||
_loc5_.c = _loc6_.a = (_loc5_.b + _loc6_.b) / 2;
|
||||
_loc6_.c = _loc7_.a = (_loc10_ + _loc9_) / 2;
|
||||
_loc7_.b = _loc9_ - _loc11_;
|
||||
_loc8_.b = _loc14_ + (param4 - _loc14_) / 4;
|
||||
_loc7_.c = _loc8_.a = (_loc7_.b + _loc8_.b) / 2;
|
||||
return [_loc5_,_loc6_,_loc7_,_loc8_];
|
||||
}
|
||||
|
||||
public static function quadraticToCubic(param1:Number, param2:Number, param3:Number) : Object
|
||||
{
|
||||
return new Segment(param1,(2 * param2 + param1) / 3,(2 * param2 + param3) / 3,param3);
|
||||
}
|
||||
|
||||
protected static function _parseLengthData(param1:Object, param2:uint = 6) : Object
|
||||
{
|
||||
var _loc11_:String = null;
|
||||
var _loc5_:int = 0;
|
||||
var _loc8_:int = 0;
|
||||
var _loc6_:Number = NaN;
|
||||
var _loc3_:Array = [];
|
||||
var _loc13_:Array = [];
|
||||
var _loc4_:Number = 0;
|
||||
var _loc12_:Number = 0;
|
||||
var _loc7_:int = param2 - 1;
|
||||
var _loc10_:Array = [];
|
||||
var _loc9_:Array = [];
|
||||
for(_loc11_ in param1)
|
||||
{
|
||||
_addCubicLengths(param1[_loc11_],_loc3_,param2);
|
||||
}
|
||||
_loc8_ = int(_loc3_.length);
|
||||
_loc5_ = 0;
|
||||
while(_loc5_ < _loc8_)
|
||||
{
|
||||
_loc4_ += Math.sqrt(_loc3_[_loc5_]);
|
||||
_loc6_ = _loc5_ % param2;
|
||||
_loc9_[_loc6_] = _loc4_;
|
||||
if(_loc6_ == _loc7_)
|
||||
{
|
||||
_loc12_ += _loc4_;
|
||||
_loc6_ = _loc5_ / param2 >> 0;
|
||||
_loc10_[_loc6_] = _loc9_;
|
||||
_loc13_[_loc6_] = _loc12_;
|
||||
_loc4_ = 0;
|
||||
_loc9_ = [];
|
||||
}
|
||||
_loc5_++;
|
||||
}
|
||||
return {
|
||||
"length":_loc12_,
|
||||
"lengths":_loc13_,
|
||||
"segments":_loc10_
|
||||
};
|
||||
}
|
||||
|
||||
private static function _addCubicLengths(param1:Array, param2:Array, param3:uint = 6) : void
|
||||
{
|
||||
var _loc4_:Number = NaN;
|
||||
var _loc8_:Number = NaN;
|
||||
var _loc11_:Number = NaN;
|
||||
var _loc13_:Number = NaN;
|
||||
var _loc14_:Number = NaN;
|
||||
var _loc15_:Number = NaN;
|
||||
var _loc9_:Number = NaN;
|
||||
var _loc5_:int = 0;
|
||||
var _loc10_:Number = NaN;
|
||||
var _loc12_:Segment = null;
|
||||
var _loc6_:int = 0;
|
||||
var _loc16_:Number = 1 / param3;
|
||||
var _loc7_:int = int(param1.length);
|
||||
while(--_loc7_ > -1)
|
||||
{
|
||||
_loc12_ = param1[_loc7_];
|
||||
_loc11_ = _loc12_.a;
|
||||
_loc13_ = _loc12_.d - _loc11_;
|
||||
_loc14_ = _loc12_.c - _loc11_;
|
||||
_loc15_ = _loc12_.b - _loc11_;
|
||||
_loc4_ = _loc8_ = 0;
|
||||
_loc5_ = 1;
|
||||
while(_loc5_ <= param3)
|
||||
{
|
||||
_loc9_ = _loc16_ * _loc5_;
|
||||
_loc10_ = 1 - _loc9_;
|
||||
_loc4_ = _loc8_ - (_loc8_ = (_loc9_ * _loc9_ * _loc13_ + 3 * _loc10_ * (_loc9_ * _loc14_ + _loc10_ * _loc15_)) * _loc9_);
|
||||
_loc6_ = _loc7_ * param3 + _loc5_ - 1;
|
||||
param2[_loc6_] = (param2[_loc6_] || 0) + _loc4_ * _loc4_;
|
||||
_loc5_++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
var _loc10_:String = null;
|
||||
var _loc8_:Boolean = false;
|
||||
var _loc6_:int = 0;
|
||||
var _loc7_:int = 0;
|
||||
var _loc11_:Array = null;
|
||||
var _loc5_:Object = null;
|
||||
var _loc4_:Array = null;
|
||||
var _loc12_:Object = null;
|
||||
this._target = param1;
|
||||
var _loc13_:Object = param2 is Array ? {"values":param2} : param2;
|
||||
this._props = [];
|
||||
this._timeRes = _loc13_.timeResolution == null ? 6 : int(_loc13_.timeResolution);
|
||||
_loc4_ = _loc13_.values || [];
|
||||
var _loc15_:Object = {};
|
||||
var _loc9_:Object = _loc4_[0];
|
||||
var _loc14_:Object = _loc13_.autoRotate || param3.vars.orientToBezier;
|
||||
this._autoRotate = _loc14_ ? (_loc14_ is Array ? _loc14_ as Array : [["x","y","rotation",_loc14_ === true ? 0 : Number(_loc14_)]]) : null;
|
||||
if(_loc9_ is Point)
|
||||
{
|
||||
this._props = ["x","y"];
|
||||
}
|
||||
else
|
||||
{
|
||||
for(_loc10_ in _loc9_)
|
||||
{
|
||||
this._props.push(_loc10_);
|
||||
}
|
||||
}
|
||||
_loc6_ = int(this._props.length);
|
||||
while(--_loc6_ > -1)
|
||||
{
|
||||
_loc10_ = this._props[_loc6_];
|
||||
this._overwriteProps.push(_loc10_);
|
||||
_loc8_ = Boolean(this._func[_loc10_] = param1[_loc10_] is Function);
|
||||
var _temp_4:*;
|
||||
_loc15_[_loc10_] = !_loc8_ ? param1[_loc10_] : (_temp_4 = param1,param1[_loc10_.indexOf("set") || !("get" + _loc10_.substr(3) in param1) ? _loc10_ : "get" + _loc10_.substr(3)]());
|
||||
if(!_loc5_)
|
||||
{
|
||||
if(_loc15_[_loc10_] !== _loc4_[0][_loc10_])
|
||||
{
|
||||
_loc5_ = _loc15_;
|
||||
}
|
||||
}
|
||||
}
|
||||
this._beziers = _loc13_.type !== "cubic" && _loc13_.type !== "quadratic" && _loc13_.type !== "soft" ? bezierThrough(_loc4_,isNaN(_loc13_.curviness) ? 1 : _loc13_.curviness,false,_loc13_.type === "thruBasic",_loc13_.correlate || "x,y,z",_loc5_) : _parseBezierData(_loc4_,_loc13_.type,_loc15_);
|
||||
this._segCount = this._beziers[_loc10_].length;
|
||||
if(this._timeRes)
|
||||
{
|
||||
_loc12_ = _parseLengthData(this._beziers,this._timeRes);
|
||||
this._length = _loc12_.length;
|
||||
this._lengths = _loc12_.lengths;
|
||||
this._segments = _loc12_.segments;
|
||||
this._l1 = this._li = this._s1 = this._si = 0;
|
||||
this._l2 = this._lengths[0];
|
||||
this._curSeg = this._segments[0];
|
||||
this._s2 = this._curSeg[0];
|
||||
this._prec = 1 / this._curSeg.length;
|
||||
}
|
||||
if(_loc11_ == this._autoRotate)
|
||||
{
|
||||
this._initialRotations = [];
|
||||
if(!(_loc11_[0] is Array))
|
||||
{
|
||||
this._autoRotate = _loc11_ = [_loc11_];
|
||||
}
|
||||
_loc6_ = int(_loc11_.length);
|
||||
while(--_loc6_ > -1)
|
||||
{
|
||||
_loc7_ = 0;
|
||||
while(_loc7_ < 3)
|
||||
{
|
||||
_loc10_ = _loc11_[_loc6_][_loc7_];
|
||||
this._func[_loc10_] = param1[_loc10_] is Function ? param1[_loc10_.indexOf("set") || !("get" + _loc10_.substr(3) in param1) ? _loc10_ : "get" + _loc10_.substr(3)] : false;
|
||||
_loc7_++;
|
||||
}
|
||||
_loc10_ = _loc11_[_loc6_][2];
|
||||
this._initialRotations[_loc6_] = this._func[_loc10_] ? this._func[_loc10_]() : this._target[_loc10_];
|
||||
}
|
||||
}
|
||||
_startRatio = param3.vars.runBackwards ? 1 : 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
override public function _kill(param1:Object) : Boolean
|
||||
{
|
||||
var _loc2_:String = null;
|
||||
var _loc4_:int = 0;
|
||||
var _loc3_:Array = this._props;
|
||||
for(_loc2_ in _beziers)
|
||||
{
|
||||
if(_loc2_ in param1)
|
||||
{
|
||||
delete _beziers[_loc2_];
|
||||
delete _func[_loc2_];
|
||||
_loc4_ = int(_loc3_.length);
|
||||
while(--_loc4_ > -1)
|
||||
{
|
||||
if(_loc3_[_loc4_] === _loc2_)
|
||||
{
|
||||
_loc3_.splice(_loc4_,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return super._kill(param1);
|
||||
}
|
||||
|
||||
override public function _roundProps(param1:Object, param2:Boolean = true) : void
|
||||
{
|
||||
var _loc3_:Array = null;
|
||||
_loc3_ = this._overwriteProps;
|
||||
var _loc4_:int = int(_loc3_.length);
|
||||
while(--_loc4_ > -1)
|
||||
{
|
||||
if(_loc3_[_loc4_] in param1 || "bezier" in param1 || "bezierThrough" in param1)
|
||||
{
|
||||
this._round[_loc3_[_loc4_]] = param2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function setRatio(param1:Number) : void
|
||||
{
|
||||
var _loc23_:* = 0;
|
||||
var _loc11_:Number = NaN;
|
||||
var _loc7_:int = 0;
|
||||
var _loc12_:String = null;
|
||||
var _loc6_:Segment = null;
|
||||
var _loc16_:Number = NaN;
|
||||
var _loc2_:Number = NaN;
|
||||
var _loc8_:int = 0;
|
||||
var _loc17_:Array = null;
|
||||
var _loc3_:Array = null;
|
||||
var _loc13_:Segment = null;
|
||||
var _loc19_:Number = NaN;
|
||||
var _loc18_:Number = NaN;
|
||||
var _loc21_:Number = NaN;
|
||||
var _loc20_:Number = NaN;
|
||||
var _loc4_:Number = NaN;
|
||||
var _loc22_:Number = NaN;
|
||||
var _loc14_:Array = null;
|
||||
var _loc10_:int = this._segCount;
|
||||
var _loc15_:Object = this._func;
|
||||
var _loc9_:Object = this._target;
|
||||
var _loc5_:Boolean = param1 !== this._startRatio;
|
||||
if(this._timeRes == 0)
|
||||
{
|
||||
_loc23_ = int(param1 < 0 ? 0 : (param1 >= 1 ? _loc10_ - 1 : _loc10_ * param1 >> 0));
|
||||
_loc16_ = (param1 - _loc23_ * (1 / _loc10_)) * _loc10_;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc17_ = this._lengths;
|
||||
_loc3_ = this._curSeg;
|
||||
param1 *= this._length;
|
||||
_loc7_ = this._li;
|
||||
if(param1 > this._l2 && _loc7_ < _loc10_ - 1)
|
||||
{
|
||||
_loc8_ = _loc10_ - 1;
|
||||
while(_loc7_ < _loc8_ && (this._l2 = _loc17_[++_loc7_]) <= param1)
|
||||
{
|
||||
}
|
||||
this._l1 = _loc17_[_loc7_ - 1];
|
||||
this._li = _loc7_;
|
||||
this._curSeg = _loc3_ = this._segments[_loc7_];
|
||||
this._s2 = _loc3_[this._s1 = this._si = 0];
|
||||
}
|
||||
else if(param1 < this._l1 && _loc7_ > 0)
|
||||
{
|
||||
while(_loc7_ > 0 && (this._l1 = _loc17_[--_loc7_]) >= param1)
|
||||
{
|
||||
}
|
||||
if(_loc7_ === 0 && param1 < this._l1)
|
||||
{
|
||||
this._l1 = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc7_++;
|
||||
}
|
||||
this._l2 = _loc17_[_loc7_];
|
||||
this._li = _loc7_;
|
||||
this._curSeg = _loc3_ = this._segments[_loc7_];
|
||||
this._s1 = _loc3_[(this._si = _loc3_.length - 1) - 1] || 0;
|
||||
this._s2 = _loc3_[this._si];
|
||||
}
|
||||
_loc23_ = _loc7_;
|
||||
param1 -= this._l1;
|
||||
_loc7_ = this._si;
|
||||
if(param1 > this._s2 && _loc7_ < _loc3_.length - 1)
|
||||
{
|
||||
_loc8_ = _loc3_.length - 1;
|
||||
while(_loc7_ < _loc8_ && (this._s2 = _loc3_[++_loc7_]) <= param1)
|
||||
{
|
||||
}
|
||||
this._s1 = _loc3_[_loc7_ - 1];
|
||||
this._si = _loc7_;
|
||||
}
|
||||
else if(param1 < this._s1 && _loc7_ > 0)
|
||||
{
|
||||
while(_loc7_ > 0 && (this._s1 = _loc3_[--_loc7_]) >= param1)
|
||||
{
|
||||
}
|
||||
if(_loc7_ === 0 && param1 < this._s1)
|
||||
{
|
||||
this._s1 = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc7_++;
|
||||
}
|
||||
this._s2 = _loc3_[_loc7_];
|
||||
this._si = _loc7_;
|
||||
}
|
||||
_loc16_ = (_loc7_ + (param1 - this._s1) / (this._s2 - this._s1)) * this._prec;
|
||||
}
|
||||
_loc11_ = 1 - _loc16_;
|
||||
_loc7_ = int(this._props.length);
|
||||
while(--_loc7_ > -1)
|
||||
{
|
||||
_loc12_ = this._props[_loc7_];
|
||||
_loc6_ = this._beziers[_loc12_][_loc23_];
|
||||
_loc2_ = (_loc16_ * _loc16_ * _loc6_.da + 3 * _loc11_ * (_loc16_ * _loc6_.ca + _loc11_ * _loc6_.ba)) * _loc16_ + _loc6_.a;
|
||||
if(this._round[_loc12_])
|
||||
{
|
||||
_loc2_ = _loc2_ + (_loc2_ > 0 ? 0.5 : -0.5) >> 0;
|
||||
}
|
||||
if(_loc15_[_loc12_])
|
||||
{
|
||||
_loc9_[_loc12_](_loc2_);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc9_[_loc12_] = _loc2_;
|
||||
}
|
||||
}
|
||||
if(this._autoRotate != null)
|
||||
{
|
||||
_loc14_ = this._autoRotate;
|
||||
_loc7_ = int(_loc14_.length);
|
||||
while(--_loc7_ > -1)
|
||||
{
|
||||
_loc12_ = _loc14_[_loc7_][2];
|
||||
_loc4_ = Number(_loc14_[_loc7_][3] || 0);
|
||||
_loc22_ = _loc14_[_loc7_][4] == true ? 1 : 57.29577951308232;
|
||||
_loc6_ = this._beziers[_loc14_[_loc7_][0]][_loc23_];
|
||||
_loc13_ = this._beziers[_loc14_[_loc7_][1]][_loc23_];
|
||||
_loc19_ = _loc6_.a + (_loc6_.b - _loc6_.a) * _loc16_;
|
||||
_loc21_ = _loc6_.b + (_loc6_.c - _loc6_.b) * _loc16_;
|
||||
_loc19_ += (_loc21_ - _loc19_) * _loc16_;
|
||||
_loc21_ += (_loc6_.c + (_loc6_.d - _loc6_.c) * _loc16_ - _loc21_) * _loc16_;
|
||||
_loc18_ = _loc13_.a + (_loc13_.b - _loc13_.a) * _loc16_;
|
||||
_loc20_ = _loc13_.b + (_loc13_.c - _loc13_.b) * _loc16_;
|
||||
_loc18_ += (_loc20_ - _loc18_) * _loc16_;
|
||||
_loc20_ += (_loc13_.c + (_loc13_.d - _loc13_.c) * _loc16_ - _loc20_) * _loc16_;
|
||||
_loc2_ = Number(_loc5_ ? Math.atan2(_loc20_ - _loc18_,_loc21_ - _loc19_) * _loc22_ + _loc4_ : this._initialRotations[_loc7_]);
|
||||
if(_loc15_[_loc12_])
|
||||
{
|
||||
_loc9_[_loc12_](_loc2_);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc9_[_loc12_] = _loc2_;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class Segment
|
||||
{
|
||||
|
||||
public var a:Number;
|
||||
|
||||
public var b:Number;
|
||||
|
||||
public var c:Number;
|
||||
|
||||
public var d:Number;
|
||||
|
||||
public var da:Number;
|
||||
|
||||
public var ca:Number;
|
||||
|
||||
public var ba:Number;
|
||||
|
||||
public function Segment(param1:Number, param2:Number, param3:Number, param4:Number)
|
||||
{
|
||||
super();
|
||||
this.a = param1;
|
||||
this.b = param2;
|
||||
this.c = param3;
|
||||
this.d = param4;
|
||||
this.da = param4 - param1;
|
||||
this.ca = param3 - param1;
|
||||
this.ba = param2 - param1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
|
||||
public class BezierThroughPlugin extends BezierPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
public function BezierThroughPlugin()
|
||||
{
|
||||
super();
|
||||
_propName = "bezierThrough";
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
if(param2 is Array)
|
||||
{
|
||||
param2 = {"values":param2};
|
||||
}
|
||||
param2.type = "thru";
|
||||
return super._onInitTween(param1,param2,param3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
import flash.filters.BlurFilter;
|
||||
|
||||
public class BlurFilterPlugin extends FilterPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
private static var _propNames:Array = ["blurX","blurY","quality"];
|
||||
|
||||
public function BlurFilterPlugin()
|
||||
{
|
||||
super("blurFilter");
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
return _initFilter(param1,param2,param3,BlurFilter,new BlurFilter(0,0,param2.quality || 2),_propNames);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,188 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
import flash.filters.ColorMatrixFilter;
|
||||
|
||||
public class ColorMatrixFilterPlugin extends FilterPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
protected static var _lumR:Number = 0.212671;
|
||||
|
||||
protected static var _lumG:Number = 0.71516;
|
||||
|
||||
protected static var _lumB:Number = 0.072169;
|
||||
|
||||
private static var _propNames:Array = [];
|
||||
|
||||
protected static var _idMatrix:Array = [1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];
|
||||
|
||||
protected var _matrix:Array;
|
||||
|
||||
protected var _matrixTween:EndArrayPlugin;
|
||||
|
||||
public function ColorMatrixFilterPlugin()
|
||||
{
|
||||
super("colorMatrixFilter");
|
||||
}
|
||||
|
||||
public static function colorize(param1:Array, param2:Number, param3:Number = 1) : Array
|
||||
{
|
||||
var _loc6_:Number = NaN;
|
||||
if(isNaN(param2))
|
||||
{
|
||||
return param1;
|
||||
}
|
||||
if(isNaN(param3))
|
||||
{
|
||||
param3 = 1;
|
||||
}
|
||||
_loc6_ = (param2 >> 16 & 0xFF) / 255;
|
||||
var _loc8_:Number = (param2 >> 8 & 0xFF) / 255;
|
||||
var _loc5_:Number = (param2 & 0xFF) / 255;
|
||||
var _loc4_:Number = 1 - param3;
|
||||
var _loc7_:Array = [_loc4_ + param3 * _loc6_ * _lumR,param3 * _loc6_ * _lumG,param3 * _loc6_ * _lumB,0,0,param3 * _loc8_ * _lumR,_loc4_ + param3 * _loc8_ * _lumG,param3 * _loc8_ * _lumB,0,0,param3 * _loc5_ * _lumR,param3 * _loc5_ * _lumG,_loc4_ + param3 * _loc5_ * _lumB,0,0,0,0,0,1,0];
|
||||
return applyMatrix(_loc7_,param1);
|
||||
}
|
||||
|
||||
public static function setThreshold(param1:Array, param2:Number) : Array
|
||||
{
|
||||
if(isNaN(param2))
|
||||
{
|
||||
return param1;
|
||||
}
|
||||
var _loc3_:Array = [_lumR * 256,_lumG * 256,_lumB * 256,0,-256 * param2,_lumR * 256,_lumG * 256,_lumB * 256,0,-256 * param2,_lumR * 256,_lumG * 256,_lumB * 256,0,-256 * param2,0,0,0,1,0];
|
||||
return applyMatrix(_loc3_,param1);
|
||||
}
|
||||
|
||||
public static function setHue(param1:Array, param2:Number) : Array
|
||||
{
|
||||
var _loc5_:Number = NaN;
|
||||
if(isNaN(param2))
|
||||
{
|
||||
return param1;
|
||||
}
|
||||
param2 *= 3.141592653589793 / 180;
|
||||
_loc5_ = Math.cos(param2);
|
||||
var _loc4_:Number = Math.sin(param2);
|
||||
var _loc3_:Array = [_lumR + _loc5_ * (1 - _lumR) + _loc4_ * -_lumR,_lumG + _loc5_ * -_lumG + _loc4_ * -_lumG,_lumB + _loc5_ * -_lumB + _loc4_ * (1 - _lumB),0,0,_lumR + _loc5_ * -_lumR + _loc4_ * 0.143,_lumG + _loc5_ * (1 - _lumG) + _loc4_ * 0.14,_lumB + _loc5_ * -_lumB + _loc4_ * -0.283,0,0,_lumR + _loc5_ * -_lumR + _loc4_ * -(1 - _lumR),_lumG + _loc5_ * -_lumG + _loc4_ * _lumG,_lumB + _loc5_ * (1 - _lumB) + _loc4_ * _lumB,0,0,0,0,0,1,0,0,0,0,0,1];
|
||||
return applyMatrix(_loc3_,param1);
|
||||
}
|
||||
|
||||
public static function setBrightness(param1:Array, param2:Number) : Array
|
||||
{
|
||||
if(isNaN(param2))
|
||||
{
|
||||
return param1;
|
||||
}
|
||||
param2 = param2 * 100 - 100;
|
||||
return applyMatrix([1,0,0,0,param2,0,1,0,0,param2,0,0,1,0,param2,0,0,0,1,0,0,0,0,0,1],param1);
|
||||
}
|
||||
|
||||
public static function setSaturation(param1:Array, param2:Number) : Array
|
||||
{
|
||||
var _loc3_:Number = NaN;
|
||||
if(isNaN(param2))
|
||||
{
|
||||
return param1;
|
||||
}
|
||||
_loc3_ = 1 - param2;
|
||||
var _loc4_:Number = _loc3_ * _lumR;
|
||||
var _loc7_:Number = _loc3_ * _lumG;
|
||||
var _loc5_:Number = _loc3_ * _lumB;
|
||||
var _loc6_:Array = [_loc4_ + param2,_loc7_,_loc5_,0,0,_loc4_,_loc7_ + param2,_loc5_,0,0,_loc4_,_loc7_,_loc5_ + param2,0,0,0,0,0,1,0];
|
||||
return applyMatrix(_loc6_,param1);
|
||||
}
|
||||
|
||||
public static function setContrast(param1:Array, param2:Number) : Array
|
||||
{
|
||||
if(isNaN(param2))
|
||||
{
|
||||
return param1;
|
||||
}
|
||||
param2 += 0.01;
|
||||
var _loc3_:Array = [param2,0,0,0,128 * (1 - param2),0,param2,0,0,128 * (1 - param2),0,0,param2,0,128 * (1 - param2),0,0,0,1,0];
|
||||
return applyMatrix(_loc3_,param1);
|
||||
}
|
||||
|
||||
public static function applyMatrix(param1:Array, param2:Array) : Array
|
||||
{
|
||||
var _loc6_:int = 0;
|
||||
var _loc4_:int = 0;
|
||||
if(!(param1 is Array) || !(param2 is Array))
|
||||
{
|
||||
return param2;
|
||||
}
|
||||
var _loc3_:Array = [];
|
||||
var _loc5_:int = 0;
|
||||
var _loc7_:int = 0;
|
||||
_loc6_ = 0;
|
||||
while(_loc6_ < 4)
|
||||
{
|
||||
_loc4_ = 0;
|
||||
while(_loc4_ < 5)
|
||||
{
|
||||
_loc7_ = int(_loc4_ == 4 ? param1[_loc5_ + 4] : 0);
|
||||
_loc3_[_loc5_ + _loc4_] = param1[_loc5_] * param2[_loc4_] + param1[_loc5_ + 1] * param2[_loc4_ + 5] + param1[_loc5_ + 2] * param2[_loc4_ + 10] + param1[_loc5_ + 3] * param2[_loc4_ + 15] + _loc7_;
|
||||
_loc4_ += 1;
|
||||
}
|
||||
_loc5_ += 5;
|
||||
_loc6_ += 1;
|
||||
}
|
||||
return _loc3_;
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
var _loc4_:Object = param2;
|
||||
_initFilter(param1,{
|
||||
"remove":param2.remove,
|
||||
"index":param2.index,
|
||||
"addFilter":param2.addFilter
|
||||
},param3,ColorMatrixFilter,new ColorMatrixFilter(_idMatrix.slice()),_propNames);
|
||||
if(_filter == null)
|
||||
{
|
||||
trace("FILTER NULL! ");
|
||||
return true;
|
||||
}
|
||||
_matrix = ColorMatrixFilter(_filter).matrix;
|
||||
var _loc5_:Array = [];
|
||||
if(_loc4_.matrix != null && _loc4_.matrix is Array)
|
||||
{
|
||||
_loc5_ = _loc4_.matrix;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(_loc4_.relative == true)
|
||||
{
|
||||
_loc5_ = _matrix.slice();
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc5_ = _idMatrix.slice();
|
||||
}
|
||||
_loc5_ = setBrightness(_loc5_,_loc4_.brightness);
|
||||
_loc5_ = setContrast(_loc5_,_loc4_.contrast);
|
||||
_loc5_ = setHue(_loc5_,_loc4_.hue);
|
||||
_loc5_ = setSaturation(_loc5_,_loc4_.saturation);
|
||||
_loc5_ = setThreshold(_loc5_,_loc4_.threshold);
|
||||
if(!isNaN(_loc4_.colorize))
|
||||
{
|
||||
_loc5_ = colorize(_loc5_,_loc4_.colorize,_loc4_.amount);
|
||||
}
|
||||
}
|
||||
_matrixTween = new EndArrayPlugin();
|
||||
_matrixTween._init(_matrix,_loc5_);
|
||||
return true;
|
||||
}
|
||||
|
||||
override public function setRatio(param1:Number) : void
|
||||
{
|
||||
_matrixTween.setRatio(param1);
|
||||
ColorMatrixFilter(_filter).matrix = _matrix;
|
||||
super.setRatio(param1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
import flash.display.DisplayObject;
|
||||
import flash.geom.ColorTransform;
|
||||
|
||||
public class ColorTransformPlugin extends TintPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
public function ColorTransformPlugin()
|
||||
{
|
||||
super();
|
||||
_propName = "colorTransform";
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
var _loc5_:ColorTransform = null;
|
||||
var _loc7_:Number = NaN;
|
||||
var _loc6_:ColorTransform = new ColorTransform();
|
||||
if(param1 is DisplayObject)
|
||||
{
|
||||
_transform = DisplayObject(param1).transform;
|
||||
_loc5_ = _transform.colorTransform;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!(param1 is ColorTransform))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
_loc5_ = param1 as ColorTransform;
|
||||
}
|
||||
if(param2 is ColorTransform)
|
||||
{
|
||||
_loc6_.concat(param2);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc6_.concat(_loc5_);
|
||||
}
|
||||
for(var _loc4_:String in param2)
|
||||
{
|
||||
if(_loc4_ == "tint" || _loc4_ == "color")
|
||||
{
|
||||
if(param2[_loc4_] != null)
|
||||
{
|
||||
_loc6_.color = int(param2[_loc4_]);
|
||||
}
|
||||
}
|
||||
else if(!(_loc4_ == "tintAmount" || _loc4_ == "exposure" || _loc4_ == "brightness"))
|
||||
{
|
||||
_loc6_[_loc4_] = param2[_loc4_];
|
||||
}
|
||||
}
|
||||
if(!(param2 is ColorTransform))
|
||||
{
|
||||
if(!isNaN(param2.tintAmount))
|
||||
{
|
||||
_loc7_ = param2.tintAmount / (1 - (_loc6_.redMultiplier + _loc6_.greenMultiplier + _loc6_.blueMultiplier) / 3);
|
||||
_loc6_.redOffset *= _loc7_;
|
||||
_loc6_.greenOffset *= _loc7_;
|
||||
_loc6_.blueOffset *= _loc7_;
|
||||
_loc6_.redMultiplier = _loc6_.greenMultiplier = _loc6_.blueMultiplier = 1 - param2.tintAmount;
|
||||
}
|
||||
else if(!isNaN(param2.exposure))
|
||||
{
|
||||
_loc6_.redOffset = _loc6_.greenOffset = _loc6_.blueOffset = 255 * (param2.exposure - 1);
|
||||
_loc6_.redMultiplier = _loc6_.greenMultiplier = _loc6_.blueMultiplier = 1;
|
||||
}
|
||||
else if(!isNaN(param2.brightness))
|
||||
{
|
||||
_loc6_.redOffset = _loc6_.greenOffset = _loc6_.blueOffset = Math.max(0,(param2.brightness - 1) * 255);
|
||||
_loc6_.redMultiplier = _loc6_.greenMultiplier = _loc6_.blueMultiplier = 1 - Math.abs(param2.brightness - 1);
|
||||
}
|
||||
}
|
||||
_init(_loc5_,_loc6_);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
import flash.filters.DropShadowFilter;
|
||||
|
||||
public class DropShadowFilterPlugin extends FilterPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
private static var _propNames:Array = ["distance","angle","color","alpha","blurX","blurY","strength","quality","inner","knockout","hideObject"];
|
||||
|
||||
public function DropShadowFilterPlugin()
|
||||
{
|
||||
super("dropShadowFilter");
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
return _initFilter(param1,param2,param3,DropShadowFilter,new DropShadowFilter(0,45,0,0,0,0,1,param2.quality || 2,param2.inner,param2.knockout,param2.hideObject),_propNames);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
|
||||
public class EndArrayPlugin extends TweenPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
protected var _a:Array;
|
||||
|
||||
protected var _round:Boolean;
|
||||
|
||||
protected var _info:Array = [];
|
||||
|
||||
public function EndArrayPlugin()
|
||||
{
|
||||
super("endArray");
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
if(!(param1 is Array) || !(param2 is Array))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
_init(param1 as Array,param2);
|
||||
return true;
|
||||
}
|
||||
|
||||
public function _init(param1:Array, param2:Array) : void
|
||||
{
|
||||
_a = param1;
|
||||
var _loc4_:int = int(param2.length);
|
||||
var _loc3_:int = 0;
|
||||
while(--_loc4_ > -1)
|
||||
{
|
||||
if(param1[_loc4_] != param2[_loc4_] && param1[_loc4_] != null)
|
||||
{
|
||||
_info[_loc3_++] = new ArrayTweenInfo(_loc4_,_a[_loc4_],param2[_loc4_] - _a[_loc4_]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function _roundProps(param1:Object, param2:Boolean = true) : void
|
||||
{
|
||||
if("endArray" in param1)
|
||||
{
|
||||
_round = param2;
|
||||
}
|
||||
}
|
||||
|
||||
override public function setRatio(param1:Number) : void
|
||||
{
|
||||
var _loc3_:ArrayTweenInfo = null;
|
||||
var _loc2_:Number = NaN;
|
||||
var _loc4_:int = int(_info.length);
|
||||
if(_round)
|
||||
{
|
||||
while(--_loc4_ > -1)
|
||||
{
|
||||
_loc3_ = _info[_loc4_];
|
||||
_a[_loc3_.i] = (_loc2_ = _loc3_.c * param1 + _loc3_.s) > 0 ? _loc2_ + 0.5 >> 0 : _loc2_ - 0.5 >> 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while(--_loc4_ > -1)
|
||||
{
|
||||
_loc3_ = _info[_loc4_];
|
||||
_a[_loc3_.i] = _loc3_.c * param1 + _loc3_.s;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ArrayTweenInfo
|
||||
{
|
||||
|
||||
public var i:uint;
|
||||
|
||||
public var s:Number;
|
||||
|
||||
public var c:Number;
|
||||
|
||||
public function ArrayTweenInfo(param1:uint, param2:Number, param3:Number)
|
||||
{
|
||||
super();
|
||||
this.i = param1;
|
||||
this.s = param2;
|
||||
this.c = param3;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
import flash.filters.BitmapFilter;
|
||||
import flash.filters.BlurFilter;
|
||||
|
||||
public class FilterPlugin extends TweenPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
protected var _target:Object;
|
||||
|
||||
protected var _type:Class;
|
||||
|
||||
protected var _filter:BitmapFilter;
|
||||
|
||||
protected var _index:int;
|
||||
|
||||
protected var _remove:Boolean;
|
||||
|
||||
private var _tween:TweenLite;
|
||||
|
||||
public function FilterPlugin(param1:String = "", param2:Number = 0)
|
||||
{
|
||||
super(param1,param2);
|
||||
}
|
||||
|
||||
protected function _initFilter(param1:*, param2:Object, param3:TweenLite, param4:Class, param5:BitmapFilter, param6:Array) : Boolean
|
||||
{
|
||||
var _loc7_:String = null;
|
||||
var _loc8_:int = 0;
|
||||
var _loc11_:HexColorsPlugin = null;
|
||||
_target = param1;
|
||||
_tween = param3;
|
||||
_type = param4;
|
||||
var _loc10_:Array = _target.filters;
|
||||
var _loc9_:Object = param2 is BitmapFilter ? {} : param2;
|
||||
if(_loc9_.index != null)
|
||||
{
|
||||
_index = _loc9_.index;
|
||||
}
|
||||
else
|
||||
{
|
||||
_index = _loc10_.length;
|
||||
if(_loc9_.addFilter != true)
|
||||
{
|
||||
while(--_index > -1 && !(_loc10_[_index] is _type))
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
if(_index < 0 || !(_loc10_[_index] is _type))
|
||||
{
|
||||
if(_index < 0)
|
||||
{
|
||||
_index = _loc10_.length;
|
||||
}
|
||||
if(_index > _loc10_.length)
|
||||
{
|
||||
_loc8_ = _loc10_.length - 1;
|
||||
while(++_loc8_ < _index)
|
||||
{
|
||||
_loc10_[_loc8_] = new BlurFilter(0,0,1);
|
||||
}
|
||||
}
|
||||
_loc10_[_index] = param5;
|
||||
_target.filters = _loc10_;
|
||||
}
|
||||
_filter = _loc10_[_index];
|
||||
_remove = _loc9_.remove == true;
|
||||
_loc8_ = int(param6.length);
|
||||
while(--_loc8_ > -1)
|
||||
{
|
||||
_loc7_ = param6[_loc8_];
|
||||
if(_loc7_ in param2 && _filter[_loc7_] != param2[_loc7_])
|
||||
{
|
||||
if(_loc7_ == "color" || _loc7_ == "highlightColor" || _loc7_ == "shadowColor")
|
||||
{
|
||||
_loc11_ = new HexColorsPlugin();
|
||||
_loc11_._initColor(_filter,_loc7_,param2[_loc7_]);
|
||||
_addTween(_loc11_,"setRatio",0,1,_propName);
|
||||
}
|
||||
else if(_loc7_ == "quality" || _loc7_ == "inner" || _loc7_ == "knockout" || _loc7_ == "hideObject")
|
||||
{
|
||||
_filter[_loc7_] = param2[_loc7_];
|
||||
}
|
||||
else
|
||||
{
|
||||
_addTween(_filter,_loc7_,_filter[_loc7_],param2[_loc7_],_propName);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
override public function setRatio(param1:Number) : void
|
||||
{
|
||||
super.setRatio(param1);
|
||||
var _loc2_:Array = _target.filters;
|
||||
if(!(_loc2_[_index] is _type))
|
||||
{
|
||||
_index = _loc2_.length;
|
||||
while(--_index > -1 && !(_loc2_[_index] is _type))
|
||||
{
|
||||
}
|
||||
if(_index == -1)
|
||||
{
|
||||
_index = _loc2_.length;
|
||||
}
|
||||
}
|
||||
if(param1 == 1 && _remove && _tween._time == _tween._duration && _tween.data != "isFromStart")
|
||||
{
|
||||
if(_index < _loc2_.length)
|
||||
{
|
||||
_loc2_.splice(_index,1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc2_[_index] = _filter;
|
||||
}
|
||||
_target.filters = _loc2_;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
import flash.display.MovieClip;
|
||||
|
||||
public class FrameLabelPlugin extends FramePlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
public function FrameLabelPlugin()
|
||||
{
|
||||
super();
|
||||
_propName = "frameLabel";
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
if(!param3.target is MovieClip)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
_target = param1 as MovieClip;
|
||||
this.frame = _target.currentFrame;
|
||||
var _loc7_:Array = _target.currentLabels;
|
||||
var _loc6_:String = param2;
|
||||
var _loc5_:int = _target.currentFrame;
|
||||
var _loc4_:int = int(_loc7_.length);
|
||||
while(--_loc4_ > -1)
|
||||
{
|
||||
if(_loc7_[_loc4_].name == _loc6_)
|
||||
{
|
||||
_loc5_ = int(_loc7_[_loc4_].frame);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(this.frame != _loc5_)
|
||||
{
|
||||
_addTween(this,"frame",this.frame,_loc5_,"frame",true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
import flash.display.MovieClip;
|
||||
|
||||
public class FramePlugin extends TweenPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
public var frame:int;
|
||||
|
||||
protected var _target:MovieClip;
|
||||
|
||||
public function FramePlugin()
|
||||
{
|
||||
super("frame,frameLabel,frameForward,frameBackward");
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
if(!(param1 is MovieClip) || isNaN(param2))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
_target = param1 as MovieClip;
|
||||
this.frame = _target.currentFrame;
|
||||
_addTween(this,"frame",this.frame,param2,"frame",true);
|
||||
return true;
|
||||
}
|
||||
|
||||
override public function setRatio(param1:Number) : void
|
||||
{
|
||||
super.setRatio(param1);
|
||||
if(this.frame != _target.currentFrame)
|
||||
{
|
||||
_target.gotoAndStop(this.frame);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
import flash.filters.GlowFilter;
|
||||
|
||||
public class GlowFilterPlugin extends FilterPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
private static var _propNames:Array = ["color","alpha","blurX","blurY","strength","quality","inner","knockout"];
|
||||
|
||||
public function GlowFilterPlugin()
|
||||
{
|
||||
super("glowFilter");
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
return _initFilter(param1,param2,param3,GlowFilter,new GlowFilter(16777215,0,0,0,param2.strength || 1,param2.quality || 2,param2.inner,param2.knockout),_propNames);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
|
||||
public class HexColorsPlugin extends TweenPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
protected var _colors:Array;
|
||||
|
||||
public function HexColorsPlugin()
|
||||
{
|
||||
super("hexColors");
|
||||
_overwriteProps = [];
|
||||
_colors = [];
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
for(var _loc4_:String in param2)
|
||||
{
|
||||
_initColor(param1,_loc4_,uint(param2[_loc4_]));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function _initColor(param1:Object, param2:String, param3:uint) : void
|
||||
{
|
||||
var _loc8_:Boolean = false;
|
||||
var _loc5_:* = 0;
|
||||
_loc8_ = typeof param1[param2] == "function";
|
||||
var _temp_2:*;
|
||||
var _loc7_:uint = uint(!_loc8_ ? param1[param2] : (_temp_2 = param1,param1[param2.indexOf("set") || !("get" + param2.substr(3) in param1) ? param2 : "get" + param2.substr(3)]()));
|
||||
var _temp_2:*;
|
||||
if(_loc7_ != param3)
|
||||
{
|
||||
_loc5_ = uint(_loc7_ >> 16);
|
||||
var _loc6_:uint = uint(_loc7_ >> 8 & 0xFF);
|
||||
var _loc4_:uint = uint(_loc7_ & 0xFF);
|
||||
_colors[_colors.length] = new ColorProp(param1,param2,_loc8_,_loc5_,(param3 >> 16) - _loc5_,_loc6_,(param3 >> 8 & 0xFF) - _loc6_,_loc4_,(param3 & 0xFF) - _loc4_);
|
||||
_overwriteProps[_overwriteProps.length] = param2;
|
||||
}
|
||||
}
|
||||
|
||||
override public function _kill(param1:Object) : Boolean
|
||||
{
|
||||
var _loc2_:int = int(_colors.length);
|
||||
while(_loc2_--)
|
||||
{
|
||||
if(param1[_colors[_loc2_].p] != null)
|
||||
{
|
||||
_colors.splice(_loc2_,1);
|
||||
}
|
||||
}
|
||||
return super._kill(param1);
|
||||
}
|
||||
|
||||
override public function setRatio(param1:Number) : void
|
||||
{
|
||||
var _loc3_:ColorProp = null;
|
||||
var _loc2_:Number = NaN;
|
||||
var _loc4_:int = int(_colors.length);
|
||||
while(--_loc4_ > -1)
|
||||
{
|
||||
_loc3_ = _colors[_loc4_];
|
||||
_loc2_ = _loc3_.rs + param1 * _loc3_.rc << 16 | _loc3_.gs + param1 * _loc3_.gc << 8 | _loc3_.bs + param1 * _loc3_.bc;
|
||||
if(_loc3_.f)
|
||||
{
|
||||
_loc3_.t[_loc3_.p](_loc2_);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc3_.t[_loc3_.p] = _loc2_;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ColorProp
|
||||
{
|
||||
|
||||
public var t:Object;
|
||||
|
||||
public var p:String;
|
||||
|
||||
public var f:Boolean;
|
||||
|
||||
public var rs:int;
|
||||
|
||||
public var rc:int;
|
||||
|
||||
public var gs:int;
|
||||
|
||||
public var gc:int;
|
||||
|
||||
public var bs:int;
|
||||
|
||||
public var bc:int;
|
||||
|
||||
public function ColorProp(param1:Object, param2:String, param3:Boolean, param4:int, param5:int, param6:int, param7:int, param8:int, param9:int)
|
||||
{
|
||||
super();
|
||||
this.t = param1;
|
||||
this.p = param2;
|
||||
this.f = param3;
|
||||
this.rs = param4;
|
||||
this.rc = param5;
|
||||
this.gs = param6;
|
||||
this.gc = param7;
|
||||
this.bs = param8;
|
||||
this.bc = param9;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
public class RemoveTintPlugin extends TintPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
public function RemoveTintPlugin()
|
||||
{
|
||||
super();
|
||||
_propName = "removeTint";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
import com.greensock.core.PropTween;
|
||||
|
||||
public class RoundPropsPlugin extends TweenPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
protected var _tween:TweenLite;
|
||||
|
||||
public function RoundPropsPlugin()
|
||||
{
|
||||
super("roundProps",-1);
|
||||
_overwriteProps.length = 0;
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
_tween = param3;
|
||||
return true;
|
||||
}
|
||||
|
||||
public function _onInitAllProps() : Boolean
|
||||
{
|
||||
var _loc5_:String = null;
|
||||
var _loc3_:PropTween = null;
|
||||
var _loc1_:PropTween = null;
|
||||
var _loc7_:Array = null;
|
||||
_loc7_ = _tween.vars.roundProps is Array ? _tween.vars.roundProps : _tween.vars.roundProps.split(",");
|
||||
var _loc6_:int = int(_loc7_.length);
|
||||
var _loc2_:Object = {};
|
||||
var _loc4_:PropTween = _tween._propLookup.roundProps;
|
||||
while(--_loc6_ > -1)
|
||||
{
|
||||
_loc2_[_loc7_[_loc6_]] = 1;
|
||||
}
|
||||
_loc6_ = int(_loc7_.length);
|
||||
while(--_loc6_ > -1)
|
||||
{
|
||||
_loc5_ = _loc7_[_loc6_];
|
||||
_loc3_ = _tween._firstPT;
|
||||
while(_loc3_)
|
||||
{
|
||||
_loc1_ = _loc3_._next;
|
||||
if(_loc3_.pg)
|
||||
{
|
||||
_loc3_.t._roundProps(_loc2_,true);
|
||||
}
|
||||
else if(_loc3_.n == _loc5_)
|
||||
{
|
||||
_add(_loc3_.t,_loc5_,_loc3_.s,_loc3_.c);
|
||||
if(_loc1_)
|
||||
{
|
||||
_loc1_._prev = _loc3_._prev;
|
||||
}
|
||||
if(_loc3_._prev)
|
||||
{
|
||||
_loc3_._prev._next = _loc1_;
|
||||
}
|
||||
else if(_tween._firstPT == _loc3_)
|
||||
{
|
||||
_tween._firstPT = _loc1_;
|
||||
}
|
||||
_loc3_._next = _loc3_._prev = null;
|
||||
_tween._propLookup[_loc5_] = _loc4_;
|
||||
}
|
||||
_loc3_ = _loc1_;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function _add(param1:Object, param2:String, param3:Number, param4:Number) : void
|
||||
{
|
||||
_addTween(param1,param2,param3,param3 + param4,param2,true);
|
||||
_overwriteProps[_overwriteProps.length] = param2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
|
||||
public class ShortRotationPlugin extends TweenPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
public function ShortRotationPlugin()
|
||||
{
|
||||
super("shortRotation");
|
||||
_overwriteProps.pop();
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
var _loc6_:Number = NaN;
|
||||
if(typeof param2 == "number")
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var _loc5_:Boolean = param2.useRadians == true;
|
||||
for(var _loc4_:String in param2)
|
||||
{
|
||||
if(_loc4_ != "useRadians")
|
||||
{
|
||||
var _temp_2:*;
|
||||
_loc6_ = Number(param1[_loc4_] is Function ? (_temp_2 = param1,param1[_loc4_.indexOf("set") || !("get" + _loc4_.substr(3) in param1) ? _loc4_ : "get" + _loc4_.substr(3)]()) : param1[_loc4_]);
|
||||
_initRotation(param1,_loc4_,_loc6_,typeof param2[_loc4_] == "number" ? Number(param2[_loc4_]) : _loc6_ + Number(param2[_loc4_].split("=").join("")),_loc5_);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function _initRotation(param1:Object, param2:String, param3:Number, param4:Number, param5:Boolean = false) : void
|
||||
{
|
||||
var _loc7_:Number = NaN;
|
||||
_loc7_ = param5 ? 3.141592653589793 * 2 : 360;
|
||||
var _loc6_:Number = (param4 - param3) % _loc7_;
|
||||
if(_loc6_ != _loc6_ % (_loc7_ / 2))
|
||||
{
|
||||
_loc6_ = _loc6_ < 0 ? _loc6_ + _loc7_ : _loc6_ - _loc7_;
|
||||
}
|
||||
_addTween(param1,param2,param3,param3 + _loc6_,param2);
|
||||
_overwriteProps[_overwriteProps.length] = param2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
import flash.display.Stage;
|
||||
|
||||
public class StageQualityPlugin extends TweenPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
protected var _stage:Stage;
|
||||
|
||||
protected var _during:String;
|
||||
|
||||
protected var _after:String;
|
||||
|
||||
protected var _tween:TweenLite;
|
||||
|
||||
public function StageQualityPlugin()
|
||||
{
|
||||
super("stageQuality");
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
if(!(param2.stage is Stage))
|
||||
{
|
||||
trace("You must define a \'stage\' property for the stageQuality object in your tween.");
|
||||
return false;
|
||||
}
|
||||
_stage = param2.stage as Stage;
|
||||
_tween = param3;
|
||||
_during = "during" in param2 ? param2.during : "medium";
|
||||
_after = "after" in param2 ? param2.after : _stage.quality;
|
||||
return true;
|
||||
}
|
||||
|
||||
override public function setRatio(param1:Number) : void
|
||||
{
|
||||
if(param1 == 1 && _tween._duration == _tween._time && _tween.data != "isFromStart" || param1 == 0 && _tween._time == 0)
|
||||
{
|
||||
_stage.quality = _after;
|
||||
}
|
||||
else if(_stage.quality != _during)
|
||||
{
|
||||
_stage.quality = _during;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.*;
|
||||
import com.greensock.core.*;
|
||||
import flash.display.*;
|
||||
import flash.geom.ColorTransform;
|
||||
import flash.geom.Transform;
|
||||
|
||||
public class TintPlugin extends TweenPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
protected static var _props:Array = ["redMultiplier","greenMultiplier","blueMultiplier","alphaMultiplier","redOffset","greenOffset","blueOffset","alphaOffset"];
|
||||
|
||||
protected var _transform:Transform;
|
||||
|
||||
public function TintPlugin()
|
||||
{
|
||||
super("tint,colorTransform,removeTint");
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
if(!(param1 is DisplayObject))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var _loc5_:ColorTransform = new ColorTransform();
|
||||
if(param2 != null && param3.vars.removeTint != true)
|
||||
{
|
||||
_loc5_.color = param2;
|
||||
}
|
||||
_transform = DisplayObject(param1).transform;
|
||||
var _loc4_:ColorTransform = _transform.colorTransform;
|
||||
_loc5_.alphaMultiplier = _loc4_.alphaMultiplier;
|
||||
_loc5_.alphaOffset = _loc4_.alphaOffset;
|
||||
_init(_loc4_,_loc5_);
|
||||
return true;
|
||||
}
|
||||
|
||||
public function _init(param1:ColorTransform, param2:ColorTransform) : void
|
||||
{
|
||||
var _loc3_:String = null;
|
||||
var _loc4_:int = int(_props.length);
|
||||
while(--_loc4_ > -1)
|
||||
{
|
||||
_loc3_ = _props[_loc4_];
|
||||
if(param1[_loc3_] != param2[_loc3_])
|
||||
{
|
||||
_addTween(param1,_loc3_,param1[_loc3_],param2[_loc3_],"tint");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function setRatio(param1:Number) : void
|
||||
{
|
||||
var _loc2_:ColorTransform = _transform.colorTransform;
|
||||
var _loc3_:PropTween = _firstPT;
|
||||
while(_loc3_)
|
||||
{
|
||||
_loc2_[_loc3_.p] = _loc3_.c * param1 + _loc3_.s;
|
||||
_loc3_ = _loc3_._next;
|
||||
}
|
||||
_transform.colorTransform = _loc2_;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,194 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
import com.greensock.core.PropTween;
|
||||
|
||||
public class TweenPlugin
|
||||
{
|
||||
|
||||
public static const version:String = "12.1.5";
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
public var _propName:String;
|
||||
|
||||
public var _overwriteProps:Array;
|
||||
|
||||
public var _priority:int = 0;
|
||||
|
||||
protected var _firstPT:PropTween;
|
||||
|
||||
public function TweenPlugin(param1:String = "", param2:int = 0)
|
||||
{
|
||||
super();
|
||||
_overwriteProps = param1.split(",");
|
||||
_propName = _overwriteProps[0];
|
||||
_priority = param2 || 0;
|
||||
}
|
||||
|
||||
private static function _onTweenEvent(param1:String, param2:TweenLite) : Boolean
|
||||
{
|
||||
var _loc7_:Boolean = false;
|
||||
var _loc6_:PropTween = null;
|
||||
var _loc5_:PropTween = null;
|
||||
var _loc3_:PropTween = null;
|
||||
var _loc8_:PropTween = null;
|
||||
var _loc4_:PropTween = param2._firstPT;
|
||||
if(param1 == "_onInitAllProps")
|
||||
{
|
||||
while(_loc4_)
|
||||
{
|
||||
_loc3_ = _loc4_._next;
|
||||
_loc8_ = _loc6_;
|
||||
while(_loc8_ && _loc8_.pr > _loc4_.pr)
|
||||
{
|
||||
_loc8_ = _loc8_._next;
|
||||
}
|
||||
if(_loc4_._prev == _loc8_ ? _loc8_._prev : _loc5_)
|
||||
{
|
||||
_loc4_._prev._next = _loc4_;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc6_ = _loc4_;
|
||||
}
|
||||
if(_loc4_._next == _loc8_)
|
||||
{
|
||||
_loc8_._prev = _loc4_;
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc5_ = _loc4_;
|
||||
}
|
||||
_loc4_ = _loc3_;
|
||||
}
|
||||
_loc4_ = param2._firstPT = _loc6_;
|
||||
}
|
||||
while(_loc4_)
|
||||
{
|
||||
if(_loc4_.pg)
|
||||
{
|
||||
if(param1 in _loc4_.t)
|
||||
{
|
||||
if(_loc4_.t[param1]())
|
||||
{
|
||||
_loc7_ = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
_loc4_ = _loc4_._next;
|
||||
}
|
||||
return _loc7_;
|
||||
}
|
||||
|
||||
public static function activate(param1:Array) : Boolean
|
||||
{
|
||||
TweenLite._onPluginEvent = TweenPlugin._onTweenEvent;
|
||||
var _loc2_:int = int(param1.length);
|
||||
while(--_loc2_ > -1)
|
||||
{
|
||||
if(param1[_loc2_].API == 2)
|
||||
{
|
||||
TweenLite._plugins[new (param1[_loc2_] as Class)()._propName] = param1[_loc2_];
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function _addTween(param1:Object, param2:String, param3:Number, param4:*, param5:String = null, param6:Boolean = false) : PropTween
|
||||
{
|
||||
var _loc7_:Number = param4 == null ? 0 : (typeof param4 === "number" || param4.charAt(1) !== "=" ? Number(param4) - param3 : (int(param4.charAt(0) + "1")) * Number(param4.substr(2)));
|
||||
if(_loc7_ !== 0)
|
||||
{
|
||||
_firstPT = new PropTween(param1,param2,param3,_loc7_,param5 || param2,false,_firstPT);
|
||||
_firstPT.r = param6;
|
||||
return _firstPT;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function setRatio(param1:Number) : void
|
||||
{
|
||||
var _loc2_:Number = NaN;
|
||||
var _loc3_:PropTween = _firstPT;
|
||||
while(_loc3_)
|
||||
{
|
||||
_loc2_ = _loc3_.c * param1 + _loc3_.s;
|
||||
if(_loc3_.r)
|
||||
{
|
||||
_loc2_ = _loc2_ + (_loc2_ > 0 ? 0.5 : -0.5) | 0;
|
||||
}
|
||||
if(_loc3_.f)
|
||||
{
|
||||
_loc3_.t[_loc3_.p](_loc2_);
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc3_.t[_loc3_.p] = _loc2_;
|
||||
}
|
||||
_loc3_ = _loc3_._next;
|
||||
}
|
||||
}
|
||||
|
||||
public function _roundProps(param1:Object, param2:Boolean = true) : void
|
||||
{
|
||||
var _loc3_:PropTween = _firstPT;
|
||||
while(_loc3_)
|
||||
{
|
||||
if(_propName in param1 || _loc3_.n != null && _loc3_.n.split(_propName + "_").join("") in param1)
|
||||
{
|
||||
_loc3_.r = param2;
|
||||
}
|
||||
_loc3_ = _loc3_._next;
|
||||
}
|
||||
}
|
||||
|
||||
public function _kill(param1:Object) : Boolean
|
||||
{
|
||||
var _loc3_:int = 0;
|
||||
if(_propName in param1)
|
||||
{
|
||||
_overwriteProps = [];
|
||||
}
|
||||
else
|
||||
{
|
||||
_loc3_ = int(_overwriteProps.length);
|
||||
while(--_loc3_ > -1)
|
||||
{
|
||||
if(_overwriteProps[_loc3_] in param1)
|
||||
{
|
||||
_overwriteProps.splice(_loc3_,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
var _loc2_:PropTween = _firstPT;
|
||||
while(_loc2_)
|
||||
{
|
||||
if(_loc2_.n in param1)
|
||||
{
|
||||
if(_loc2_._next)
|
||||
{
|
||||
_loc2_._next._prev = _loc2_._prev;
|
||||
}
|
||||
if(_loc2_._prev)
|
||||
{
|
||||
_loc2_._prev._next = _loc2_._next;
|
||||
_loc2_._prev = null;
|
||||
}
|
||||
else if(_firstPT == _loc2_)
|
||||
{
|
||||
_firstPT = _loc2_._next;
|
||||
}
|
||||
}
|
||||
_loc2_ = _loc2_._next;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.TweenLite;
|
||||
|
||||
public class VisiblePlugin extends TweenPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
protected var _target:Object;
|
||||
|
||||
protected var _tween:TweenLite;
|
||||
|
||||
protected var _visible:Boolean;
|
||||
|
||||
protected var _initVal:Boolean;
|
||||
|
||||
protected var _progress:int;
|
||||
|
||||
public function VisiblePlugin()
|
||||
{
|
||||
super("visible");
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
_target = param1;
|
||||
_tween = param3;
|
||||
_progress = _tween.vars.runBackwards ? 0 : 1;
|
||||
_initVal = _target.visible;
|
||||
_visible = param2;
|
||||
return true;
|
||||
}
|
||||
|
||||
override public function setRatio(param1:Number) : void
|
||||
{
|
||||
_target.visible = param1 == 1 && (_tween._time / _tween._duration == _progress || _tween._duration == 0) ? _visible : _initVal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.greensock.plugins
|
||||
{
|
||||
import com.greensock.*;
|
||||
import flash.media.SoundTransform;
|
||||
|
||||
public class VolumePlugin extends TweenPlugin
|
||||
{
|
||||
|
||||
public static const API:Number = 2;
|
||||
|
||||
protected var _target:Object;
|
||||
|
||||
protected var _st:SoundTransform;
|
||||
|
||||
public function VolumePlugin()
|
||||
{
|
||||
super("volume");
|
||||
}
|
||||
|
||||
override public function _onInitTween(param1:Object, param2:*, param3:TweenLite) : Boolean
|
||||
{
|
||||
if(isNaN(param2) || param1.hasOwnProperty("volume") || !param1.hasOwnProperty("soundTransform"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
_target = param1;
|
||||
_st = _target.soundTransform;
|
||||
_addTween(_st,"volume",_st.volume,param2,"volume");
|
||||
return true;
|
||||
}
|
||||
|
||||
override public function setRatio(param1:Number) : void
|
||||
{
|
||||
super.setRatio(param1);
|
||||
_target.soundTransform = _st;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user