Tutorials, extensions, and source files for ActionScript, Flash, and other Adobe products.

 

senocular.com ActionScript Library

ModifyConstant.as

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.senocular.gyro {
	
	/**
	 * Matches seeker properties directly to target properties
	 */
	public class ModifyConstant
		implements IModify {
		
		protected var _rate:Number;
		
		public function get rate():Number {
			return _rate;
		}
		public function set rate(value:Number):void {
			_rate = value;
		}
		
		/**
		 * Constructor
		 */
		public function ModifyConstant(rate:Number = 0){
			_rate = rate;
		}
		
		/**
		 * Seek method; matches seeker properties
		 * to target properties based on the properties list
		 */
		public function call(interpolater:IInterpolate):void {
			var prop:Object = interpolater.property;
			if (prop) interpolater.owner[prop] += _rate;
		}
	}
}