home *** CD-ROM | disk | FTP | other *** search
- class Library.DispatcherBase
- {
- var bPaused;
- var aListeners;
- function DispatcherBase()
- {
- this.bPaused = false;
- this.aListeners = new Array();
- }
- function doEnterFrame()
- {
- if(!this.bPaused)
- {
- this.doDispatchMessage("doEnterFrame");
- }
- }
- function doAddListener(__oRef)
- {
- this.aListeners.push(__oRef);
- }
- function doRemoveListener(__oRef)
- {
- for(var _loc2_ in this.aListeners)
- {
- if(this.aListeners[_loc2_] == __oRef)
- {
- delete this.aListeners[_loc2_];
- this.aListeners.splice(Number(_loc2_),1);
- }
- }
- }
- function doPause()
- {
- this.bPaused = true;
- this.doDispatchMessage("doPause");
- }
- function doResume()
- {
- this.bPaused = false;
- this.doDispatchMessage("doResume");
- }
- function doDestroy()
- {
- delete this.aListeners;
- }
- function doDispatchMessage(__sMessage)
- {
- for(var _loc3_ in this.aListeners)
- {
- this.aListeners[_loc3_][__sMessage]();
- }
- }
- }
-