SAQAS3 /sh/saqoo/util/FrameDelay.as

Language ActionScript Lines 27
MD5 Hash d394285f8e9f0f503bc84d43f34a0eb0
Repository git://github.com/Saqoosha/SAQAS3.git View Raw File View Project SPDX
 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
package sh.saqoo.util {

	import flash.events.Event;

	public class FrameDelay {


		public function FrameDelay() {
			throw new Error('Cannot create FrameDelay instance.');
		}


		public static function set(numFrames:uint, callback:Function):void {
			if (numFrames == 0) {
				callback();
			} else {
				EnterFrameBeacon.add(function(event:Event):void {
					if (--numFrames <= 0) {
						EnterFrameBeacon.remove(arguments.callee);
						callback();
					}
				});
			}
		}
	}
}
Back to Top