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

 

senocular.com ActionScript Library

GyroEvent.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
package com.senocular.gyro {

	import flash.events.Event;
	
	public class GyroEvent extends Event {
		
		public static const AT_DESTINATION:String = "atDestination";
		public static const COMPLETE:String = "complete";
		public static const PAUSE:String = "pause";
		public static const REPEAT:String = "repeat";
		public static const REVERSE:String = "reverse";
		public static const START:String = "start";
		public static const STOP:String = "stop";
		public static const TWEEN:String = "tween";
	
		protected var _source:*; // TODO: generalized motion-er for gyro (IStartable? different interface? Different base class?  How many classes are dispatching this?)
			
		public function get source():* {
			return _source;
		}
		
		public function GyroEvent(type:String, source:* = null, bubbles:Boolean = false, cancelable:Boolean = false) {
			super(type, bubbles, cancelable);
			_source = source;
		}
		public override function clone():Event {
			return new GyroEvent(type, bubbles, cancelable, _source);
		}
	}
}