home *** CD-ROM | disk | FTP | other *** search
- class Library.State
- {
- var mcRef;
- var bStateLocked;
- var bPaused;
- var sState;
- var nStateTotalFrame;
- function State(__mcRef)
- {
- this.mcRef = __mcRef;
- this.bStateLocked = false;
- this.bPaused = false;
- }
- function doEnterFrame()
- {
- this["do" + this.sState]();
- }
- function doPause()
- {
- this.bPaused = true;
- this.mcRef.mcState.stop();
- }
- function doResume()
- {
- this.bPaused = false;
- this.mcRef.mcState.play();
- }
- function setState(__sState)
- {
- if(!this.bStateLocked)
- {
- this.doForcedSetState(__sState);
- }
- }
- function doForcedSetState(__sState)
- {
- if(this.sState != __sState)
- {
- this.doUnLoadStateAction(this.sState);
- this.sState = __sState;
- this.mcRef.gotoAndStop(this.sState);
- this.nStateTotalFrame = this.mcRef.mcState._totalframes;
- this.doLoadStateAction(this.sState);
- }
- }
- function get Paused()
- {
- return this.bPaused;
- }
- function get CurrentState()
- {
- return this.sState;
- }
- function doLoadStateAction()
- {
- }
- function doUnLoadStateAction()
- {
- }
- function doLockState()
- {
- this.bStateLocked = true;
- }
- function doUnlockState()
- {
- this.bStateLocked = false;
- }
- function isStateComplete()
- {
- var _loc2_ = false;
- if(this.mcRef.mcState._currentframe == this.nStateTotalFrame)
- {
- _loc2_ = true;
- }
- return _loc2_;
- }
- function isStateStarting()
- {
- var _loc2_ = false;
- if(this.mcRef.mcState._currentframe == 1)
- {
- _loc2_ = true;
- }
- return _loc2_;
- }
- }
-