home *** CD-ROM | disk | FTP | other *** search
- class smashing.Menu extends MovieClip
- {
- static var target;
- var bEnabled = true;
- function Menu()
- {
- super();
- smashing.Menu.target = this;
- }
- function onShow()
- {
- }
- function onResume()
- {
- }
- function show(sFrame)
- {
- this.onShow();
- this.gotoAndPlay(sFrame);
- }
- function resume()
- {
- this.onResume();
- this.gotoAndStop("blank");
- }
- function playAgain()
- {
- }
- static function watchProp(o, sProp, sType)
- {
- var _loc1_ = o;
- var _loc2_ = sProp;
- switch(sType)
- {
- case "text":
- _loc1_.watch(_loc2_,smashing.Menu.watchText);
- break;
- case "frameMeter":
- _loc1_.watch(_loc2_,smashing.Menu.watchFrameMeter);
- break;
- case "pegboard":
- _loc1_.watch(_loc2_,smashing.Menu.watchPegboard);
- break;
- case "signboard":
- _loc1_.watch(_loc2_,smashing.Menu.watchSignboard);
- break;
- case "singleDigit":
- _loc1_.watch(_loc2_,smashing.Menu.watchSingleDigit);
- break;
- case "funkyMeter":
- _loc1_.watch(_loc2_,smashing.Menu.watchFunkyMeter);
- }
- }
- static function watchText(prop, oldVal, newVal)
- {
- smashing.Menu.target[prop.toString()] = newVal;
- return newVal;
- }
- static function watchFrameMeter(prop, oldVal, newVal)
- {
- var _loc2_ = smashing.Menu.target[prop.toString()];
- var _loc1_ = Math.ceil(newVal * _loc2_._totalframes);
- if(_loc1_ == 0)
- {
- _loc1_ = 1;
- }
- _loc2_.gotoAndStop(_loc1_);
- return newVal;
- }
- static function watchPegboard(prop, oldVal, newVal)
- {
- var _loc1_ = smashing.Menu.target[prop.toString()];
- _loc1_.pegs = newVal;
- return newVal;
- }
- static function watchSignboard(prop, oldVal, newVal)
- {
- var _loc2_ = this;
- var limit = 1;
- var _loc1_ = smashing.Menu.target[prop.toString()];
- _loc1_.gotoAndStop(newVal);
- _loc1_.startTime = getTimer();
- _loc1_.limit = limit;
- _loc1_.onEnterFrame = function()
- {
- var _loc1_ = this;
- var _loc2_ = (getTimer() - _loc1_.startTime) / 1000;
- if(_loc2_ >= _loc1_.limit)
- {
- _loc1_._visible = false;
- delete _loc1_.onEnterFrame;
- }
- };
- return newVal;
- }
- static function watchSingleDigit(prop, oldVal, newVal)
- {
- var _loc2_ = newVal;
- var _loc1_ = smashing.Menu.target[prop.toString()];
- _loc1_.gotoAndStop(_loc2_ + 1);
- smashing.Menu.target[prop + "cache"] = _loc2_ + 1;
- return _loc2_;
- }
- static function watchFunkyMeter(prop, oldVal, newVal)
- {
- var _loc3_ = newVal;
- if(_loc3_ < 0)
- {
- _loc3_ = 0;
- }
- var _loc2_ = smashing.Menu.target.funkyMeter;
- var _loc1_ = _loc2_[prop.toString()];
- var mcCap = _loc2_[prop.toString() + "Cap"];
- _loc1_._width = _loc3_ * _loc1_.fullWidth;
- mcCap._x = _loc1_._x + _loc1_._width - mcCap._width / 2;
- _loc2_[prop.toString() + "Cache"] = _loc3_;
- return _loc3_;
- }
- }
-