⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 objectinterpolator.as

📁 用于flash/flex的 as3的 2D图形图像图表的动态生成
💻 AS
字号:
package flare.animate.interpolate
{
	/**
	 * Interpolator for arbitrary <code>Object</code> values. Simply swaps the
	 * initial value for the end value for interpolation fractions greater
	 * than or equal to 0.5.
	 */
	public class ObjectInterpolator extends Interpolator
	{
		private var _start:Object;
		private var _end:Object;
		
		/**
		 * Creates a new ObjectInterpolator.
		 * @param target the object whose property is being interpolated
		 * @param property the property to interpolate
		 * @param start the starting object value to interpolate from
		 * @param end the target object value to interpolate to
		 */
		public function ObjectInterpolator(target:Object, property:String,
		                                   start:Object, end:Object)
		{
			super(target, property, start, end);
		}
		
		/**
		 * Initializes this interpolator.
		 * @param start the starting value of the interpolation
		 * @param end the target value of the interpolation
		 */
		protected override function init(start:Object, end:Object) : void
		{
			_start = start;
			_end = end;
		}
		
		/**
		 * Calculate and set an interpolated property value. This method sets
		 * the target object's property to the starting value if the
		 * interpolation fraction is less than 0.5 and to the ending value if
		 * the fraction is greather than or equal to 0.5.
		 * @param f the interpolation fraction (typically between 0 and 1)
		 */
		public override function interpolate(f:Number) : void
		{
			_prop.setValue(_target, f < 0.5 ? _start : _end);
		}
		
	} // end of class ObjectInterpolator
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -