Section 1
//PropTween (com.greensock.core.PropTween)
package com.greensock.core {
public class PropTween {
public var priority:int;
public var start:Number;
public var prevNode:PropTween;
public var change:Number;
public var target:Object;
public var name:String;
public var property:String;
public var nextNode:PropTween;
public var isPlugin:Boolean;
public function PropTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Boolean, _arg7:PropTween=null, _arg8:int=0){
this.target = _arg1;
this.property = _arg2;
this.start = _arg3;
this.change = _arg4;
this.name = _arg5;
this.isPlugin = _arg6;
if (_arg7){
_arg7.prevNode = this;
this.nextNode = _arg7;
};
this.priority = _arg8;
}
}
}//package com.greensock.core
Section 2
//SimpleTimeline (com.greensock.core.SimpleTimeline)
package com.greensock.core {
public class SimpleTimeline extends TweenCore {
public var autoRemoveChildren:Boolean;
protected var _lastChild:TweenCore;
protected var _firstChild:TweenCore;
public function SimpleTimeline(_arg1:Object=null){
super(0, _arg1);
}
override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
var _local5:Number;
var _local6:TweenCore;
var _local4:TweenCore = _firstChild;
this.cachedTotalTime = _arg1;
this.cachedTime = _arg1;
while (_local4) {
_local6 = _local4.nextNode;
if (((_local4.active) || ((((((_arg1 >= _local4.cachedStartTime)) && (!(_local4.cachedPaused)))) && (!(_local4.gc)))))){
if (!_local4.cachedReversed){
_local4.renderTime(((_arg1 - _local4.cachedStartTime) * _local4.cachedTimeScale), _arg2, false);
} else {
_local5 = (_local4.cacheIsDirty) ? _local4.totalDuration : _local4.cachedTotalDuration;
_local4.renderTime((_local5 - ((_arg1 - _local4.cachedStartTime) * _local4.cachedTimeScale)), _arg2, false);
};
};
_local4 = _local6;
};
}
public function addChild(_arg1:TweenCore):void{
if (((!(_arg1.cachedOrphan)) && (_arg1.timeline))){
_arg1.timeline.remove(_arg1, true);
};
_arg1.timeline = this;
if (_arg1.gc){
_arg1.setEnabled(true, true);
};
if (_firstChild){
_firstChild.prevNode = _arg1;
};
_arg1.nextNode = _firstChild;
_firstChild = _arg1;
_arg1.prevNode = null;
_arg1.cachedOrphan = false;
}
public function remove(_arg1:TweenCore, _arg2:Boolean=false):void{
if (_arg1.cachedOrphan){
return;
};
if (!_arg2){
_arg1.setEnabled(false, true);
};
if (_arg1.nextNode){
_arg1.nextNode.prevNode = _arg1.prevNode;
} else {
if (_lastChild == _arg1){
_lastChild = _arg1.prevNode;
};
};
if (_arg1.prevNode){
_arg1.prevNode.nextNode = _arg1.nextNode;
} else {
if (_firstChild == _arg1){
_firstChild = _arg1.nextNode;
};
};
_arg1.cachedOrphan = true;
}
public function get rawTime():Number{
return (this.cachedTotalTime);
}
}
}//package com.greensock.core
Section 3
//TweenCore (com.greensock.core.TweenCore)
package com.greensock.core {
import com.greensock.*;
public class TweenCore {
public var initted:Boolean;
protected var _hasUpdate:Boolean;
public var active:Boolean;
protected var _delay:Number;
public var cachedTime:Number;
public var cachedReversed:Boolean;
public var nextNode:TweenCore;
protected var _rawPrevTime:Number;// = -1
public var vars:Object;
public var cachedTotalTime:Number;
public var data;
public var timeline:SimpleTimeline;
public var cachedOrphan:Boolean;
public var cachedStartTime:Number;
public var prevNode:TweenCore;
public var cachedDuration:Number;
public var gc:Boolean;
protected var _pauseTime:Number;
public var cacheIsDirty:Boolean;
public var cachedPaused:Boolean;
public var cachedTimeScale:Number;
public var cachedTotalDuration:Number;
public static const version:Number = 1.382;
protected static var _classInitted:Boolean;
public function TweenCore(_arg1:Number=0, _arg2:Object=null){
this.vars = ((_arg2)!=null) ? _arg2 : {};
this.cachedDuration = (this.cachedTotalDuration = _arg1);
_delay = (this.vars.delay) ? Number(this.vars.delay) : 0;
this.cachedTimeScale = (this.vars.timeScale) ? Number(this.vars.timeScale) : 1;
this.active = Boolean((((((_arg1 == 0)) && ((_delay == 0)))) && (!((this.vars.immediateRender == false)))));
this.cachedTotalTime = (this.cachedTime = 0);
this.data = this.vars.data;
if (!_classInitted){
if (isNaN(TweenLite.rootFrame)){
TweenLite.initClass();
_classInitted = true;
} else {
return;
};
};
var _local3:SimpleTimeline = ((this.vars.timeline is SimpleTimeline)) ? this.vars.timeline : (this.vars.useFrames) ? TweenLite.rootFramesTimeline : TweenLite.rootTimeline;
this.cachedStartTime = (_local3.cachedTotalTime + _delay);
_local3.addChild(this);
if (this.vars.reversed){
this.cachedReversed = true;
};
if (this.vars.paused){
this.paused = true;
};
}
public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
}
public function get delay():Number{
return (_delay);
}
public function restart(_arg1:Boolean=false, _arg2:Boolean=true):void{
this.reversed = false;
this.paused = false;
this.setTotalTime((_arg1) ? -(_delay) : 0, _arg2);
}
public function get duration():Number{
return (this.cachedDuration);
}
public function set reversed(_arg1:Boolean):void{
if (_arg1 != this.cachedReversed){
this.cachedReversed = _arg1;
setTotalTime(this.cachedTotalTime, true);
};
}
public function set startTime(_arg1:Number):void{
var _local2:Boolean = Boolean(((!((this.timeline == null))) && (((!((_arg1 == this.cachedStartTime))) || (this.gc)))));
this.cachedStartTime = _arg1;
if (_local2){
this.timeline.addChild(this);
};
}
public function set delay(_arg1:Number):void{
this.startTime = (this.startTime + (_arg1 - _delay));
_delay = _arg1;
}
public function resume():void{
this.paused = false;
}
public function get paused():Boolean{
return (this.cachedPaused);
}
public function play():void{
this.reversed = false;
this.paused = false;
}
public function set duration(_arg1:Number):void{
this.cachedDuration = (this.cachedTotalDuration = _arg1);
setDirtyCache(false);
}
public function invalidate():void{
}
public function complete(_arg1:Boolean=false, _arg2:Boolean=false):void{
if (!_arg1){
renderTime(this.totalDuration, _arg2, false);
return;
};
if (this.timeline.autoRemoveChildren){
this.setEnabled(false, false);
} else {
this.active = false;
};
if (!_arg2){
if (((((this.vars.onComplete) && ((this.cachedTotalTime == this.cachedTotalDuration)))) && (!(this.cachedReversed)))){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
} else {
if (((((this.cachedReversed) && ((this.cachedTotalTime == 0)))) && (this.vars.onReverseComplete))){
this.vars.onReverseComplete.apply(null, this.vars.onReverseCompleteParams);
};
};
};
}
public function get reversed():Boolean{
return (this.cachedReversed);
}
public function get totalTime():Number{
return (this.cachedTotalTime);
}
public function get startTime():Number{
return (this.cachedStartTime);
}
public function set currentTime(_arg1:Number):void{
setTotalTime(_arg1, false);
}
protected function setDirtyCache(_arg1:Boolean=true):void{
var _local2:TweenCore = (_arg1) ? this : this.timeline;
while (_local2) {
_local2.cacheIsDirty = true;
_local2 = _local2.timeline;
};
}
public function reverse(_arg1:Boolean=true):void{
this.reversed = true;
if (_arg1){
this.paused = false;
} else {
if (this.gc){
this.setEnabled(true, false);
};
};
}
public function set paused(_arg1:Boolean):void{
if (((!((_arg1 == this.cachedPaused))) && (this.timeline))){
if (_arg1){
_pauseTime = this.timeline.rawTime;
} else {
this.cachedStartTime = (this.cachedStartTime + (this.timeline.rawTime - _pauseTime));
_pauseTime = NaN;
setDirtyCache(false);
};
this.cachedPaused = _arg1;
this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration))));
};
if (((!(_arg1)) && (this.gc))){
this.setTotalTime(this.cachedTotalTime, false);
this.setEnabled(true, false);
};
}
public function kill():void{
setEnabled(false, false);
}
public function set totalTime(_arg1:Number):void{
setTotalTime(_arg1, false);
}
public function get currentTime():Number{
return (this.cachedTime);
}
protected function setTotalTime(_arg1:Number, _arg2:Boolean=false):void{
var _local3:Number;
var _local4:Number;
if (this.timeline){
_local3 = (((_pauseTime) || ((_pauseTime == 0)))) ? _pauseTime : this.timeline.cachedTotalTime;
if (this.cachedReversed){
_local4 = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration;
this.cachedStartTime = (_local3 - ((_local4 - _arg1) / this.cachedTimeScale));
} else {
this.cachedStartTime = (_local3 - (_arg1 / this.cachedTimeScale));
};
if (!this.timeline.cacheIsDirty){
setDirtyCache(false);
};
if (this.cachedTotalTime != _arg1){
renderTime(_arg1, _arg2, false);
};
};
}
public function pause():void{
this.paused = true;
}
public function set totalDuration(_arg1:Number):void{
this.duration = _arg1;
}
public function get totalDuration():Number{
return (this.cachedTotalDuration);
}
public function setEnabled(_arg1:Boolean, _arg2:Boolean=false):Boolean{
this.gc = !(_arg1);
if (_arg1){
this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration))));
if (((!(_arg2)) && (this.cachedOrphan))){
this.timeline.addChild(this);
};
} else {
this.active = false;
if (((!(_arg2)) && (!(this.cachedOrphan)))){
this.timeline.remove(this, true);
};
};
return (false);
}
}
}//package com.greensock.core
Section 4
//TweenLite (com.greensock.TweenLite)
package com.greensock {
import flash.display.*;
import com.greensock.core.*;
import flash.events.*;
import flash.utils.*;
import com.greensock.plugins.*;
public class TweenLite extends TweenCore {
protected var _hasPlugins:Boolean;
public var propTweenLookup:Object;
public var cachedPT1:PropTween;
protected var _overwrite:uint;
protected var _ease:Function;
public var target:Object;
public var ratio:Number;// = 0
protected var _overwrittenProps:Object;
protected var _notifyPluginsOfEnabled:Boolean;
public static const version:Number = 11.36;
public static var rootTimeline:SimpleTimeline;
public static var fastEaseLookup:Dictionary = new Dictionary(false);
public static var onPluginEvent:Function;
public static var rootFramesTimeline:SimpleTimeline;
public static var defaultEase:Function = TweenLite.easeOut;
public static var plugins:Object = {};
public static var masterList:Dictionary = new Dictionary(false);
public static var overwriteManager:Object;
public static var rootFrame:Number;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
private static var _shape:Shape = new Shape();
protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, roundProps:1, onStart:1, onStartParams:1, onInit:1, onInitParams:1, onReverseComplete:1, onReverseCompleteParams:1, onRepeat:1, onRepeatParams:1, proxiedEase:1, easeParams:1, yoyo:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, onReverseCompleteListener:1, onRepeatListener:1, orientToBezier:1, timeScale:1, immediateRender:1, repeat:1, repeatDelay:1, timeline:1, data:1, paused:1};
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
var _local5:TweenLite;
super(_arg2, _arg3);
this.target = _arg1;
if ((((this.target is TweenCore)) && (this.vars.timeScale))){
this.cachedTimeScale = 1;
};
propTweenLookup = {};
_ease = defaultEase;
_overwrite = (((!((Number(_arg3.overwrite) > -1))) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
var _local4:Array = masterList[_arg1];
if (!_local4){
masterList[_arg1] = [this];
} else {
if (_overwrite == 1){
for each (_local5 in _local4) {
if (!_local5.gc){
_local5.setEnabled(false, false);
};
};
masterList[_arg1] = [this];
} else {
_local4[_local4.length] = this;
};
};
if (((this.active) || (this.vars.immediateRender))){
renderTime(0, false, true);
};
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{
var _local4:Boolean;
var _local5:Number = this.cachedTime;
if (_arg1 >= this.cachedDuration){
this.cachedTotalTime = (this.cachedTime = this.cachedDuration);
this.ratio = 1;
_local4 = true;
if (this.cachedDuration == 0){
if ((((((_arg1 == 0)) || ((_rawPrevTime < 0)))) && (!((_rawPrevTime == _arg1))))){
_arg3 = true;
};
_rawPrevTime = _arg1;
};
} else {
if (_arg1 <= 0){
this.cachedTotalTime = (this.cachedTime = (this.ratio = 0));
if (_arg1 < 0){
this.active = false;
if (this.cachedDuration == 0){
if (_rawPrevTime > 0){
_arg3 = true;
_local4 = true;
};
_rawPrevTime = _arg1;
};
};
if (((this.cachedReversed) && (!((_local5 == 0))))){
_local4 = true;
};
} else {
this.cachedTotalTime = (this.cachedTime = _arg1);
this.ratio = _ease(_arg1, 0, 1, this.cachedDuration);
};
};
if ((((this.cachedTime == _local5)) && (!(_arg3)))){
return;
};
if (!this.initted){
init();
if (((!(_local4)) && (this.cachedTime))){
this.ratio = _ease(this.cachedTime, 0, 1, this.cachedDuration);
};
};
if (((!(this.active)) && (!(this.cachedPaused)))){
this.active = true;
};
if ((((((((_local5 == 0)) && (this.vars.onStart))) && (!((this.cachedTime == 0))))) && (!(_arg2)))){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
var _local6:PropTween = this.cachedPT1;
while (_local6) {
_local6.target[_local6.property] = (_local6.start + (this.ratio * _local6.change));
_local6 = _local6.nextNode;
};
if (((_hasUpdate) && (!(_arg2)))){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local4){
if (((_hasPlugins) && (this.cachedPT1))){
onPluginEvent("onComplete", this);
};
complete(true, _arg2);
};
}
override public function setEnabled(_arg1:Boolean, _arg2:Boolean=false):Boolean{
var _local3:Array;
if (_arg1){
_local3 = TweenLite.masterList[this.target];
if (!_local3){
TweenLite.masterList[this.target] = [this];
} else {
_local3[_local3.length] = this;
};
};
super.setEnabled(_arg1, _arg2);
if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){
return (onPluginEvent((_arg1) ? "onEnable" : "onDisable", this));
};
return (false);
}
protected function init():void{
var _local1:String;
var _local2:int;
var _local3:*;
var _local4:Boolean;
var _local5:Array;
var _local6:PropTween;
if (this.vars.onInit){
this.vars.onInit.apply(null, this.vars.onInitParams);
};
if (typeof(this.vars.ease) == "function"){
_ease = this.vars.ease;
};
if (this.vars.easeParams){
this.vars.proxiedEase = _ease;
_ease = easeProxy;
};
this.cachedPT1 = null;
this.propTweenLookup = {};
for (_local1 in this.vars) {
if ((((_local1 in _reservedProps)) && (!((((_local1 == "timeScale")) && ((this.target is TweenCore))))))){
} else {
if ((((_local1 in plugins)) && (new ((plugins[_local1] as Class)).onInitTween(this.target, this.vars[_local1], this)))){
this.cachedPT1 = new PropTween(_local3, "changeFactor", 0, 1, ((_local3.overwriteProps.length)==1) ? _local3.overwriteProps[0] : "_MULTIPLE_", true, this.cachedPT1);
if (this.cachedPT1.name == "_MULTIPLE_"){
_local2 = _local3.overwriteProps.length;
while (--_local2 > -1) {
this.propTweenLookup[_local3.overwriteProps[_local2]] = this.cachedPT1;
};
} else {
this.propTweenLookup[this.cachedPT1.name] = this.cachedPT1;
};
if (_local3.priority){
this.cachedPT1.priority = _local3.priority;
_local4 = true;
};
if (((_local3.onDisable) || (_local3.onEnable))){
_notifyPluginsOfEnabled = true;
};
_hasPlugins = true;
} else {
this.cachedPT1 = new PropTween(this.target, _local1, Number(this.target[_local1]), ((typeof(this.vars[_local1]))=="number") ? (Number(this.vars[_local1]) - this.target[_local1]) : Number(this.vars[_local1]), _local1, false, this.cachedPT1);
this.propTweenLookup[_local1] = this.cachedPT1;
};
};
};
if (_local4){
onPluginEvent("onInit", this);
};
if (this.vars.runBackwards){
_local6 = this.cachedPT1;
while (_local6) {
_local6.start = (_local6.start + _local6.change);
_local6.change = -(_local6.change);
_local6 = _local6.nextNode;
};
};
_hasUpdate = Boolean(!((this.vars.onUpdate == null)));
if (_overwrittenProps){
killVars(_overwrittenProps);
if (this.cachedPT1 == null){
this.setEnabled(false, false);
};
};
if ((((((((_overwrite > 1)) && (this.cachedPT1))) && (masterList[this.target]))) && ((_local5.length > 1)))){
if (overwriteManager.manageOverwrites(this, this.propTweenLookup, _local5, _overwrite)){
init();
};
};
this.initted = true;
}
public function killVars(_arg1:Object, _arg2:Boolean=true):Boolean{
var _local3:String;
var _local4:PropTween;
var _local5:Boolean;
if (_overwrittenProps == null){
_overwrittenProps = {};
};
for (_local3 in _arg1) {
if ((_local3 in propTweenLookup)){
_local4 = propTweenLookup[_local3];
if (((_local4.isPlugin) && ((_local4.name == "_MULTIPLE_")))){
_local4.target.killProps(_arg1);
if (_local4.target.overwriteProps.length == 0){
_local4.name = "";
};
};
if (_local4.name != "_MULTIPLE_"){
if (_local4.nextNode){
_local4.nextNode.prevNode = _local4.prevNode;
};
if (_local4.prevNode){
_local4.prevNode.nextNode = _local4.nextNode;
} else {
if (this.cachedPT1 == _local4){
this.cachedPT1 = _local4.nextNode;
};
};
if (((_local4.isPlugin) && (_local4.target.onDisable))){
_local4.target.onDisable();
if (_local4.target.activeDisable){
_local5 = true;
};
};
delete propTweenLookup[_local3];
};
};
if (((_arg2) && (!((_arg1 == _overwrittenProps))))){
_overwrittenProps[_local3] = 1;
};
};
return (_local5);
}
override public function invalidate():void{
if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){
onPluginEvent("onDisable", this);
};
this.cachedPT1 = null;
_overwrittenProps = null;
_hasUpdate = (this.initted = (this.active = (_notifyPluginsOfEnabled = false)));
this.propTweenLookup = {};
}
public static function initClass():void{
rootFrame = 0;
rootTimeline = new SimpleTimeline(null);
rootFramesTimeline = new SimpleTimeline(null);
rootTimeline.cachedStartTime = (getTimer() * 0.001);
rootFramesTimeline.cachedStartTime = rootFrame;
rootTimeline.autoRemoveChildren = true;
rootFramesTimeline.autoRemoveChildren = true;
_shape.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
}
public static function killTweensOf(_arg1:Object, _arg2:Boolean=false, _arg3:Object=null):void{
var _local4:Array;
var _local5:int;
var _local6:TweenLite;
if ((_arg1 in masterList)){
_local4 = masterList[_arg1];
_local5 = _local4.length;
while (--_local5 > -1) {
_local6 = _local4[_local5];
if (!_local6.gc){
if (_arg2){
_local6.complete(false, false);
};
if (_arg3 != null){
_local6.killVars(_arg3);
};
if ((((_arg3 == null)) || ((((_local6.cachedPT1 == null)) && (_local6.initted))))){
_local6.setEnabled(false, false);
};
};
};
if (_arg3 == null){
delete masterList[_arg1];
};
};
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
if (!("immediateRender" in _arg3)){
_arg3.immediateRender = true;
};
return (new TweenLite(_arg1, _arg2, _arg3));
}
protected static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (1 - (_arg1 / _arg4));
return ((1 - (_arg1 * _arg1)));
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, immediateRender:false, useFrames:_arg4, overwrite:0}));
}
protected static function updateAll(_arg1:Event=null):void{
var _local2:Dictionary;
var _local3:Object;
var _local4:Array;
var _local5:int;
rootTimeline.renderTime((((getTimer() * 0.001) - rootTimeline.cachedStartTime) * rootTimeline.cachedTimeScale), false, false);
rootFrame++;
rootFramesTimeline.renderTime(((rootFrame - rootFramesTimeline.cachedStartTime) * rootFramesTimeline.cachedTimeScale), false, false);
if (!(rootFrame % 60)){
_local2 = masterList;
for (_local3 in _local2) {
_local4 = _local2[_local3];
_local5 = _local4.length;
while (--_local5 > -1) {
if (TweenLite(_local4[_local5]).gc){
_local4.splice(_local5, 1);
};
};
if (_local4.length == 0){
delete _local2[_local3];
};
};
};
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package com.greensock
Section 5
//NumberHandler (data.NumberHandler)
package data {
import flash.display.*;
public class NumberHandler {
private static function numHandler(_arg1:Number, _arg2:MovieClip){
if (_arg1 == 0){
_arg2.gotoAndStop(1);
} else {
_arg2.gotoAndStop((_arg1 + 1));
};
}
public static function getNumber(_arg1:Number, _arg2:Array):void{
var _local3:Number;
var _local4:Number = Math.floor((_arg1 / 10000));
var _local5:Number = Math.floor(((_arg1 - (_local4 * 10000)) / 1000));
var _local6:Number = Math.floor((((_arg1 - (_local4 * 10000)) - (_local5 * 1000)) / 100));
var _local7:Number = Math.floor(((((_arg1 - (_local4 * 10000)) - (_local5 * 1000)) - (_local6 * 100)) / 10));
var _local8:Number = Math.floor(((((_arg1 - (_local4 * 10000)) - (_local5 * 1000)) - (_local6 * 100)) - (_local7 * 10)));
if (_arg1 < 10){
_local3 = 1;
numHandler(_local8, _arg2[0]);
} else {
if ((((_arg1 >= 10)) && ((_arg1 < 100)))){
_local3 = 2;
numHandler(_local7, _arg2[0]);
numHandler(_local8, _arg2[1]);
if (_arg2.length == 2){
_arg2[1].visible = true;
_arg2[0].visible = true;
return;
};
} else {
if ((((_arg1 >= 100)) && ((_arg1 < 1000)))){
_local3 = 3;
numHandler(_local6, _arg2[0]);
numHandler(_local7, _arg2[1]);
numHandler(_local8, _arg2[2]);
} else {
if ((((_arg1 >= 1000)) && ((_arg1 < 10000)))){
_local3 = 4;
numHandler(_local5, _arg2[0]);
numHandler(_local6, _arg2[1]);
numHandler(_local7, _arg2[2]);
numHandler(_local8, _arg2[3]);
} else {
if ((((_arg1 >= 10000)) && ((_arg1 < 100000)))){
_local3 = 5;
numHandler(_local4, _arg2[0]);
numHandler(_local5, _arg2[1]);
numHandler(_local6, _arg2[2]);
numHandler(_local7, _arg2[3]);
numHandler(_local8, _arg2[4]);
} else {
trace("你输入的数据过大");
_local3 = 6;
};
};
};
};
};
var _local9:int;
while (_local9 < _arg2.length) {
if (_local9 < _local3){
_arg2[_local9].visible = true;
} else {
_arg2[_local9].visible = false;
};
_local9++;
};
}
}
}//package data
Section 6
//NumberHandlerTwo (data.NumberHandlerTwo)
package data {
import flash.display.*;
public class NumberHandlerTwo {
private static function numHandler(_arg1:Number, _arg2:MovieClip){
if (_arg1 == 0){
_arg2.gotoAndStop(1);
} else {
_arg2.gotoAndStop((_arg1 + 1));
};
}
public static function getNumber(_arg1:Number, _arg2:Array):void{
var _local3:Number;
var _local4:Number = Math.floor((_arg1 / 10000));
var _local5:Number = Math.floor(((_arg1 - (_local4 * 10000)) / 1000));
var _local6:Number = Math.floor((((_arg1 - (_local4 * 10000)) - (_local5 * 1000)) / 100));
var _local7:Number = Math.floor(((((_arg1 - (_local4 * 10000)) - (_local5 * 1000)) - (_local6 * 100)) / 10));
var _local8:Number = Math.floor(((((_arg1 - (_local4 * 10000)) - (_local5 * 1000)) - (_local6 * 100)) - (_local7 * 10)));
numHandler(0, _arg2[0]);
numHandler(_local4, _arg2[1]);
numHandler(_local5, _arg2[2]);
numHandler(_local6, _arg2[3]);
numHandler(_local7, _arg2[4]);
numHandler(_local8, _arg2[5]);
if (_arg1 < 10){
_local3 = 1;
numHandler(_local8, _arg2[5]);
} else {
if ((((_arg1 >= 10)) && ((_arg1 < 100)))){
_local3 = 2;
numHandler(_local7, _arg2[4]);
numHandler(_local8, _arg2[5]);
} else {
if ((((_arg1 >= 100)) && ((_arg1 < 1000)))){
_local3 = 3;
numHandler(_local6, _arg2[3]);
numHandler(_local7, _arg2[4]);
numHandler(_local8, _arg2[5]);
} else {
if ((((_arg1 >= 1000)) && ((_arg1 < 10000)))){
_local3 = 4;
numHandler(_local5, _arg2[2]);
numHandler(_local6, _arg2[3]);
numHandler(_local7, _arg2[4]);
numHandler(_local8, _arg2[5]);
} else {
if ((((_arg1 >= 10000)) && ((_arg1 < 100000)))){
_local3 = 5;
numHandler(_local4, _arg2[1]);
numHandler(_local5, _arg2[2]);
numHandler(_local6, _arg2[3]);
numHandler(_local7, _arg2[4]);
numHandler(_local8, _arg2[5]);
} else {
trace("你输入的数据过大");
_local3 = 6;
};
};
};
};
};
}
}
}//package data
Section 7
//Cashier (element.Cashier)
package element {
public class Cashier extends WaiterTwo {
public var cashierHide:Boolean;
private var _isCashierAndWaiter:Boolean;
public function Cashier(_arg1:Class){
super(_arg1);
}
override protected function goClothes():void{
super.goClothes();
cashierHide = false;
}
public function get isCashierAndWaiter():Boolean{
return (_isCashierAndWaiter);
}
override public function update():void{
super.update();
}
override protected function lookForGuest():void{
super.lookForGuest();
cashierHide = false;
}
override protected function getDesk():void{
cashierHide = true;
this.gotoFrame("standRight");
action = "settleAccounts";
_isFree = false;
trace("```````````````````带客人到达收银台");
}
public function set isCashierAndWaiter(_arg1:Boolean):void{
_isCashierAndWaiter = _arg1;
}
override protected function goInit():void{
if ((((action == "goInit")) && (_destination))){
this._isFree = true;
this.gotoFrame("standFront");
action = "settleAccounts";
cashierHide = true;
};
}
}
}//package element
Section 8
//GameObject (element.GameObject)
package element {
import flash.display.*;
public class GameObject extends Sprite {
protected var _vx:Number;// = 0
protected var _graphicsObject:MovieClip;
protected var _vy:Number;// = 0
protected var _frameName:String;// = ""
protected var _stage:DisplayObjectContainer;
public function GameObject(_arg1:Class){
if (_arg1 != null){
graphicsObject = _arg1;
};
}
public function gotoFrame(_arg1:String):void{
if ((_graphicsObject is MovieClip)){
if (this._frameName == _arg1){
return;
};
};
(this._graphicsObject as MovieClip).gotoAndStop(_arg1);
this._frameName = _arg1;
}
public function update():void{
this.x = (this.x + _vx);
this.y = (this.y + _vy);
}
public function set graphicsObject(_arg1:Class):void{
_graphicsObject = new (_arg1);
this.addChild(_graphicsObject);
_graphicsObject.mouseChildren = false;
}
public function setStage(_arg1:DisplayObjectContainer, _arg2:Number, _arg3:Number):void{
_arg1.addChild(this);
this.x = _arg2;
this.y = _arg3;
}
}
}//package element
Section 9
//Guest (element.Guest)
package element {
import flash.display.*;
import flash.events.*;
import game.*;
import util.*;
import flash.utils.*;
public class Guest extends Person {
public var roomDesX:Number;
private var _sayHello:Boolean;
public var roomDesY:Number;
public var waiteWaiter:Boolean;
private var _isSitHelloWaite:Boolean;
private var _location:String;
private var isaddMouseEvent:Boolean;
public var clothesNum:Number;
private var _changeLocation:Boolean;
public var roomNum:Number;
public var chairX:Number;
public var chairY:Number;
public var deskDesX:Number;
public var deskDesY:Number;
public var locationX:Number;
public var locationY:Number;
private var _isWaite:Boolean;
private var _isStandHelloWaite:Boolean;
private var _action:String;
public var getWaiter:Boolean;
private var _sitDown:Boolean;
public var chairStandX:Number;
public var chairDesX:Number;
public var chairDesY:Number;
public var clothesDesX:Number;
public var outDesX:Number;
public var outDesY:Number;
public var clothesDesY:Number;
public var chairStandY:Number;
private var _isGoOut:Boolean;
public static const GUEST_CLICK:String = "guest_click";
public static const ANGRY:String = "angry";
public static const COME_DOWN_WITH:String = "come_dowm_with";
public function Guest(_arg1:Class){
super(_arg1);
_graphicsObject.clothes_mc.visible = false;
}
private function isClick():void{
if (waiteWaiter){
addMouseEvent();
} else {
removeMouseEvent();
};
}
private function hideSelectClothes():void{
_graphicsObject.clothes_mc.visible = false;
}
public function set changeLocation(_arg1:Boolean):void{
_changeLocation = _arg1;
}
private function goSeeClothes():void{
var _local1:Timer;
if ((((_action == "goSeeClothes")) && ((_location == "chair")))){
this.gotoFrame("standFront");
isPrepareGo = true;
_location = "";
_action = "goClothes";
return;
};
if ((((((_action == "goClothes")) && ((this.x == clothesDesX)))) && ((this.y == clothesDesY)))){
trace("看衣服");
this.gotoFrame("seeClothes");
_action = "seeClothes";
_location = "clothes";
_isWaite = true;
locationX = clothesDesX;
locationY = clothesDesY;
if (_isWaite){
_isWaite = false;
_local1 = new Timer(8000, 1);
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, seeClothesWaite);
_local1.start();
};
};
}
private function removeMouseEvent():void{
if (isaddMouseEvent){
isaddMouseEvent = false;
this._graphicsObject.removeEventListener(MouseEvent.CLICK, guestClickHandler);
};
}
private function guestClickHandler(_arg1:MouseEvent):void{
trace("点击客人");
this.dispatchEvent(new StrEvent(GUEST_CLICK, this.name));
}
private function basicMove():void{
if (!isPrepareGo){
return;
};
if (this._frameName == "back"){
_vy = -(_moveSpeed);
_vx = 0;
} else {
if (this._frameName == "front"){
_vy = _moveSpeed;
_vx = 0;
} else {
if (this._frameName == "left"){
_vx = -(_moveSpeed);
_vy = 0;
} else {
if (this._frameName == "right"){
_vx = _moveSpeed;
_vy = 0;
} else {
_vx = 0;
_vy = 0;
};
};
};
};
if (_changeLocation){
_vx = 0;
_vy = 0;
};
if (((!((_vx == 0))) || (!((_vy == 0))))){
this._moveBool = true;
} else {
_moveBool = false;
};
}
public function get sitDown():Boolean{
return (_sitDown);
}
private function seeClothesWaite(_arg1:TimerEvent):void{
var _local2:Number = Math.floor((Math.random() * 2));
_isWaite = true;
if (_local2 == 0){
_action = "goRoom";
isPrepareGo = true;
} else {
_action = "buyClothes";
this.gotoFrame("settle");
};
}
private function addMouseEvent():void{
if (!isaddMouseEvent){
this._graphicsObject.addEventListener(MouseEvent.CLICK, guestClickHandler);
isaddMouseEvent = true;
};
}
public function get sayHello():Boolean{
return (_sayHello);
}
public function selectClothes(_arg1:Number):void{
_graphicsObject.clothes_mc.visible = true;
_graphicsObject.clothes_mc.gotoAndStop(_arg1);
clothesNum = _arg1;
clothesDesX = Game.clothesGuestLArr[(_arg1 - 1)].x;
clothesDesX = Game.clothesGuestLArr[(_arg1 - 1)].y;
}
private function chairWaiteCom(_arg1:TimerEvent):void{
_arg1.target.removeEventListener(TimerEvent.TIMER_COMPLETE, chairWaiteCom);
this.gotoFrame("sitHello");
_action = "sitAndHello";
_isSitHelloWaite = true;
}
private function chairWaiteCom1(_arg1:TimerEvent):void{
_arg1.target.removeEventListener(TimerEvent.TIMER_COMPLETE, chairWaiteCom1);
this.gotoFrame("standHelloAngry");
_action = "standAndHelloAngry";
_isStandHelloWaite = true;
}
override public function update():void{
super.update();
staticHandler();
basicMove();
isClick();
}
private function chairWaiteCom2(_arg1:TimerEvent):void{
_arg1.target.removeEventListener(TimerEvent.TIMER_COMPLETE, chairWaiteCom2);
_action = "angry";
}
private function comeDownWith():void{
if ((((this._frameName == "settle")) && (!((this._graphicsObject.p == null))))){
if ((this._graphicsObject.p as MovieClip).currentFrame == (this._graphicsObject.p as MovieClip).totalFrames){
this.dispatchEvent(new Event(ANGRY));
this.gotoFrame("standLeft");
};
};
}
private function angryHandler():void{
if ((((((this._frameName == "angryLeft")) || ((this._frameName == "angryRight")))) && (!((this._graphicsObject.p == null))))){
if ((this._graphicsObject.p as MovieClip).currentFrame == (this._graphicsObject.p as MovieClip).totalFrames){
this.dispatchEvent(new Event(ANGRY));
_isGoOut = true;
if (_frameName == "angryLeft"){
this.gotoFrame("standLeft");
} else {
this.gotoFrame("standRight");
};
};
};
}
public function set location(_arg1:String):void{
this._location = _arg1;
}
public function set action(_arg1:String):void{
this._action = _arg1;
}
private function sitDownAndHello():void{
if (this._frameName == "sitDown"){
_sitDown = true;
_sayHello = false;
} else {
if (this._frameName == "sitHello"){
_sitDown = true;
_sayHello = true;
} else {
if (this._frameName == "standHello"){
_sitDown = false;
_sayHello = true;
} else {
_sitDown = false;
_sayHello = false;
};
};
};
}
private function staticHandler():void{
var _local1:Timer;
var _local2:Timer;
var _local3:Number;
var _local4:Timer;
if ((((_location == "begin")) && ((_action == "chuchang")))){
this.gotoFrame("left");
_action = "goChair";
isPrepareGo = true;
Game.grid.setEndNode(Math.floor((chairDesX / Game._cellSize)), Math.floor((chairDesY / Game._cellSize)));
Game.grid.setStartNode(Math.floor((this.x / Game._cellSize)), Math.floor((this.y / Game._cellSize)));
findPath();
} else {
if ((((((_action == "goChair")) && ((this.x == chairDesX)))) && ((this.y == chairDesY)))){
trace("坐下");
this.gotoFrame("sitDown");
this.x = chairX;
this.y = chairY;
changeLocation = true;
_isWaite = true;
locationX = chairDesX;
locationY = chairDesY;
if (_isWaite){
_local1 = new Timer(2000, 1);
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, chairWaiteCom);
_local1.start();
_isWaite = false;
};
waiteWaiter = true;
} else {
if ((((_action == "sitAndHello")) && (_isSitHelloWaite))){
_local2 = new Timer(15000, 1);
_local2.addEventListener(TimerEvent.TIMER_COMPLETE, chairWaiteCom1);
_local2.start();
_isSitHelloWaite = true;
_action = "waiteWaiter";
_local3 = Math.floor(((Math.random() * 6) + 1));
this.selectClothes(_local3);
getWaiter = false;
} else {
if ((((((((_action == "waiteWaiter")) && (getWaiter))) && ((this.locationX == chairDesX)))) && ((locationY == chairDesY)))){
this.x = locationX;
this.y = locationY;
trace("去看衣服```````````````````````````");
clothesDesX = Game.clothesGuestLArr[(clothesNum - 1)].x;
clothesDesY = Game.clothesGuestLArr[(clothesNum - 1)].y;
_action = "goSeeClothes";
} else {
if ((((_action == "standAndHelloAngry")) && (_isStandHelloWaite))){
_isStandHelloWaite = false;
_local4 = new Timer(15000, 1);
_local4.addEventListener(TimerEvent.TIMER_COMPLETE, chairWaiteCom2);
_local4.start();
this.x = chairStandX;
this.y = chairStandY;
getWaiter = false;
} else {
if ((((_action == "angry")) && (_isGoOut))){
this.gotoFrame("right");
} else {
if ((((_action == "inRoom")) && (_isWaite))){
if ((((this.x == roomDesX)) && ((this.y == roomDesY)))){
this.visible = false;
};
} else {
if (_action == "buyClothes"){
_action = "goDesk";
isPrepareGo = true;
Game.grid.setEndNode(Math.floor((deskDesX / Game._cellSize)), Math.floor((deskDesY / Game._cellSize)));
Game.grid.setStartNode(Math.floor((this.x / Game._cellSize)), Math.floor((this.y / Game._cellSize)));
findPath();
} else {
if ((((((_action == "goDesk")) && ((this.x == deskDesX)))) && ((this.y == deskDesY)))){
trace("付钱");
this.gotoFrame("stand");
} else {
if ((((_action == "getClothes")) && (_isGoOut))){
_action = "goOut";
isPrepareGo = true;
Game.grid.setEndNode(Math.floor((Game.guestInitX / Game._cellSize)), Math.floor((Game.guestInitY / Game._cellSize)));
Game.grid.setStartNode(Math.floor((this.x / Game._cellSize)), Math.floor((this.y / Game._cellSize)));
findPath();
} else {
if ((((((_action == "goOut")) && (_isGoOut))) && ((this.x >= 710)))){
trace("人物离开准备删除人物");
_action = "removeGuest";
};
};
};
};
};
};
};
};
};
};
};
}
}
}//package element
Section 10
//GuestTwo (element.GuestTwo)
package element {
import flash.events.*;
import game.*;
import util.*;
import flash.utils.*;
import my.*;
public class GuestTwo extends Person {
public var roomDesX:Number;
public var outDesk:Boolean;
public var roomDesY:Number;
public var timeProgressNum:Number;
public var getDesk:Boolean;
public var getClothes:Boolean;
private var _location:String;
public var outChair:Boolean;
public var outClothes:Boolean;
private var changeClothesMaxNum:Number;// = 0
public var clothesNum:Number;
private var timeProgress:Timer;
public var chairX:Number;
public var chairY:Number;
public var locationY:Number;
private var _isWaite:Boolean;
public var outRoom:Boolean;
public var locationX:Number;
public var getRoom:Boolean;
private var timeArr:Array;
private var _action:String;
public var chairStandX:Number;
public var chairStandY:Number;
public var chairNum:Number;
private var lastX:Number;
private var lastY:Number;
private var isaddMouseEvent:Boolean;
public var waiteWaiter:Boolean;
private var timeAll:Timer;
public var guestNum:Number;
public var roomNum:Number;
public var clothesCurrentNum:Number;
public var deskDesX:Number;
public var deskDesY:Number;
public var getWaiter:Boolean;
public var room:Room;
public var waiter:WaiterTwo;
public var chairDesX:Number;
public var chairDesY:Number;
public var clothesDesX:Number;
public var clothesDesY:Number;
public var outDesX:Number;
public var outDesY:Number;
private var _isGoOut:Boolean;
public static const GUEST_CLICK:String = "guest_click";
public static const LEAVE_ROOM:String = "leave_room";
public static const LEAVE_CLOTHES:String = "leave_clothes";
public static const ANGRY:String = "angry";
public static const COME_DOWN_WITH:String = "come_dowm_with";
public static const LEAVE_CHAIR:String = "leave_chair";
public function GuestTwo(_arg1:Class){
timeArr = new Array();
super(_arg1);
_graphicsObject.display_mc.visible = false;
_graphicsObject.time_mc.gotoAndStop(1);
_graphicsObject.time_mc.visible = false;
}
private function tryClothesOut(_arg1:TimerEvent):void{
var _local4:Number;
var _local5:Timer;
var _local6:Timer;
var _local2:Timer = (_arg1.target as Timer);
removeTime(_local2);
room.person_mc.visible = false;
room.hunsha_mc.visible = false;
this.visible = true;
this.waiteWaiter = true;
var _local3:Number = Math.floor((Math.random() * 2));
if ((((((GameData.gameLevel == 1)) && ((this.name == "guest2")))) && (GameStage.isCeShi))){
_local3 = 1;
};
if (((((!((GameStage.clickPointOut == null))) && (!(GameStage.firstClickArr[4])))) && ((_local3 == 1)))){
GameStage.showPointOut(this.x, (this.y - 120), 5);
GameStage.firstClickArr[4] = true;
GameStage.clickPointOut.name = this.name;
} else {
if (((((!((GameStage.clickPointOut == null))) && (!(GameStage.firstClickArr[2])))) && ((_local3 == 0)))){
GameStage.showPointOut(300, 250, 3);
GameStage.firstClickArr[2] = true;
GameStage.clickPointOut.name = this.name;
};
};
_graphicsObject.display_mc.visible = true;
if (changeClothesMaxNum >= 3){
_local3 = 0;
};
if ((((((GameData.gameLevel == 1)) && ((this.name == "guest2")))) && (GameStage.isCeShi))){
trace("强制改变数据");
changeClothesMaxNum = 2;
};
if (_local3 == 1){
_action = "changeClothes";
this.gotoFrame("standHello");
_local4 = Math.floor(((Math.random() * 6) + 1));
while (_local4 == clothesNum) {
_local4 = Math.floor(((Math.random() * 6) + 1));
};
if ((((((GameData.gameLevel == 1)) && ((this.name == "guest2")))) && (GameStage.isCeShi))){
trace("强制改变要变化的衣服数据::");
_local4 = 1;
};
this.selectClothes(_local4);
changeClothesMaxNum++;
if (this.waiter == null){
MySound.playSpecialSound("waitress");
} else {
MySound.playSpecialSound("mayITryOn");
};
if (GameStage.isCeShi){
return;
};
_local5 = new Timer(500, 20);
_local5.addEventListener(TimerEvent.TIMER_COMPLETE, standAngryHello);
_local5.start();
timeArr.push(_local5);
} else {
_action = "prepareBuyClothes";
MySound.playSpecialSound("buyThis");
if (waiter == null){
waiteWaiter = true;
_graphicsObject.display_mc.gotoAndStop(14);
this.gotoFrame("settle");
} else {
waiteWaiter = false;
_action = "prepareGoDesk";
this.gotoFrame("standHello");
_graphicsObject.display_mc.visible = false;
return;
};
if (GameStage.isCeShi){
return;
};
_local6 = new Timer(500, 40);
_local6.addEventListener(TimerEvent.TIMER_COMPLETE, prepareGoOut);
_local6.start();
timeArr.push(_local6);
};
trace(("尝试完衣服出来" + waiter));
this.startTimeProgress();
}
private function tryClothes(_arg1:TimerEvent):void{
var _local2:Timer = (_arg1.target as Timer);
_graphicsObject.display_mc.visible = false;
removeTime(_local2);
_action = "tryClothes";
room.gotoAndStop(2);
room.person_mc.gotoAndStop(this.guestNum);
room.hunsha_mc.gotoAndStop(this.clothesCurrentNum);
room.person_mc.visible = true;
room.hunsha_mc.visible = true;
var _local3:Timer = new Timer(500, 4);
_local3.addEventListener(TimerEvent.TIMER_COMPLETE, tryClothesOut);
_local3.start();
timeArr.push(_local3);
MySound.playSpecialSound("menMian");
}
private function seeClothesWaite(_arg1:TimerEvent):void{
var _local4:Timer;
var _local2:Number = Math.floor((Math.random() * 2));
if ((((((GameData.gameLevel == 1)) && ((this.name == "guest1")))) && (GameStage.isCeShi))){
_local2 = 1;
trace("强制改变数据");
};
if ((((((GameData.gameLevel == 1)) && ((this.name == "guest2")))) && (GameStage.isCeShi))){
_local2 = 0;
trace("强制改变数据");
};
if (((((((!((GameStage.clickPointOut == null))) && (!(GameStage.firstClickArr[2])))) && ((_local2 == 1)))) && (GameStage.isCeShi))){
} else {
if (((((((!((GameStage.clickPointOut == null))) && (!(GameStage.firstClickArr[3])))) && ((_local2 == 0)))) && (GameStage.isCeShi))){
GameStage.clickMc.rotation = 90;
GameStage.showPointOut(180, 120, 4);
GameStage.firstClickArr[3] = true;
GameStage.clickPointOut.name = this.name;
};
};
if (_local2 == 0){
_action = "prepareGoRoom";
this.gotoFrame("standHello");
_graphicsObject.display_mc.visible = true;
_graphicsObject.display_mc.gotoAndStop(13);
if (this.waiter == null){
MySound.playSpecialSound("waitress");
} else {
MySound.playSpecialSound("mayITryOn");
};
} else {
_action = "prepareBuyClothes";
MySound.playSpecialSound("buyThis");
if (waiter != null){
_action = "prepareGoDesk";
return;
};
this.gotoFrame("settle");
_graphicsObject.display_mc.visible = true;
_graphicsObject.display_mc.gotoAndStop(14);
};
waiteWaiter = true;
var _local3:Timer = (_arg1.target as Timer);
removeTime(_local3);
if (GameStage.isCeShi){
return;
};
if (_action == "prepareBuyClothes"){
_local4 = new Timer(500, 40);
_local4.addEventListener(TimerEvent.TIMER_COMPLETE, prepareGoOut);
} else {
if (_action == "prepareGoRoom"){
_local4 = new Timer(500, 20);
_local4.addEventListener(TimerEvent.TIMER_COMPLETE, standAngryHello);
};
};
_local4.start();
timeArr.push(_local4);
this.startTimeProgress();
}
public function pauseGame():void{
var _local1:int;
trace(timeArr.length);
if (timeArr.length <= 0){
return;
};
_local1 = 0;
while (_local1 < timeArr.length) {
timeArr[_local1].stop();
_local1++;
};
if (timeProgress != null){
timeProgress.stop();
};
}
private function basicMove():void{
if (!isPrepareGo){
return;
};
if (this._frameName == "back"){
_vy = -(_moveSpeed);
_vx = 0;
} else {
if (this._frameName == "front"){
_vy = _moveSpeed;
_vx = 0;
} else {
if (this._frameName == "left"){
_vx = -(_moveSpeed);
_vy = 0;
} else {
if (this._frameName == "right"){
_vx = _moveSpeed;
_vy = 0;
} else {
if (_frameName == "happyOut"){
_vx = _moveSpeed;
_vy = 0;
} else {
_vx = 0;
_vy = 0;
};
};
};
};
};
if (((!((_vx == 0))) || (!((_vy == 0))))){
this._moveBool = true;
} else {
_moveBool = false;
};
}
private function standAngryHello(_arg1:TimerEvent):void{
this.gotoFrame("standHelloAngry");
var _local2:Timer = (_arg1.target as Timer);
_local2.stop();
removeTime(_local2);
var _local3:Timer = new Timer(500, 20);
_local3.addEventListener(TimerEvent.TIMER_COMPLETE, prepareGoOut);
_local3.start();
timeArr.push(_local3);
}
public function againSelectClothes():void{
var _local1:Number = Math.floor(((Math.random() * 6) + 1));
while (_local1 == clothesNum) {
_local1 = Math.floor(((Math.random() * 6) + 1));
};
this.selectClothes(_local1);
this.stopTime();
}
private function isHaveWaiter():Boolean{
if (this.waiter == null){
return (false);
};
if (((((!((waiter == null))) && ((this.getWaiter == false)))) && (!((this.waiter.severGuest == this))))){
waiter = null;
return (false);
};
return (true);
}
public function get action():String{
return (_action);
}
public function continueGame():void{
var _local1:int;
if (timeArr.length <= 0){
return;
};
_local1 = 0;
while (_local1 < timeArr.length) {
timeArr[_local1].start();
_local1++;
};
if (timeProgress != null){
timeProgress.start();
};
}
private function goOutHandler():void{
if (_action == "removeGuest"){
return;
};
if ((((_action == "goOut")) && (!((this._frameName == "happyOut"))))){
MySound.playSpecialSound("goodBye");
trace("离开");
this.waiteWaiter = false;
if ((((locationX == chairDesX)) && ((locationY == chairDesY)))){
this.x = locationX;
this.y = locationY;
};
_action = "out";
isPrepareGo = true;
Game.grid.setEndNode(Math.floor((Game.guestInitX / Game._cellSize)), Math.floor((Game.guestInitY / Game._cellSize)));
Game.grid.setStartNode(Math.floor((this.x / Game._cellSize)), Math.floor((this.y / Game._cellSize)));
findPath();
} else {
if ((((this._frameName == "happyOut")) && ((_action == "goOut")))){
trace("买着衣服高兴离开");
_action = "out";
isPrepareGo = true;
this.waiteWaiter = false;
waiter = null;
};
};
if ((((_action == "out")) && ((this.x >= 700)))){
trace("人物离开准备删除人物");
_action = "removeGuest";
isPrepareGo = false;
};
}
private function goDeskSettle():void{
var _local1:Timer;
var _local2:Number;
var _local3:Number;
var _local4:AddGoldMoney;
if (((outDesk) || ((this._frameName == "happyOut")))){
return;
};
if ((((((this._action == "prepareGoDesk")) && (getWaiter))) && (!((waiter == null))))){
if (((!((GameStage.clickPointOut == null))) && ((GameStage.clickPointOut.name == this.name)))){
GameStage.hidePointOut();
};
if (this._location == "room"){
if (room != null){
room.gotoAndStop(2);
room.isHaveGuest = false;
room = null;
};
this.dispatchEvent(new Event(LEAVE_ROOM));
outRoom = true;
} else {
if (this._location == "clothes"){
this.dispatchEvent(new Event(LEAVE_CLOTHES));
outClothes = true;
};
};
deskDesX = Game.deskGuestX;
deskDesY = Game.deskGuestY;
this._action = "goDesk";
isPrepareGo = true;
waiteWaiter = false;
_location = "";
trace("准备去付钱");
this.stopTime();
Game.grid.setEndNode(Math.floor((deskDesX / Game._cellSize)), Math.floor((deskDesY / Game._cellSize)));
Game.grid.setStartNode(Math.floor((this.x / Game._cellSize)), Math.floor((this.y / Game._cellSize)));
findPath();
_graphicsObject.display_mc.visible = false;
this.removeTimeProgress();
} else {
if ((((_action == "goDesk")) && (this._destination))){
MySound.playSpecialSound("print");
getDesk = true;
this._action = "getDeskWaiteClothes";
_location = "desk";
locationX = deskDesX;
locationY = deskDesY;
_graphicsObject.display_mc.visible = false;
this.gotoFrame("settleStand");
if (((!(GameStage._gameInterface.isSettleAccounts)) && (!(GameStage._gameInterface.desk_mc.isHaveGuest)))){
_local1 = new Timer(200, 5);
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, waiteClothes);
_local1.start();
timeArr.push(_local1);
GameStage._gameInterface.desk_mc.isHaveGuest = true;
GameStage._gameInterface.collectMoney();
if (GameStage.isCeShi){
return;
};
_local2 = GameData.clothesSellPriceArr[(this.clothesCurrentNum - 1)];
_local3 = GameData.clothesInitPriceArr[(this.clothesCurrentNum - 1)];
_local4 = new AddGoldMoney(_local2, GameStage._gameInterface, (this.x + 20), (this.y - 80));
GameData.sellGold = (GameData.sellGold + _local2);
GameData.sellInitGold = (GameData.sellInitGold + _local3);
GameStage.addMoneyArr.push(_local4);
trace(((("卖的衣服的价格::" + _local2) + ",") + _local3));
} else {
trace("到达桌子边是否需要等待前面的客人先付钱结束");
_action = "waiteSettleAccounts";
};
};
};
}
public function set action(_arg1:String):void{
this._action = _arg1;
}
private function removeTime(_arg1:Timer):void{
var _local2:int;
while (_local2 < timeArr.length) {
if (timeArr[_local2] == _arg1){
timeArr.splice(_local2, 1);
};
_local2++;
};
}
private function addMouseEvent():void{
if (!isaddMouseEvent){
this._graphicsObject.mouseChildren = false;
this._graphicsObject.addEventListener(MouseEvent.CLICK, guestClickHandler);
isaddMouseEvent = true;
};
}
public function set location(_arg1:String):void{
this._location = _arg1;
}
private function goSeeClothes():void{
var _local1:Timer;
if (outClothes){
return;
};
if ((((((((_action == "prepareGoClothes")) && ((_location == "chair")))) && (!((waiter == null))))) && (getWaiter))){
if (((!((GameStage.clickPointOut == null))) && ((GameStage.clickPointOut.name == this.name)))){
GameStage.hidePointOut();
};
this.gotoFrame("standFront");
this.x = locationX;
this.y = locationY;
waiter.severGuest = this;
isPrepareGo = true;
_location = "";
_action = "goClothes";
trace("``````从椅子边去衣服");
waiteWaiter = false;
this.stopTime();
Game.grid.setEndNode(Math.floor((clothesDesX / Game._cellSize)), Math.floor((clothesDesY / Game._cellSize)));
Game.grid.setStartNode(Math.floor((this.x / Game._cellSize)), Math.floor((this.y / Game._cellSize)));
findPath();
this.dispatchEvent(new Event(LEAVE_CHAIR));
_graphicsObject.display_mc.visible = false;
outChair = true;
} else {
if ((((_action == "goClothes")) && (this._destination))){
trace("看衣服");
this.gotoFrame("seeClothes");
_action = "seeClothes";
_location = "clothes";
locationX = clothesDesX;
locationY = clothesDesY;
_graphicsObject.display_mc.visible = false;
_local1 = new Timer(8000, 1);
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, seeClothesWaite);
_local1.start();
timeArr.push(_local1);
};
};
}
private function isClick():void{
if (getDesk){
return;
};
if (((((waiteWaiter) && ((isHaveWaiter() == false)))) && (!((this._action == "changeClothes"))))){
addMouseEvent();
this.buttonMode = true;
} else {
removeMouseEvent();
this.buttonMode = false;
};
}
private function prepareGoOut(_arg1:TimerEvent):void{
_arg1.target.stop();
_arg1.target.removeEventListener(TimerEvent.TIMER_COMPLETE, prepareGoOut);
this._action = "goOut";
var _local2:Timer = (_arg1.target as Timer);
removeTime(_local2);
this.waiteWaiter = false;
this._graphicsObject.display_mc.visible = false;
if (_location == "chair"){
this.x = chairDesX;
this.y = chairDesY;
outChair = true;
this.dispatchEvent(new Event(LEAVE_CHAIR));
} else {
if (this.location == "clothes"){
outClothes = true;
this.dispatchEvent(new Event(LEAVE_CLOTHES));
} else {
if (this.location == "room"){
if (room != null){
room.gotoAndStop(2);
room.isHaveGuest = false;
room = null;
};
outRoom = true;
this.dispatchEvent(new Event(LEAVE_ROOM));
} else {
if (this.location == "desk"){
trace("离开收银台");
};
};
};
};
hideSelectClothes();
if (this.waiter != null){
trace("如果服务员身边有服务员,客人走了,服务员也回到初始化位置");
this.waiter.isHaveGuest = false;
waiter.action = "goInit";
waiter.goInitLocation();
waiter = null;
};
outChair = true;
outDesk = true;
outRoom = true;
outClothes = true;
this.removeTimeProgress();
if (((!((GameStage.clickPointOut == null))) && ((GameStage.clickPointOut.name == this.name)))){
GameStage.hidePointOut();
};
}
public function hideSelectClothes():void{
}
public function beginTryClothes():void{
GameStage._gameInterface.roomArr[(roomNum - 1)].gotoAndStop(1);
_action = "tryClothes";
this.gotoFrame("stand");
this.visible = false;
var _local1:Timer = new Timer(5000, 1);
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, tryClothes);
_local1.start();
timeArr.push(_local1);
MySound.playSpecialSound("menMian");
}
private function waiteClothes(_arg1:TimerEvent):void{
var _local2:Timer = (_arg1.target as Timer);
removeTime(_local2);
this.gotoFrame("happyOut");
isPrepareGo = true;
trace("提着衣服离开");
_action = "goOut";
if (GameData.waiterNum < 1){
this.waiter.isFree = true;
this.waiter.severGuest = null;
this.waiter = null;
};
GameStage._gameInterface.stopDeskWoman();
GameStage._gameInterface.desk_mc.isHaveGuest = false;
MySound.playSpecialSound("ok");
}
private function guestClickHandler(_arg1:MouseEvent):void{
if (((!((waiter == null))) && (!((this._action == "changeClothes"))))){
trace("已经有个服务员在身边了,可以直接进行相应的事情");
return;
};
if (((((!((waiter == null))) && ((this._action == "changeClothes")))) && (waiteWaiter))){
waiter.action = "beginFindGuest";
return;
};
trace(((("点击客人" + this.waiter) + "`````") + this.waiteWaiter));
this.dispatchEvent(new GuestEvent(GUEST_CLICK, this.name, this));
}
private function startTimeProgress():void{
timeProgressNum = 0;
_graphicsObject.time_mc.visible = true;
_graphicsObject.time_mc.gotoAndStop(1);
timeProgress = new Timer(500);
timeProgress.addEventListener(TimerEvent.TIMER, timeProgressHandler);
timeProgress.start();
}
private function removeMouseEvent():void{
if (isaddMouseEvent){
this._graphicsObject.mouseChildren = false;
isaddMouseEvent = false;
this._graphicsObject.removeEventListener(MouseEvent.CLICK, guestClickHandler);
};
}
public function selectClothes(_arg1:Number):void{
clothesNum = _arg1;
clothesDesX = Game.clothesGuestLArr[(_arg1 - 1)].x;
clothesDesX = Game.clothesGuestLArr[(_arg1 - 1)].y;
this.clothesCurrentNum = GameStage._gameInterface.yifuArr[(_arg1 - 1)].currentFrame;
_graphicsObject.display_mc.gotoAndStop(clothesCurrentNum);
_graphicsObject.display_mc.visible = true;
trace(("当前选择衣服的帧号" + clothesCurrentNum));
}
public function get location():String{
return (_location);
}
private function chairWaiteCom(_arg1:TimerEvent):void{
_arg1.target.removeEventListener(TimerEvent.TIMER_COMPLETE, chairWaiteCom);
this.gotoFrame("sitHello");
_action = "sitAndHello";
waiteWaiter = true;
var _local2:Timer = (_arg1.target as Timer);
removeTime(_local2);
}
private function removeTimeProgress():void{
if (timeProgress != null){
timeProgress.stop();
timeProgress.removeEventListener(TimerEvent.TIMER, timeProgressHandler);
timeProgress = null;
_graphicsObject.time_mc.visible = false;
_graphicsObject.time_mc.gotoAndStop(1);
};
}
override public function update():void{
super.update();
staticHandler();
basicMove();
isClick();
goSeeClothes();
goRoomHandler();
goDeskSettle();
goOutHandler();
waiteSettleHandler();
}
private function waiteSettleHandler():void{
var _local1:Timer;
var _local2:Number;
var _local3:Number;
var _local4:AddGoldMoney;
if (_action != "waiteSettleAccounts"){
return;
};
if ((((((_action == "waiteSettleAccounts")) && (!(GameStage._gameInterface.isSettleAccounts)))) && (!(GameStage._gameInterface.desk_mc.isHaveGuest)))){
GameStage._gameInterface.collectMoney();
GameStage._gameInterface.desk_mc.isHaveGuest = true;
this._action = "getDeskWaiteClothes";
_local1 = new Timer(200, 5);
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, waiteClothes);
_local1.start();
timeArr.push(_local1);
_local2 = GameData.clothesSellPriceArr[(this.clothesCurrentNum - 1)];
_local3 = GameData.clothesInitPriceArr[(this.clothesCurrentNum - 1)];
trace("轮流到等待的客人付钱");
_local4 = new AddGoldMoney(_local2, GameStage._gameInterface, this.x, (this.y - 80));
GameData.sellGold = (GameData.sellGold + _local2);
GameData.sellInitGold = (GameData.sellInitGold + _local3);
GameStage.addMoneyArr.push(_local4);
};
}
private function timeProgressHandler(_arg1:TimerEvent):void{
timeProgressNum++;
if ((timeProgressNum % 2) == 0){
_graphicsObject.time_mc.nextFrame();
};
}
private function goRoomHandler():void{
if (outRoom){
return;
};
if ((((((this._action == "beginGoRoom")) && (getWaiter))) && (!((this.waiter == null))))){
if (((!((GameStage.clickPointOut == null))) && ((GameStage.clickPointOut.name == this.name)))){
GameStage.hidePointOut();
};
roomDesX = Game.roomLArr[(roomNum - 1)].x;
roomDesY = Game.roomLArr[(roomNum - 1)].y;
isPrepareGo = true;
waiteWaiter = false;
_location = "";
_action = "goRoom";
trace("从衣服边去试衣间");
this.stopTime();
Game.grid.setEndNode(Math.floor((roomDesX / Game._cellSize)), Math.floor((roomDesY / Game._cellSize)));
Game.grid.setStartNode(Math.floor((this.x / Game._cellSize)), Math.floor((this.y / Game._cellSize)));
findPath();
this.dispatchEvent(new Event(LEAVE_CLOTHES));
_graphicsObject.display_mc.visible = false;
outClothes = true;
this.removeTimeProgress();
} else {
if ((((_action == "goRoom")) && (this._destination))){
this._action = "getRoom";
_location = "room";
locationX = roomDesX;
locationY = roomDesY;
beginTryClothes();
_graphicsObject.display_mc.visible = false;
};
};
}
public function stopTime():void{
var _local1:int;
if (timeArr.length == 0){
return;
};
if (timeArr.length > 0){
_local1 = (timeArr.length - 1);
while (_local1 >= 0) {
(timeArr[_local1] as Timer).stop();
timeArr.splice(_local1);
_local1--;
};
};
timeArr = [];
this.removeTimeProgress();
}
private function staticHandler():void{
var _local1:Number;
var _local2:Timer;
var _local3:Number;
if (outChair){
return;
};
if ((((_location == "begin")) && ((_action == "chuchang")))){
this.gotoFrame("left");
_action = "goChair";
isPrepareGo = true;
Game.grid.setEndNode(Math.floor((chairDesX / Game._cellSize)), Math.floor((chairDesY / Game._cellSize)));
Game.grid.setStartNode(Math.floor((this.x / Game._cellSize)), Math.floor((this.y / Game._cellSize)));
findPath();
} else {
if ((((((_action == "goChair")) && ((this.x == chairDesX)))) && ((this.y == chairDesY)))){
trace("坐下");
_graphicsObject.display_mc.visible = false;
this.gotoFrame("sitDown");
_location = "chair";
this.x = chairX;
this.y = (chairY + 2);
_action = "sitDown";
locationX = chairDesX;
locationY = chairDesY;
_action = "sitAndHello";
waiteWaiter = true;
this.gotoFrame("sitHello");
_local1 = Math.floor((Math.random() * 2));
if (_local1 == 0){
MySound.playSpecialSound("hello");
} else {
MySound.playSpecialSound("helloTwo");
};
} else {
if ((((((_action == "sitAndHello")) && (waiteWaiter))) && (!(getWaiter)))){
_graphicsObject.display_mc.visible = false;
if (((!((GameStage.clickPointOut == null))) && (!(GameStage.firstClickArr[0])))){
GameStage.showPointOut(chairX, (chairY - 60), 1);
GameStage.firstClickArr[0] = true;
GameStage.clickPointOut.name = this.name;
};
if (GameStage.isCeShi){
return;
};
_local2 = new Timer(500, 20);
_local2.addEventListener(TimerEvent.TIMER_COMPLETE, standAngryHello);
_local2.start();
_action = "prepareStandHello";
timeArr.push(_local2);
this.startTimeProgress();
} else {
if ((((((((((_frameName == "standHelloAngry")) && (waiteWaiter))) && (!(getWaiter)))) && (!(outChair)))) && ((location == "chair")))){
this.x = chairStandX;
this.y = chairStandY;
_graphicsObject.display_mc.visible = false;
} else {
if (((((((getWaiter) && (!(outChair)))) && (!((_action == "waiteClickClothes"))))) && (!((_action == "prepareGoClothes"))))){
stopTime();
waiteWaiter = true;
_local3 = Math.floor(((Math.random() * 6) + 1));
if (GameStage.isCeShi){
_local3 = 2;
};
this.selectClothes(_local3);
_graphicsObject.display_mc.visible = true;
this.gotoFrame("stand");
this.x = chairX;
this.y = (chairY + 2);
trace("等待去看衣服```````````````````````````");
clothesDesX = Game.clothesGuestLArr[(clothesNum - 1)].x;
clothesDesY = Game.clothesGuestLArr[(clothesNum - 1)].y;
_action = "waiteClickClothes";
this.removeTimeProgress();
if ((((GameStage.isCeShi == false)) && ((GameStage.clickPointOut == null)))){
return;
};
if (((!((GameStage.clickPointOut == null))) && ((GameStage.clickPointOut.name == this.name)))){
GameStage.hidePointOut();
};
if (((!((GameStage.clickPointOut == null))) && (!(GameStage.firstClickArr[1])))){
GameStage.showPointOut((clothesDesX - 30), (clothesDesY - 120), 2);
GameStage.firstClickArr[1] = true;
GameStage.clickPointOut.name = this.name;
};
};
};
};
};
};
}
}
}//package element
Section 11
//Person (element.Person)
package element {
import util.astar.*;
import game.*;
public class Person extends GameObject {
public var path:Array;
public var isPrepareGo:Boolean;
protected var _destination:Boolean;
protected var _index:Number;
protected var _moveSpeed:Number;// = 5
public var _moveBool:Boolean;
public function Person(_arg1:Class){
super(_arg1);
}
protected function go():void{
var _local1:Number = ((path[_index].x * Game._cellSize) + (Game._cellSize / 2));
var _local2:Number = ((path[_index].y * Game._cellSize) + (Game._cellSize / 2));
var _local3:Number = (this.x - _local1);
var _local4:Number = (this.y - _local2);
var _local5:Number = Math.sqrt(((_local3 * _local3) + (_local4 * _local4)));
if (_local3 > 5){
this.gotoFrame("left");
} else {
if (_local3 < -5){
this.gotoFrame("right");
} else {
this.x = _local1;
};
};
if (_local4 > 5){
this.gotoFrame("back");
} else {
if (_local4 < -5){
this.gotoFrame("front");
} else {
this.y = _local2;
};
};
if (_local5 <= 5){
this.x = _local1;
this.y = _local2;
_index++;
if (_index >= path.length){
isPrepareGo = false;
path = null;
trace("找到目的地");
_destination = true;
};
};
}
override public function update():void{
if (!isPrepareGo){
return;
};
this.x = (this.x + _vx);
this.y = (this.y + _vy);
if (((isPrepareGo) && (!((path == null))))){
go();
};
}
protected function findPath():void{
var _local1:AStar = new AStar();
if (_local1.findPath(Game.grid)){
path = _local1.path;
_index = 0;
trace("开始寻路");
_destination = false;
};
}
}
}//package element
Section 12
//WaiterTwo (element.WaiterTwo)
package element {
import flash.display.*;
import flash.events.*;
import game.*;
import util.*;
import my.*;
public class WaiterTwo extends Person {
protected var _isHaveGuest:Boolean;
protected var toGuest:Boolean;
private var isHaveClothes:Boolean;
protected var _isPrepareSever:Boolean;
private var locationX:Number;
private var locationY:Number;
public var action:String;// = ""
private var initX:Number;
private var initY:Number;
protected var _isFree:Boolean;
public var isDesk:Boolean;
protected var _severGuest:GuestTwo;
public var isChangeClothes:Boolean;
public function WaiterTwo(_arg1:Class){
super(_arg1);
this._graphicsObject.display_mc.visible = false;
this.addEventListener(MouseEvent.CLICK, waiterClick);
}
public function set isHaveGuest(_arg1:Boolean):void{
_isHaveGuest = _arg1;
}
protected function getDesk():void{
freeStatic();
this._severGuest = null;
_isHaveGuest = false;
var _local1:int;
while (_local1 < GameStage._gameInterface.waiterArr.length) {
if (GameStage._gameInterface.waiterArr[_local1].isDesk){
GameStage._gameInterface.waiterArr[_local1].prepareGoInit();
};
_local1++;
};
isDesk = true;
}
public function set severGuest(_arg1:GuestTwo):void{
_severGuest = _arg1;
}
protected function goInit():void{
if ((((action == "goInit")) && (_destination))){
this._isFree = true;
this.gotoFrame("standFront");
action = "waite";
_severGuest = null;
_isHaveGuest = false;
};
}
protected function getClothes():void{
trace("服务员到达衣服边");
if (_severGuest.action != "haveChangeClothes"){
this.freeStatic();
} else {
if (action != "goRoom"){
this.goRoom();
this.isHaveClothes = true;
};
};
}
protected function basicMove():void{
if ((((this._frameName == "back")) || ((this._frameName == "thingBack")))){
_vy = -(_moveSpeed);
_vx = 0;
} else {
if ((((this._frameName == "front")) || ((this._frameName == "thingFront")))){
_vy = _moveSpeed;
_vx = 0;
} else {
if ((((this._frameName == "left")) || ((this._frameName == "thingLeft")))){
_vx = -(_moveSpeed);
_vy = 0;
} else {
if ((((this._frameName == "right")) || ((this._frameName == "thingRight")))){
_vx = _moveSpeed;
_vy = 0;
} else {
_vx = 0;
_vy = 0;
};
};
};
};
if (((!((_vx == 0))) || (!((_vy == 0))))){
this._moveBool = true;
} else {
_moveBool = false;
};
}
private function goDesk():void{
_destination = false;
isPrepareGo = true;
this.action = "goDesk";
Game.grid.setEndNode(Math.floor((Game.deskWaiterX / Game._cellSize)), Math.floor((Game.deskWaiterY / Game._cellSize)));
Game.grid.setStartNode(Math.floor((this.x / Game._cellSize)), Math.floor((this.y / Game._cellSize)));
findPath();
trace("带客人去付钱");
_isFree = false;
}
private function findGuest():void{
_severGuest.getWaiter = true;
_severGuest.continueGame();
this.freeStatic();
this.gotoFrame("standRight");
if (_severGuest.location == "chair"){
this.gotoFrame("standBack");
locationX = this.x;
locationY = this.y;
this.x = _severGuest.chairStandX;
this.y = (_severGuest.chairStandY + 8);
};
if (_severGuest.action == "prepareBuyClothes"){
_severGuest.action = "prepareGoDesk";
} else {
MySound.playSpecialSound("mayIHelpYou");
};
}
protected function handlerGuest():void{
if ((((((_severGuest == null)) || (!(_isHaveGuest)))) || ((action == "")))){
return;
};
if (_isHaveGuest){
if (((((((_severGuest.waiteWaiter) && ((action == "beginFindGuest")))) && (!(isPrepareGo)))) && (_isFree))){
lookForGuest();
} else {
if ((((action == "goFindGuest")) && (_destination))){
trace("找到需要寻找的客人");
findGuest();
} else {
if ((((action == "goClothes")) && (_destination))){
getClothes();
if (_severGuest.action == "goClothes"){
action = "getToClothes";
};
} else {
if ((((_severGuest.action == "goClothes")) && (!(isPrepareGo)))){
if (this.action == "getToClothes"){
return;
};
this.x = locationX;
this.y = locationY;
goClothes();
} else {
if ((((_severGuest.action == "goDesk")) && (!(isPrepareGo)))){
goDesk();
} else {
if ((((action == "goDesk")) && (_destination))){
getDesk();
} else {
if ((((((_severGuest.action == "goRoom")) && (!(isPrepareGo)))) && (!((this.action == "goRoom"))))){
goRoom();
this.isHaveClothes = true;
} else {
if ((((action == "goRoom")) && (_destination))){
getRoom();
trace("服务员到达房间边");
};
};
};
};
};
};
};
};
};
}
public function get destination():Boolean{
return (_destination);
}
public function get isFree():Boolean{
return (_isFree);
}
override public function setStage(_arg1:DisplayObjectContainer, _arg2:Number, _arg3:Number):void{
_arg1.addChild(this);
this.x = _arg2;
this.y = _arg3;
initX = _arg2;
initY = _arg3;
}
protected function goClothes():void{
trace("服务员去衣服边");
_destination = false;
_isFree = false;
isPrepareGo = true;
action = "goClothes";
var _local1:Number = Game.clothesWaiterLArr[(_severGuest.clothesNum - 1)].x;
var _local2:Number = Game.clothesWaiterLArr[(_severGuest.clothesNum - 1)].y;
Game.grid.setEndNode(Math.floor((_local1 / Game._cellSize)), Math.floor((_local2 / Game._cellSize)));
Game.grid.setStartNode(Math.floor((this.x / Game._cellSize)), Math.floor((this.y / Game._cellSize)));
findPath();
}
public function get severGuest():GuestTwo{
return (_severGuest);
}
public function get isHaveGuest():Boolean{
return (_isHaveGuest);
}
protected function lookForGuest():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
if (((((((_severGuest.waiteWaiter) && ((action == "beginFindGuest")))) && (!(isPrepareGo)))) && (_isFree))){
trace(((("```````````````````````````````````````````````````````````服务员找寻找客人 " + this.action) + "```````") + this.severGuest));
isDesk = false;
if (_severGuest.action == "haveChangeClothes"){
trace("为要重新换衣服的客人去拿衣服");
goClothes();
_severGuest.stopTime();
_severGuest.waiteWaiter = false;
_isFree = false;
if ((((GameData.gameLevel == 1)) && (!((GameStage.clickPointOut == null))))){
GameStage.hidePointOut();
};
return;
};
action = "goFindGuest";
isPrepareGo = true;
_isFree = false;
_severGuest.pauseGame();
_local1 = (Math.floor((_severGuest.locationX / Game._cellSize)) - 1);
_local2 = Math.floor((_severGuest.locationY / Game._cellSize));
if (_severGuest.location == "chair"){
_local1 = (_local1 + 1);
};
_local3 = Math.floor((this.x / Game._cellSize));
_local4 = Math.floor((this.y / Game._cellSize));
this.x = ((_local3 * Game._cellSize) + (Game._cellSize / 2));
this.y = ((_local4 * Game._cellSize) + (Game._cellSize / 2));
Game.grid.setStartNode(_local3, _local4);
Game.grid.setEndNode(_local1, _local2);
findPath();
};
}
override public function update():void{
super.update();
basicMove();
handlerGuest();
goInit();
}
private function getRoom():void{
freeStatic();
this.isHaveClothes = false;
trace(((("服务员到达房间边" + _severGuest) + ",,,,") + this._isFree));
if (_severGuest.action == "haveChangeClothes"){
_severGuest.beginTryClothes();
_severGuest.hideSelectClothes();
_severGuest.getWaiter = true;
trace("客人要换衣服,服务员带着衣服到达房间边");
};
}
private function waiterClick(_arg1:MouseEvent):void{
trace(((((((((("该服务员的动作是::" + this.action) + "``````") + this._destination) + "```") + _severGuest) + "```") + _isHaveGuest) + "```") + _isFree));
}
override protected function go():void{
var _local1:Number = ((path[_index].x * Game._cellSize) + (Game._cellSize / 2));
var _local2:Number = ((path[_index].y * Game._cellSize) + (Game._cellSize / 2));
var _local3:Number = (this.x - _local1);
var _local4:Number = (this.y - _local2);
var _local5:Number = Math.sqrt(((_local3 * _local3) + (_local4 * _local4)));
if (_local3 > 5){
if (isHaveClothes){
this.gotoFrame("thingLeft");
} else {
this.gotoFrame("left");
};
} else {
if (_local3 < -5){
if (isHaveClothes){
this.gotoFrame("thingRight");
} else {
this.gotoFrame("right");
};
} else {
this.x = _local1;
};
};
if (_local4 > 5){
if (isHaveClothes){
this.gotoFrame("thingBack");
} else {
this.gotoFrame("back");
};
} else {
if (_local4 < -5){
if (isHaveClothes){
this.gotoFrame("thingFront");
} else {
this.gotoFrame("front");
};
} else {
this.y = _local2;
};
};
if (_local5 <= 5){
this.x = _local1;
this.y = _local2;
_index++;
if (_index >= path.length){
isPrepareGo = false;
path = null;
trace(((("```````````````````````````````````````````````````````````服务员找到目的地 " + this.action) + "```````") + this.severGuest));
_destination = true;
};
};
}
private function goRoom():void{
_destination = false;
isPrepareGo = true;
_isFree = false;
this.action = "goRoom";
var _local1:Number = (Game.roomLArr[(_severGuest.roomNum - 1)].x - Game._cellSize);
var _local2:Number = Game.roomLArr[(_severGuest.roomNum - 1)].y;
Game.grid.setEndNode(Math.floor((_local1 / Game._cellSize)), Math.floor((_local2 / Game._cellSize)));
Game.grid.setStartNode(Math.floor((this.x / Game._cellSize)), Math.floor((this.y / Game._cellSize)));
findPath();
trace("去试衣间");
}
public function set isprepareSever(_arg1:Boolean):void{
this._isPrepareSever = _arg1;
}
public function goInitLocation():void{
isPrepareGo = true;
_isFree = false;
var _local1:Number = Math.floor((initX / Game._cellSize));
var _local2:Number = Math.floor((initY / Game._cellSize));
var _local3:Number = Math.floor((this.x / Game._cellSize));
var _local4:Number = Math.floor((this.y / Game._cellSize));
this.x = ((_local3 * Game._cellSize) + (Game._cellSize / 2));
this.y = ((_local4 * Game._cellSize) + (Game._cellSize / 2));
Game.grid.setStartNode(_local3, _local4);
Game.grid.setEndNode(_local1, _local2);
findPath();
}
protected function freeStatic():void{
this._isFree = true;
this.gotoFrame("standRight");
action = "waite";
}
public function set isFree(_arg1:Boolean):void{
_isFree = _arg1;
}
public function prepareGoInit():void{
action = "goInit";
goInitLocation();
trace("服务员又返回初始化位置");
isDesk = false;
}
}
}//package element
Section 13
//Game (game.Game)
package game {
import flash.display.*;
import util.astar.*;
import flash.geom.*;
import com.greensock.*;
import flash.events.*;
import util.*;
import flash.utils.*;
import my.*;
import data.*;
public class Game extends Sprite {
private var vy:Number;
private var _path:Array;
private var vx:Number;
private var winPage:MovieClip;
private var _index:int;
private var targetGoal:MovieClip;
private var player:MovieClip;
private var gridSprite:Sprite;
private var gameStage:GameStage;
private var endGameFail:MovieClip;
private var buyThingPage:BuyThingPage;
public static const QUIT_GAME:String = "quit_game";
public static const _cellSize:int = 30;
public static var cashierInitX:Number;
public static var grid:Grid;
public static var waiterInitLArr:Array = new Array();
public static var deskGuestY:Number;
public static var waiterOneInitX:Number;
public static var cashierInitY:Number;
public static var guestInitX:Number;
public static var guestInitY:Number;
public static var waiterOneInitY:Number;
public static var roomLArr:Array;
public static var waiterThreeInitX:Number;
public static var waiterThreeInitY:Number;
public static var deskWaiterX:Number;
public static var waiterTwoInitX:Number;
public static var waiterTwoInitY:Number;
public static var clothesGuestLArr:Array;
public static var gameInterface:GameInterface;
public static var deskWaiterY:Number;
public static var cashierBeginX:Number;
public static var cashierBeginY:Number;
public static var deskGuestX:Number;
public static var clothesWaiterLArr:Array;
private function winPageShow():void{
winPage.playGame_btn.visible = true;
winPage.lastMoreGame_btn.visible = true;
}
private function initStaticNumber():void{
var _local1:Point = McPointHandler.getGridPoint(gameInterface, new Point(gameInterface.pointArr[0].x, gameInterface.pointArr[0].y));
cashierInitX = _local1.x;
cashierInitY = _local1.y;
deskGuestX = _local1.x;
deskGuestY = _local1.y;
deskWaiterX = (_local1.x - _cellSize);
deskWaiterY = _local1.y;
var _local2:Point = McPointHandler.getGridPoint(gameInterface, new Point(gameInterface.pointArr[1].x, gameInterface.pointArr[1].y));
var _local3:Point = McPointHandler.getGridPoint(gameInterface, new Point(gameInterface.pointArr[2].x, gameInterface.pointArr[2].y));
var _local4:Point = McPointHandler.getGridPoint(gameInterface, new Point(gameInterface.pointArr[3].x, gameInterface.pointArr[3].y));
waiterOneInitX = _local2.x;
waiterOneInitY = _local2.y;
waiterTwoInitX = _local3.x;
waiterTwoInitY = _local3.y;
waiterThreeInitX = _local4.x;
waiterThreeInitY = _local4.y;
waiterInitLArr.push(_local2);
waiterInitLArr.push(_local3);
waiterInitLArr.push(_local4);
}
private function quitHandler(_arg1:MouseEvent):void{
trace("结束游戏");
MySound.playBtnSound();
gameInterface.removeChild(endGameFail);
endGameFail.yes_btn.removeEventListener(MouseEvent.CLICK, yesHandler);
endGameFail.quit_btn.removeEventListener(MouseEvent.CLICK, quitHandler);
endGameFail = null;
this.quitGame();
}
public function init():void{
makeGameInterface();
beginGame();
}
public function clothesPointHandler():void{
var _local2:Number;
var _local3:Number;
var _local4:Point;
clothesGuestLArr = new Array();
clothesWaiterLArr = new Array();
var _local1:int;
while (_local1 < gameInterface.clothesPointArr.length) {
_local2 = Math.floor((gameInterface.clothesPointArr[_local1].x / _cellSize));
_local3 = Math.floor((gameInterface.clothesPointArr[_local1].y / _cellSize));
_local4 = new Point(((_local2 * _cellSize) + (_cellSize / 2)), ((_local3 * _cellSize) + (_cellSize / 2)));
if ((_local1 % 2) == 0){
clothesWaiterLArr.push(_local4);
} else {
clothesGuestLArr.push(_local4);
};
_local1++;
};
}
private function beginAddGameStage():void{
gameStage = new GameStage(gameInterface);
}
public function roomPointHandler():void{
var _local2:MovieClip;
var _local3:Point;
roomLArr = new Array();
var _local1:int;
while (_local1 < gameInterface.roomArr.length) {
_local2 = (gameInterface.roomArr[_local1].men_mc as MovieClip);
_local3 = McPointHandler.getGridPoint(gameInterface.roomArr[_local1], new Point(_local2.x, _local2.y));
roomLArr.push(_local3);
_local2.visible = false;
_local1++;
};
}
private function findNoWalk():void{
var _local3:Array;
var _local4:int;
var _local5:Array;
var _local6:int;
var _local1:int;
while (_local1 < gameInterface.roomArr.length) {
_local3 = new Array();
_local4 = 1;
while (_local4 <= 12) {
_local3.push(gameInterface.roomArr[_local1][("dian" + _local4)]);
gameInterface.roomArr[_local1][("dian" + _local4)].visible = false;
_local4++;
};
arrPointHandler(_local3, gameInterface.roomArr[_local1]);
_local1++;
};
var _local2:int;
while (_local2 < gameInterface.yifuArr.length) {
_local5 = new Array();
_local6 = 1;
while (_local6 <= 2) {
_local5.push(gameInterface.yifuArr[_local2][("dian" + _local6)]);
gameInterface.yifuArr[_local2][("dian" + _local6)].visible = false;
_local6++;
};
arrPointHandler(_local5, gameInterface.yifuArr[_local2]);
_local2++;
};
}
private function makeGameInterface():void{
gameInterface = new GameInterface();
this.addChild(gameInterface);
gameInterface.x = 0;
gameInterface.y = 0;
}
private function winPlayGame(_arg1:MouseEvent):void{
MySound.playBtnSound();
trace("结束游戏");
gameInterface.removeChild(winPage);
winPage = null;
this.quitGame();
}
private function makeGrid():void{
var _local2:int;
grid = new Grid(26, 17);
var _local1:int;
while (_local1 < 26) {
_local2 = 0;
while (_local2 < 3) {
grid.setWalkable(_local1, _local2, false);
_local2++;
};
_local1++;
};
grid.setWalkable(10, 3, false);
grid.setWalkable(11, 3, false);
grid.setWalkable(12, 3, false);
findNoWalk();
drawGrid();
trace("画网格");
}
private function endGameFailHandler(_arg1:Event):void{
this.removeChild(gridSprite);
gridSprite = null;
endGameFail = new EndGameFail();
gameInterface.addChild(endGameFail);
endGameFail.yes_btn.visible = false;
endGameFail.quit_btn.visible = false;
var _local2:Timer = new Timer(330, 1);
_local2.addEventListener(TimerEvent.TIMER_COMPLETE, gameFail);
_local2.start();
if (MySound.backSoundStr != "failGame"){
MySound.playBackSound("failGame");
};
}
private function arrPointHandler(_arg1:Array, _arg2:DisplayObject):void{
var _local4:Point;
var _local5:int;
var _local6:int;
var _local3:int;
while (_local3 < _arg1.length) {
_local4 = _arg2.localToGlobal(new Point(_arg1[_local3].x, _arg1[_local3].y));
_local5 = Math.floor((_local4.x / _cellSize));
_local6 = Math.floor((_local4.y / _cellSize));
grid.setWalkable(_local5, _local6, false);
_local3++;
};
}
private function yesHandler(_arg1:MouseEvent):void{
MySound.playBtnSound();
trace("重新玩该局游戏");
gameInterface.removeChild(endGameFail);
endGameFail.yes_btn.removeEventListener(MouseEvent.CLICK, yesHandler);
endGameFail.quit_btn.removeEventListener(MouseEvent.CLICK, quitHandler);
endGameFail = null;
GameData.sellGold = 0;
GameData.sellInitGold = 0;
gameInterface.init();
gridSprite = new Sprite();
makeGrid();
this.addChild(gridSprite);
gridSprite.mouseChildren = false;
gridSprite.mouseEnabled = false;
initStaticNumber();
gridSprite.visible = false;
gridSprite.alpha = 0.5;
clothesPointHandler();
roomPointHandler();
beginAddGameStage();
this.startGame();
}
private function endGameHandler(_arg1:Event):void{
GameData.totalGold = (GameData.totalGold + (GameData.sellGold - GameData.targetGoal));
GameData.sellGold = 0;
GameData.sellInitGold = 0;
this.removeChild(gridSprite);
gridSprite = null;
if (GameData.gameLevel >= 20){
trace("恭喜你游戏通关了");
endGameWin();
return;
};
trace("该关游戏结束");
gameInterface.addChild(buyThingPage);
gameInterface.setChildIndex(buyThingPage, (gameInterface.numChildren - 1));
buyThingPage.init();
buyThingPage.addEventListener(BuyThingPage.LEVEL_UP_BEGIN, levelUpBegin);
if (MySound.backSoundStr != "buyThing"){
MySound.playBackSound("buyThing");
};
}
private function initBuyThingPage():void{
buyThingPage = new BuyThingPage();
}
private function quitGame():void{
this.removeChild(gameInterface);
gameInterface = null;
GameData.gameLevel = 1;
GameData.sellGold = 0;
GameData.sellInitGold = 0;
GameData.totalGold = 0;
this.dispatchEvent(new Event(QUIT_GAME));
}
private function levelUpBegin(_arg1:Event):void{
buyThingPage.removeEventListener(BuyThingPage.LEVEL_UP_BEGIN, levelUpBegin);
gameInterface.removeChild(buyThingPage);
if (MyGame.isLoadGame){
MyGame.isLoadGame = false;
} else {
GameData.gameLevel = (GameData.gameLevel + 1);
};
GameData.initTargetGoal();
beginGame();
}
private function getColor(_arg1:Node):uint{
if (!_arg1.walkable){
return (0);
};
if (_arg1 == grid.startNode){
return (0xCCCCCC);
};
if (_arg1 == grid.endNode){
return (0xCCCCCC);
};
return (0xFFFFFF);
}
private function removeTargetGoal():void{
gameInterface.removeChild(targetGoal);
targetGoal = null;
}
private function gameFail(_arg1:TimerEvent):void{
_arg1.target.removeEventListener(TimerEvent.TIMER_COMPLETE, gameFail);
endGameFail.yes_btn.visible = true;
endGameFail.quit_btn.visible = true;
endGameFail.yes_btn.addEventListener(MouseEvent.CLICK, yesHandler);
endGameFail.quit_btn.addEventListener(MouseEvent.CLICK, quitHandler);
}
private function drawGrid():void{
var _local2:int;
var _local3:Node;
gridSprite.graphics.clear();
var _local1:int;
while (_local1 < grid.numCols) {
_local2 = 0;
while (_local2 < grid.numRows) {
_local3 = grid.getNode(_local1, _local2);
gridSprite.graphics.lineStyle(1);
if (getColor(_local3) == 0xFFFFFF){
gridSprite.graphics.beginFill(getColor(_local3), 0);
} else {
gridSprite.graphics.beginFill(getColor(_local3), 0.8);
};
gridSprite.graphics.drawRect((_local1 * _cellSize), (_local2 * _cellSize), _cellSize, _cellSize);
if ((((_local1 == (grid.numCols - 2))) && ((_local2 == 4)))){
guestInitX = ((_local1 * _cellSize) + (_cellSize / 2));
guestInitY = ((_local2 * _cellSize) + (_cellSize / 2));
};
_local2++;
};
_local1++;
};
}
private function startGame():void{
targetGoal = new TargetGoal();
gameInterface.addChild(targetGoal);
targetGoal.x = 350;
targetGoal.y = -80;
var _local1:Array = new Array();
var _local2 = 1;
while (_local2 <= 6) {
_local1.push(targetGoal[("mc" + _local2)]);
_local2++;
};
NumberHandlerTwo.getNumber(GameData.targetGoal, _local1);
TweenLite.to(targetGoal, 0.2, {y:250});
var _local3:Timer = new Timer(1000, 1);
_local3.addEventListener(TimerEvent.TIMER_COMPLETE, startGameHandler);
_local3.start();
trace(((("你重新玩的关卡等级" + GameData.gameLevel) + "````````") + gameInterface.levelArr));
}
private function lastMoreGame(_arg1:MouseEvent):void{
MySound.playBtnSound();
MovieClip(this.root).LogoMoreGame("moregames-donepage");
}
private function startGameHandler(_arg1:TimerEvent):void{
if (MySound.backSoundStr != "atGame"){
MySound.playBackSound("atGame");
};
gameInterface.initThing();
gameStage.init();
gameStage.addEventListener(GameStage.END_GAME, endGameHandler);
gameStage.addEventListener(GameStage.END_GAME_FAIL, endGameFailHandler);
gameStage.addEventListener(GameStage.YES_END_GAME, yesEndGameHandler);
TweenLite.to(targetGoal, 0.1, {y:-80, onComplete:removeTargetGoal});
SaveGameObj.saveObj();
}
public function beginGame():void{
gameInterface.init();
gridSprite = new Sprite();
makeGrid();
this.addChild(gridSprite);
gridSprite.mouseChildren = false;
gridSprite.mouseEnabled = false;
initStaticNumber();
gridSprite.visible = false;
gridSprite.alpha = 0.5;
clothesPointHandler();
roomPointHandler();
beginAddGameStage();
trace(("游戏是否通过加载进入游戏::" + MyGame.isLoadGame));
if (buyThingPage == null){
initBuyThingPage();
if (MyGame.isLoadGame){
gameInterface.addChild(buyThingPage);
gameInterface.setChildIndex(buyThingPage, (gameInterface.numChildren - 1));
buyThingPage.init();
buyThingPage.addEventListener(BuyThingPage.LEVEL_UP_BEGIN, levelUpBegin);
trace(("背景音乐::" + MySound.backSoundStr));
if (MySound.backSoundStr != "buyThing"){
MySound.playBackSound("buyThing");
trace(("背景音乐::" + MySound.backSoundStr));
};
return;
};
};
trace(("当前是第几关::" + GameData.gameLevel));
startGame();
}
private function yesEndGameHandler(_arg1:Event):void{
this.removeChild(gridSprite);
gridSprite = null;
quitGame();
}
private function endGameWin():void{
winPage = new WinPage();
gameInterface.addChild(winPage);
winPage.x = 357;
winPage.y = 246;
winPage.playGame_btn.visible = false;
winPage.lastMoreGame_btn.visible = false;
TweenLite.to(winPage, 0.33, {onComplete:winPageShow});
winPage.playGame_btn.addEventListener(MouseEvent.CLICK, winPlayGame);
winPage.lastMoreGame_btn.addEventListener(MouseEvent.CLICK, lastMoreGame);
if (MySound.backSoundStr != "winGame"){
MySound.playBackSound("winGame");
};
}
}
}//package game
Section 14
//GameInterface (game.GameInterface)
package game {
import flash.display.*;
import com.greensock.*;
import flash.events.*;
import element.*;
import util.*;
import my.*;
import data.*;
public class GameInterface extends MovieClip {
public var dian2:MovieClip;
public var dian3:MovieClip;
public var coinsArr:Array;
public var end_btn:SimpleButton;
public var dian4:MovieClip;
public var dianClothes10:MovieClip;
public var dianClothes11:MovieClip;
public var dianClothes12:MovieClip;
public var clothesPointArr:Array;
public var isSettleAccounts:Boolean;
public var waiterArr:Array;
public var yifuArr:Array;
public var wall_mc:MovieClip;
public var yifu1:MovieClip;
public var yifu2:MovieClip;
public var yifu3:MovieClip;
public var yifu4:MovieClip;
public var yifu5:MovieClip;
public var yifu6:MovieClip;
public var deskWoman_mc:MovieClip;
public var __id7_:MovieClip;
public var goalArr:Array;
public var levelArr:Array;
public var chairArr:Array;
public var clock_mc:MovieClip;
public var dianClothes1:MovieClip;
public var dianClothes2:MovieClip;
public var dianClothes3:MovieClip;
public var dianClothes4:MovieClip;
public var dianClothes5:MovieClip;
public var dianClothes6:MovieClip;
public var dianClothes7:MovieClip;
public var dianClothes8:MovieClip;
public var dianClothes9:MovieClip;
private var lastSellGold:Number;
public var roomArr:Array;
public var pause_btn:SimpleButton;
public var levelUp_mc:MovieClip;
public var chairLocation:Array;
public var gongxi_mc:MovieClip;
public var saveArr:Array;
public var floor_mc:MovieClip;
public var roomLocation:Array;
public var pointArr:Array;
public var room1:MovieClip;
public var room2:MovieClip;
public var room3:MovieClip;
public var room4:MovieClip;
public var room5:MovieClip;
public var room6:MovieClip;
public var room7:MovieClip;
public var room8:MovieClip;
public var room9:MovieClip;
public var ditan_mc:MovieClip;
public var depthNum:Number;
public var sound_mc:MovieClip;
private var lastTargetGold:Number;
public var filterArr:Array;
private var lastGameLevel:Number;
public var time:Time;
public var ditanLocation:Array;
private var lastTotalGold:Number;
private var getLevel:MovieClip;
public var objArr:Array;
public var isPause:Boolean;
public var flower_mc:MovieClip;
public var desk_mc:MovieClip;
public var dian1:MovieClip;
public static const SOUND_STOP_PLAY:String = "sound_stop_play";
public static const CLOTHES:String = "clothes";
public static const BACK_MENU:String = "back_menu";
public static const DESK:String = "desk";
public static const ROOM:String = "room";
public static const PAUSE:String = "pause";
public static var IS_STOP_SOUND:Boolean;
public function GameInterface(){
ditanLocation = new Array({x:383, y:358}, {x:473, y:358}, {x:533, y:358});
chairLocation = new Array({x:418, y:90}, {x:468, y:90}, {x:518, y:90}, {x:568, y:90}, {x:618, y:90}, {x:668, y:90});
super();
saveArr = new Array();
goalArr = new Array();
coinsArr = new Array();
levelArr = new Array();
this.stop();
objArr = new Array();
roomLocation = new Array();
var _local1 = 1;
while (_local1 <= 9) {
this[("room" + _local1)].visible = false;
roomLocation.push(this[("room" + _local1)]);
this[("room" + _local1)].mouseChildren = false;
(this[("room" + _local1)] as MovieClip).mouseEnabled = false;
_local1++;
};
pointArr = new Array();
var _local2 = 1;
while (_local2 <= 4) {
pointArr.push(this[("dian" + _local2)]);
this[("dian" + _local2)].mouseChildren = false;
(this[("dian" + _local2)] as MovieClip).mouseEnabled = false;
this[("dian" + _local2)].visible = false;
_local2++;
};
clothesPointArr = new Array();
var _local3 = 1;
while (_local3 <= 12) {
clothesPointArr.push(this[("dianClothes" + _local3)]);
this[("dianClothes" + _local3)].mouseChildren = false;
(this[("dianClothes" + _local3)] as MovieClip).mouseEnabled = false;
this[("dianClothes" + _local3)].visible = false;
_local3++;
};
initStatusBar();
__setProp___id7__();
}
public function collectMoney():void{
deskWoman_mc.play();
isSettleAccounts = true;
}
private function initRoom():void{
var _local1:MovieClip;
var _local4:MovieClip;
var _local2 = 1;
while (_local2 <= GameData.roomNum) {
_local4 = new Room();
this.addChild(_local4);
_local4.hunsha_mc.visible = false;
_local4.person_mc.visible = false;
_local4.name = ("room" + _local2);
_local4.isHaveGuest = false;
_local4.gotoAndStop(2);
_local4.roomNum_mc.gotoAndStop(_local2);
_local4.x = roomLocation[(_local2 - 1)].x;
_local4.y = roomLocation[(_local2 - 1)].y;
roomArr.push(_local4);
_local4.addEventListener(MouseEvent.CLICK, roomClick);
_local4.buttonMode = true;
_local4.mouseChildren = false;
objArr.push(_local4);
filterArr.push(_local4);
if (_local2 == 1){
_local1 = _local4;
};
_local2++;
};
var _local3:int;
while (_local3 < yifuArr.length) {
this.setChildIndex(yifuArr[_local3], (this.numChildren - 1));
_local3++;
};
this.depthNum = this.getChildIndex(_local1);
if ((((GameData.roomNum >= 5)) && ((GameData.roomNum <= 8)))){
moveDitan(2);
} else {
if (GameData.roomNum > 8){
moveDitan(3);
};
};
}
public function continueTime():void{
time.continueTime();
}
private function initYifu():void{
var _local2:int;
var _local3:MovieClip;
var _local1 = 1;
while (_local1 <= 6) {
this[("yifu" + _local1)].mouseChildren = false;
this[("yifu" + _local1)].visible = true;
yifuArr.push(this[("yifu" + _local1)]);
this[("yifu" + _local1)].gotoAndStop(_local1);
this[("yifu" + _local1)].mouseChildren = false;
this[("yifu" + _local1)].addEventListener(MouseEvent.CLICK, yifuClick);
this[("yifu" + _local1)].buttonMode = true;
objArr.push(this[("yifu" + _local1)]);
filterArr.push(this[("yifu" + _local1)]);
_local1++;
};
trace(("当前衣服等级::" + GameData.clothesLevel));
if (GameData.clothesLevel > 0){
_local2 = 1;
while (_local2 <= GameData.clothesLevel) {
_local3 = (yifuArr[(_local2 - 1)] as MovieClip);
_local3.gotoAndStop((_local3.currentFrame + 6));
_local2++;
};
};
}
public function updateStatusBar():void{
if (lastTotalGold != GameData.totalGold){
NumberHandlerTwo.getNumber(GameData.totalGold, saveArr);
lastTotalGold = GameData.totalGold;
};
if (lastSellGold != GameData.sellGold){
NumberHandlerTwo.getNumber(GameData.sellGold, coinsArr);
lastSellGold = GameData.sellGold;
};
if (lastTargetGold != GameData.targetGoal){
NumberHandlerTwo.getNumber(GameData.targetGoal, goalArr);
lastTargetGold = GameData.targetGoal;
};
if (lastGameLevel != GameData.gameLevel){
NumberHandler.getNumber(GameData.gameLevel, levelArr);
lastGameLevel = GameData.gameLevel;
};
}
private function initTimeBtn():void{
this.clock_mc.zhen_mc.rotation = 0;
time = new Time(clock_mc);
time.startTime((60000 + (GameData.gameLevel * 3000)), GameData.lightBool);
pause_btn.addEventListener(MouseEvent.CLICK, pauseHandler);
end_btn.addEventListener(MouseEvent.CLICK, endHandler);
sound_mc.addEventListener(MouseEvent.CLICK, soundHandler);
if (MySound.soundBool){
sound_mc.gotoAndStop(1);
IS_STOP_SOUND = false;
} else {
sound_mc.gotoAndStop(2);
IS_STOP_SOUND = true;
};
if (GameData.lightBool){
time.addEventListener(Time.GET_NIGHT, getNight);
};
}
private function soundHandler(_arg1:MouseEvent):void{
if (MySound.soundBool){
sound_mc.gotoAndStop(2);
MySound.soundBool = false;
MySound.stopOrPlaySound();
IS_STOP_SOUND = true;
} else {
sound_mc.gotoAndStop(1);
MySound.soundBool = true;
MySound.stopOrPlaySound();
IS_STOP_SOUND = false;
};
}
public function hideDeskWoman(_arg1:Boolean):void{
deskWoman_mc.visible = _arg1;
if (!_arg1){
deskWoman_mc.gotoAndStop(1);
};
}
public function init():void{
lastTotalGold = 0;
lastSellGold = 0;
lastTargetGold = 0;
lastGameLevel = 0;
chairArr = new Array();
yifuArr = new Array();
roomArr = new Array();
waiterArr = new Array();
objArr = new Array();
filterArr = new Array();
deskWoman_mc.gotoAndStop(1);
desk_mc.gotoAndStop(GameData.deskLevel);
ditan_mc.gotoAndStop(GameData.ditanLevel);
wall_mc.gotoAndStop(GameData.wallLevel);
floor_mc.gotoAndStop(GameData.wallLevel);
levelUp_mc.visible = false;
if (GameData.roomNum < 5){
ditan_mc.x = ditanLocation[0].x;
ditan_mc.y = ditanLocation[0].y;
};
initChair(GameData.chairNum);
this.haveLight();
initYifu();
initRoom();
desk_mc.isHaveGuest = false;
if (GameData.flowerLevel){
flower_mc.visible = true;
} else {
flower_mc.visible = false;
};
var _local1 = 1;
while (_local1 <= 20) {
this.desk_mc.statusBar_mc[("mc" + _local1)].gotoAndStop(1);
_local1++;
};
if (GameData.waiterNum > 0){
this.hideDeskWoman(true);
};
if (MySound.soundBool){
sound_mc.gotoAndStop(1);
} else {
sound_mc.gotoAndStop(2);
};
gongxi_mc.visible = false;
}
function __setProp___id7__(){
try {
__id7_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id7_.Type = "logo-menu";
__id7_.Goto = 1;
try {
__id7_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
public function levelUpRemoveObj():void{
var _local1:int;
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
while (chairArr.length > 0) {
_local1 = (this.chairArr.length - 1);
while (_local1 >= 0) {
this.removeChild(chairArr[_local1]);
chairArr.splice(_local1, 1);
_local1--;
};
};
chairArr = null;
while (yifuArr.length > 0) {
_local2 = (this.yifuArr.length - 1);
while (_local2 >= 0) {
yifuArr[_local2].visible = false;
yifuArr[_local2].removeEventListener(MouseEvent.CLICK, yifuClick);
yifuArr.splice(_local2, 1);
_local2--;
};
};
yifuArr = null;
while (roomArr.length > 0) {
_local3 = (roomArr.length - 1);
while (_local3 >= 0) {
roomArr[_local3].removeEventListener(MouseEvent.CLICK, roomClick);
this.removeChild(roomArr[_local3]);
roomArr.splice(_local3, 1);
_local3--;
};
};
roomArr = null;
clock_mc.zhen_mc.rotation = 0;
pause_btn.removeEventListener(MouseEvent.CLICK, pauseHandler);
end_btn.removeEventListener(MouseEvent.CLICK, endHandler);
sound_mc.removeEventListener(MouseEvent.CLICK, soundHandler);
time = null;
this.isPause = false;
desk_mc.removeEventListener(MouseEvent.CLICK, deskClickHandler);
while (objArr.length > 0) {
_local4 = objArr.length;
while (_local4 >= 0) {
if ((objArr[_local4] is GuestTwo)){
this.removeChild(objArr[_local4]);
};
objArr.splice(_local4, 1);
_local4--;
};
};
while (waiterArr.length > 0) {
_local5 = (waiterArr.length - 1);
while (_local5 >= 0) {
this.removeChild(waiterArr[_local5]);
waiterArr.splice(_local5, 1);
_local5--;
};
};
waiterArr = null;
trace("游戏界面清除对象");
while (filterArr.length > 0) {
_local6 = (filterArr.length - 1);
while (_local6 >= 0) {
filterArr.splice(_local6, 1);
_local6--;
};
};
filterArr = null;
}
public function findRoom():Number{
var _local1:Number = -1;
var _local2:int;
while (_local2 < roomArr.length) {
if (roomArr[_local2].currentFrame == 2){
_local1 = _local2;
return (_local1);
};
_local2++;
};
return (_local1);
}
private function getNight(_arg1:Event):void{
this.openLight();
wall_mc.gotoAndStop((GameData.wallLevel + 2));
floor_mc.gotoAndStop((GameData.wallLevel + 2));
time.removeEventListener(Time.GET_NIGHT, getNight);
MySound.playSpecialSound("changeNight");
}
private function roomClick(_arg1:MouseEvent):void{
var _local2:MovieClip = (_arg1.target as MovieClip);
if ((((_local2.currentFrame == 1)) || (_local2.isHaveGuest))){
return;
};
var _local3:String = _arg1.target.name;
var _local4:Number = StringHandler.strChangNum(_local3);
trace(("点击房间::" + _local2.isHaveGuest));
this.dispatchEvent(new RoomEvent(ROOM, _local4, _local2));
}
private function initStatusBar():void{
var _local1 = 1;
while (_local1 <= 20) {
this.desk_mc.statusBar_mc[("mc" + _local1)].gotoAndStop(1);
if (_local1 <= 6){
coinsArr.push(this.desk_mc.statusBar_mc[("mc" + _local1)]);
} else {
if ((((_local1 > 6)) && ((_local1 <= 12)))){
goalArr.push(this.desk_mc.statusBar_mc[("mc" + _local1)]);
} else {
if ((((_local1 > 12)) && ((_local1 <= 18)))){
saveArr.push(this.desk_mc.statusBar_mc[("mc" + _local1)]);
} else {
levelArr.push(this.desk_mc.statusBar_mc[("mc" + _local1)]);
};
};
};
_local1++;
};
this.desk_mc.statusBar_mc.mouseChildren = false;
this.desk_mc.statusBar_mc.mouseEnabled = false;
}
public function haveLight():void{
var _local1:MovieClip;
var _local2:MovieClip;
if (GameData.lightBool){
for each (_local1 in chairArr) {
_local1.light_mc.visible = true;
_local1.light_mc.gotoAndStop(1);
};
} else {
for each (_local2 in chairArr) {
_local2.light_mc.visible = false;
};
};
}
public function stopDeskWoman():void{
deskWoman_mc.gotoAndStop(1);
isSettleAccounts = false;
}
public function hideLevelUp():void{
this.removeChild(getLevel);
getLevel = null;
TweenLite.to(levelUp_mc, 0.2, {y:650});
}
private function initChair(_arg1:Number):void{
var _local3:MovieClip;
if (_arg1 > chairLocation.length){
trace("椅子最多6把");
return;
};
var _local2:int;
while (_local2 < _arg1) {
_local3 = new Chair();
this.addChild(_local3);
_local3.sitPersonBool = false;
_local3.x = chairLocation[_local2].x;
_local3.y = chairLocation[_local2].y;
chairArr.push(_local3);
if (_local2 == (_arg1 - 1)){
trace(("最后一把椅子的位置::" + this.getChildIndex(_local3)));
};
_local2++;
};
trace(("初始化椅子```````````" + objArr.length));
}
public function moveDitan(_arg1:Number):void{
var _local2:Number = ditan_mc.x;
ditan_mc.x = ditanLocation[(_arg1 - 1)].x;
ditan_mc.y = ditanLocation[(_arg1 - 1)].y;
trace(_local2, ditan_mc.x);
if (_local2 == ditan_mc.x){
trace("地毯没有移动,衣服也不移动");
return;
};
var _local3:Number = 0;
var _local4:int;
while (_local4 < yifuArr.length) {
if (_arg1 == 2){
yifuArr[_local4].x = (yifuArr[_local4].x + 90);
_local3 = 90;
} else {
if ((((_arg1 == 3)) && ((_local2 == ditanLocation[0].x)))){
yifuArr[_local4].x = (yifuArr[_local4].x + 150);
_local3 = 150;
} else {
if ((((_arg1 == 3)) && ((_local2 == ditanLocation[1].x)))){
yifuArr[_local4].x = (yifuArr[_local4].x + 60);
_local3 = 60;
};
};
};
_local4++;
};
var _local5:int;
while (_local5 < this.clothesPointArr.length) {
clothesPointArr[_local5].x = (clothesPointArr[_local5].x + _local3);
_local5++;
};
}
public function levelUpCom():void{
levelUp_mc.visible = true;
levelUp_mc.x = 339;
levelUp_mc.y = 650;
this.setChildIndex(levelUp_mc, (this.numChildren - 1));
TweenLite.to(levelUp_mc, 0.2, {y:250, onComplete:diplayLevelUp});
gongxi_mc.visible = true;
getLevel = new GetLevel();
this.addChild(getLevel);
getLevel.x = 351;
getLevel.y = 0xFF;
if (MySound.backSoundStr != "levelUpSound"){
MySound.playBackSound("levelUpSound");
};
}
public function initThing():void{
initTimeBtn();
}
private function pauseHandler(_arg1:MouseEvent):void{
MySound.playBtnSound();
trace("点击暂停按钮");
this.dispatchEvent(new Event(PAUSE));
}
private function deskClickHandler(_arg1:MouseEvent):void{
this.dispatchEvent(new Event(DESK));
}
private function diplayLevelUp():void{
TweenLite.to(levelUp_mc, 2.3, {onComplete:hideLevelUp});
}
public function pauseTime():void{
trace("时间是否为空");
time.pauseTime();
}
public function isPauseDeskWoman():void{
if (deskWoman_mc.currentFrame == 1){
return;
};
if (isPause){
deskWoman_mc.stop();
} else {
deskWoman_mc.play();
};
}
private function yifuClick(_arg1:MouseEvent):void{
var _local2:String = _arg1.target.name;
var _local3:Number = StringHandler.strChangNum(_local2);
var _local4:Number = (_arg1.target as MovieClip).currentFrame;
trace(("你点击的衣服号" + _local3));
this.dispatchEvent(new ClothesEvent(CLOTHES, _local3, _local4));
}
private function endHandler(_arg1:MouseEvent):void{
MySound.playBtnSound();
trace("结束游戏是否");
this.dispatchEvent(new Event(BACK_MENU));
}
private function closeRoom(_arg1):void{
roomArr[_arg1].gotoAndStop(1);
}
private function openLight():void{
var _local1:MovieClip;
if (GameData.lightBool){
for each (_local1 in chairArr) {
_local1.light_mc.visible = true;
_local1.light_mc.gotoAndStop(2);
};
};
}
}
}//package game
Section 15
//GameStage (game.GameStage)
package game {
import flash.display.*;
import flash.geom.*;
import com.greensock.*;
import flash.events.*;
import element.*;
import util.*;
import flash.utils.*;
import my.*;
public class GameStage extends GameWorld {
private var guestTimeNum:Number;
private var startGuestTimeNum:Number;
private var pausePage:MovieClip;
private var isBeginGame:Boolean;
private var endHelp:MovieClip;
private var depthNum:Number;
private var guestTime:Timer;
public var guestLoctionInitX:Number;// = 0
public var guestLoctionInitY:Number;// = 0
private var cashier:Cashier;
private var isEndTime:Boolean;
private var isEndGameMc:MovieClip;
public var clothesHaveGuestArr:Array;
private var isEndGame:Boolean;
public static const END_GAME_FAIL:String = "end_game_fail";
public static const YES_END_GAME:String = "yes_end_game";
public static const END_GAME:String = "end_game";
public static var clickMc:MovieClip;
public static var clickPointOut:MovieClip;
public static var _gameInterface:GameInterface;
public static var addMoneyArr:Array;
public static var isCeShi:Boolean;
public static var firstClickArr:Array;
public static var guestNum:Number = 0;
public static var pleaseWaitingArr:Array;
public function GameStage(_arg1:GameInterface){
clothesHaveGuestArr = [false, false, false, false, false, false];
super();
_gameInterface = _arg1;
isCeShi = false;
}
private function addPausePage():void{
pausePage = new PausePage();
_gameInterface.addChild(pausePage);
pausePage.continue_btn.addEventListener(MouseEvent.CLICK, continerHandler);
trace("添加暂停页面");
}
private function findGuestClothesTwo(_arg1:Number):GuestTwo{
var _local4:Number;
var _local5:GuestTwo;
var _local6:int;
var _local2:Array = new Array();
var _local3:int;
while (_local3 < this._objList["guest"].length) {
if ((((_objList["guest"][_local3].clothesNum == _arg1)) && ((_objList["guest"][_local3].action == "changeClothes")))){
_local2.push((_objList["guest"][_local3] as GuestTwo));
if (GameStage.isCeShi){
return ((_objList["guest"][_local3] as GuestTwo));
};
};
_local3++;
};
trace(("要换这件衣服的客人数量::" + _local2.length));
if (_local2.length <= 0){
return (null);
};
_local4 = 0;
_local6 = 0;
while (_local6 < _local2.length) {
if ((_local2[_local6] as GuestTwo).timeProgressNum >= _local4){
_local4 = (_local2[_local6] as GuestTwo).timeProgressNum;
_local5 = (_local2[_local6] as GuestTwo);
};
_local6++;
};
return (_local5);
}
private function chairGetGuest(_arg1:GuestTwo, _arg2:Number):void{
var _local3:MovieClip = (_gameInterface.chairArr[_arg2] as MovieClip);
var _local4:Point = McPointHandler.getGridPoint(_local3, new Point(_local3.chairL_mc.x, _local3.chairL_mc.y));
var _local5:Point = McPointHandler.getStagePoint(_local3, new Point(0, 0));
var _local6:Point = McPointHandler.getStagePoint(_local3, new Point(_local3.chairL_mc.x, _local3.chairL_mc.y));
_arg1.chairDesX = _local4.x;
_arg1.chairDesY = _local4.y;
_arg1.chairX = _local5.x;
_arg1.chairY = _local5.y;
_arg1.chairStandX = _local6.x;
_arg1.chairStandY = _local6.y;
_gameInterface.chairArr[_arg2].sitPersonBool = true;
_arg1.chairNum = (_arg2 + 1);
}
private function initGuestHelp():void{
depthNum = 0;
guestNum = 0;
addMoneyArr = new Array();
pleaseWaitingArr = new Array();
initWaiter();
this.getGuest();
if (GameData.gameLevel == 1){
firstClickArr = new Array(false, false, false, false, false);
clickPointOut = new Click();
_gameInterface.addChild(clickPointOut);
clickPointOut.visible = false;
clickPointOut.mouseChildren = false;
clickPointOut.mouseEnabled = false;
_gameInterface.pauseTime();
clickMc = new ClickPoint();
_gameInterface.addChild(clickMc);
clickMc.mouseEnabled = false;
clickMc.mouseChildren = false;
clickMc.visible = false;
};
_gameInterface.addEventListener(GameInterface.CLOTHES, clothesClick);
_gameInterface.addEventListener(GameInterface.ROOM, roomClick);
_gameInterface.addEventListener(GameInterface.DESK, deskClick);
_gameInterface.addEventListener(GameInterface.PAUSE, pauseHandler);
_gameInterface.addEventListener(GameInterface.BACK_MENU, backMenuHandler);
this.addEventListener(Event.ENTER_FRAME, frameHandler);
trace("````````````````");
addFilter();
}
private function pauseHandler(_arg1:Event):void{
trace("暂停");
addPausePage();
zantin();
}
public function depthHandler():void{
depthNum++;
if ((depthNum % 10) == 0){
_gameInterface.objArr.sortOn("y", Array.NUMERIC);
depthNum = 0;
} else {
return;
};
var _local1:int;
while (_local1 < _gameInterface.objArr.length) {
_gameInterface.setChildIndex(_gameInterface.objArr[_local1], (_gameInterface.depthNum + _local1));
_local1++;
};
}
private function endGame(_arg1:TimerEvent):void{
_gameInterface.levelUp_mc.visible = false;
this.dispatchEvent(new Event(END_GAME));
}
public function init():void{
if ((((isBeginGame == false)) && ((GameData.gameLevel == 1)))){
isBeginGame = true;
isCeShi = true;
} else {
isCeShi = false;
_gameInterface.continueTime();
};
if ((((GameData.gameLevel == 1)) && (isCeShi))){
initGuestHelp();
return;
};
if (!isBeginGame){
depthNum = 0;
guestNum = 0;
addMoneyArr = new Array();
pleaseWaitingArr = new Array();
initWaiter();
};
guestNum = 0;
guestTimeNum = 0;
startGuestTimeNum = 0;
this.getGuest();
guestTime = new Timer(1000);
guestTimeNum = GameData.shopperRefreshArr[(GameData.gameLevel - 1)];
guestTime.addEventListener(TimerEvent.TIMER, timerHandler);
guestTime.start();
_gameInterface.addEventListener(GameInterface.CLOTHES, clothesClick);
_gameInterface.addEventListener(GameInterface.ROOM, roomClick);
_gameInterface.addEventListener(GameInterface.DESK, deskClick);
_gameInterface.addEventListener(GameInterface.PAUSE, pauseHandler);
_gameInterface.time.addEventListener(Time.TIME_END, gameTimeEnd);
_gameInterface.addEventListener(GameInterface.BACK_MENU, backMenuHandler);
this.addEventListener(Event.ENTER_FRAME, frameHandler);
addFilter();
}
private function leaveClothes(_arg1:Event):void{
var _local2:GuestTwo = (_arg1.target as GuestTwo);
this.clothesHaveGuestArr[(_local2.clothesNum - 1)] = false;
}
private function initWaiter():void{
var _local1:int;
var _local2:WaiterTwo;
if (GameData.waiterNum == 0){
cashier = new Cashier(ShouYinYuan);
cashier.setStage(_gameInterface, Game.cashierInitX, Game.cashierInitY);
_gameInterface.objArr.push(cashier);
_gameInterface.filterArr.push(cashier);
cashier.isCashierAndWaiter = true;
cashier.gotoFrame("standFront");
cashier.scaleX = 0.9;
cashier.scaleY = 0.9;
cashier.isFree = true;
cashier.cashierHide = true;
cashier.visible = false;
addWaiter(cashier);
_gameInterface.waiterArr.push(cashier);
trace(("第一个服务员的位置::" + _gameInterface.getChildIndex(cashier)));
} else {
_local1 = 1;
while (_local1 <= GameData.waiterNum) {
if (_local1 == 1){
_local2 = new WaiterTwo(FuWuYuanOne);
} else {
if (_local1 == 2){
_local2 = new WaiterTwo(FuWuYuanTwo);
} else {
if (_local1 == 3){
_local2 = new WaiterTwo(FuWuYuanThree);
};
};
};
_local2.setStage(_gameInterface, Game.waiterInitLArr[(_local1 - 1)].x, Game.waiterInitLArr[(_local1 - 1)].y);
_gameInterface.objArr.push(_local2);
_gameInterface.filterArr.push(_local2);
_local2.gotoFrame("standFront");
_local2.scaleX = 0.9;
_local2.scaleY = 0.9;
_local2.isFree = true;
addWaiter(_local2);
_gameInterface.waiterArr.push(_local2);
_local1++;
};
};
trace(("整个游戏服务员的数量" + GameData.waiterNum));
}
private function backMenuHandler(_arg1:Event):void{
trace("是否结束游戏提示");
zantin();
isEndGameMc = new IsEndGame();
_gameInterface.addChild(isEndGameMc);
isEndGameMc.x = 350;
isEndGameMc.y = 250;
isEndGameMc.yes_btn.addEventListener(MouseEvent.CLICK, yesEndGame);
isEndGameMc.no_btn.addEventListener(MouseEvent.CLICK, noEndGame);
}
private function jixu():void{
if (((!((guestTime == null))) && (!(isCeShi)))){
startGuestTime();
};
_gameInterface.isPause = false;
this.addEventListener(Event.ENTER_FRAME, frameHandler);
_gameInterface.isPauseDeskWoman();
if (!isCeShi){
_gameInterface.continueTime();
};
if (!_objList["guest"]){
return;
};
if (this._objList["guest"].length <= 0){
trace("场景中海没有客人的");
return;
};
var _local1:int;
while (_local1 < this._objList["guest"].length) {
_objList["guest"][_local1].continueGame();
_local1++;
};
}
private function clearIsEndGame():void{
isEndGameMc.yes_btn.removeEventListener(MouseEvent.CLICK, yesEndGame);
isEndGameMc.no_btn.removeEventListener(MouseEvent.CLICK, noEndGame);
_gameInterface.removeChild(isEndGameMc);
isEndGameMc = null;
}
private function keyUpHandler(_arg1:KeyboardEvent):void{
var _local2:int;
if (_arg1.keyCode == 32){
while (this._objList["guest"].length > 0) {
_local2 = (this._objList["guest"].length - 1);
while (_local2 >= 0) {
this._objList["guest"][_local2].stopTime();
this._objList["guest"].splice(_local2, 1);
_local2--;
};
};
};
if (this.guestTime != null){
this.removeGuestTime();
};
GameData.sellGold = GameData.targetGoal;
_gameInterface.time.removeTime();
_gameInterface.stage.removeEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
}
private function zantin():void{
if (((!((guestTime == null))) && (!(isCeShi)))){
stopGuestTime();
};
_gameInterface.isPause = true;
this.removeEventListener(Event.ENTER_FRAME, frameHandler);
if (_gameInterface.deskWoman_mc.currentFrame != 1){
_gameInterface.isPauseDeskWoman();
};
if (((!((_gameInterface.time == null))) && (!(isCeShi)))){
_gameInterface.pauseTime();
};
if (!_objList["guest"]){
return;
};
if (this._objList["guest"].length <= 0){
trace("场景中海没有客人的");
return;
};
var _local1:int;
while (_local1 < this._objList["guest"].length) {
_objList["guest"][_local1].pauseGame();
_local1++;
};
}
private function guestClickHandler(_arg1:GuestEvent):void{
var _local2:WaiterTwo;
trace(_arg1.clickName);
trace(_arg1.targetObj);
if (GameData.waiterNum <= 1){
_local2 = (_objList["waiter"][0] as WaiterTwo);
if ((_local2 is Cashier)){
if (_local2.isFree == false){
return;
};
(_local2 as Cashier).cashierHide = false;
} else {
if (_local2.isFree == false){
return;
};
};
} else {
if (findWaiter(_arg1.targetObj) == null){
return;
};
_local2 = (findWaiter(_arg1.targetObj) as WaiterTwo);
};
if (((_local2.isFree) && (!((_local2 == null))))){
trace(("服务员的原客人::" + _local2.severGuest));
if (_local2.severGuest != null){
trace(("服务员的原客人::" + _local2.severGuest.name));
_local2.severGuest.getWaiter = false;
_local2.severGuest.waiter = null;
if (((!((_local2.severGuest.action == "tryClothes"))) && (!((_local2.severGuest.action == "seeClothes"))))){
_local2.severGuest.waiteWaiter = true;
};
_local2.severGuest = null;
};
_local2.isHaveGuest = true;
_local2.action = "beginFindGuest";
_local2.severGuest = (_arg1.targetObj as GuestTwo);
trace(((("现在的客人名字::" + _local2.severGuest.name) + "````````") + _local2.severGuest));
_local2.severGuest.waiter = _local2;
};
}
public function startGuestTime():void{
guestTime.start();
}
private function frameHandler(_arg1:Event):void{
if (guestNum > 0){
allGuestUpdate();
depthHandler();
};
if (_gameInterface.objArr.length <= 0){
trace("游戏结束后是否还在继续执行");
_gameInterface.objArr = null;
};
if (GameData.waiterNum == 0){
_gameInterface.hideDeskWoman(!(isShowCashier()));
};
_gameInterface.updateStatusBar();
if (_gameInterface.objArr == null){
trace("游戏结束后是否还在继续执行````````````````");
};
}
private function yesEndGame(_arg1:MouseEvent):void{
MySound.playBtnSound();
this.clearThing();
_gameInterface.levelUpRemoveObj();
clearIsEndGame();
this.dispatchEvent(new Event(YES_END_GAME));
}
private function clothesClick(_arg1:ClothesEvent):void{
var _local4:MovieClip;
if (!_objList["guest"]){
return;
};
if (this._objList["guest"].length <= 0){
return;
};
var _local2:Number = _arg1.number;
trace(("衣服旁边是否有人" + clothesHaveGuestArr[(_local2 - 1)]));
if (findGuestClothes(_local2) == null){
changeClothesWaiter(_local2);
return;
};
var _local3:GuestTwo = findGuestClothes(_local2);
if (clothesHaveGuestArr[(_local2 - 1)]){
trace("please waiting");
_local4 = new PleaseWaiting();
_gameInterface.addChild(_local4);
_local4.mouseEnabled = false;
_local4.x = (_local3.x - 10);
_local4.y = (_local3.y - 40);
pleaseWaitingArr.push(_local4);
TweenLite.to(_local4, 3, {alpha:0});
MySound.playSpecialSound("wait");
changeClothesWaiter(_local2);
return;
};
if (_local3.action == "waiteClickClothes"){
_local3.stopTime();
};
trace((("有衣服被电击了,客人和服务员准备响应LOCATION " + _local3.location) + "````````"));
_local3.action = "prepareGoClothes";
clothesHaveGuestArr[(_local2 - 1)] = true;
_local3.waiter.isFree = false;
changeClothesWaiter(_local2);
}
private function getGuest():void{
var _local1:GuestTwo;
guestNum++;
var _local2:Number = Math.floor(((Math.random() * 14) + 1));
if (_local2 == 1){
_local1 = new GuestTwo(GuestOne);
_local1.guestNum = 10;
} else {
if (_local2 == 2){
_local1 = new GuestTwo(GuestEr);
_local1.guestNum = 12;
} else {
if (_local2 == 3){
_local1 = new GuestTwo(GuestSan);
_local1.guestNum = 11;
} else {
if (_local2 == 4){
_local1 = new GuestTwo(GuestSi);
_local1.guestNum = 13;
} else {
if (_local2 == 5){
_local1 = new GuestTwo(GuestWu);
_local1.guestNum = 4;
} else {
if (_local2 == 6){
_local1 = new GuestTwo(GuestLiu);
_local1.guestNum = 5;
} else {
if (_local2 == 7){
_local1 = new GuestTwo(GuestQi);
_local1.guestNum = 6;
} else {
if (_local2 == 8){
_local1 = new GuestTwo(GuestBa);
_local1.guestNum = 14;
} else {
if (_local2 == 9){
_local1 = new GuestTwo(GuestJiu);
_local1.guestNum = 8;
} else {
if (_local2 == 10){
_local1 = new GuestTwo(GuestShi);
_local1.guestNum = 2;
} else {
if (_local2 == 11){
_local1 = new GuestTwo(GuestShiYi);
_local1.guestNum = 7;
} else {
if (_local2 == 12){
_local1 = new GuestTwo(GuestShiEr);
_local1.guestNum = 9;
} else {
if (_local2 == 13){
_local1 = new GuestTwo(GuestShiSan);
_local1.guestNum = 3;
} else {
if (_local2 == 14){
_local1 = new GuestTwo(GuestShiSi);
_local1.guestNum = 1;
};
};
};
};
};
};
};
};
};
};
};
};
};
};
_local1.location = "begin";
_local1.action = "chuchang";
_local1.name = ("guest" + guestNum);
_local1.scaleX = 0.95;
_local1.scaleY = 0.95;
_local1.setStage(_gameInterface, Game.guestInitX, Game.guestInitY);
_gameInterface.objArr.push(_local1);
_gameInterface.filterArr.push(_local1);
_local1.addEventListener(Guest.GUEST_CLICK, guestClickHandler);
_local1.addEventListener(GuestTwo.LEAVE_CHAIR, leaveChair);
_local1.addEventListener(GuestTwo.LEAVE_CLOTHES, leaveClothes);
_local1.addEventListener(GuestTwo.LEAVE_ROOM, leaveRoom);
addGuest(_local1);
chairGetGuest(_local1, chairHandler());
_local1.addEventListener(MouseEvent.ROLL_OVER, rollOver);
_local1.addEventListener(MouseEvent.ROLL_OUT, rollOut);
trace(((("关卡::::" + GameData.gameLevel) + "``````") + _local1.name));
MySound.playSpecialSound("menLing");
if ((((guestNum == 3)) && ((GameData.gameLevel <= 2)))){
isEndTime = true;
this.stopGuestTime();
trace("第1,2关限制死客人```");
};
}
public function removeGuestTime():void{
guestTime.stop();
guestTime.removeEventListener(TimerEvent.TIMER, timerHandler);
guestTime = null;
}
private function findGuestRoom(_arg1:Number):GuestTwo{
var _local2:int;
while (_local2 < this._objList["guest"].length) {
if (((((((!(_objList["guest"][_local2].getRoom)) && (!((_objList["guest"][_local2].waiter == null))))) && ((_objList["guest"][_local2].location == "clothes")))) && ((((_objList["guest"][_local2].action == "prepareGoRoom")) || ((_objList["guest"][_local2].action == "standAndHelloAngry")))))){
return ((_objList["guest"][_local2] as GuestTwo));
};
_local2++;
};
return (null);
}
private function findGuestClothes(_arg1:Number):GuestTwo{
var _local2:int;
while (_local2 < this._objList["guest"].length) {
if (((((((((!(_objList["guest"][_local2].outChair)) && ((_objList["guest"][_local2].clothesNum == _arg1)))) && (!((_objList["guest"][_local2].waiter == null))))) && (_objList["guest"][_local2].getWaiter))) && ((_objList["guest"][_local2].action == "waiteClickClothes")))){
return ((_objList["guest"][_local2] as GuestTwo));
};
_local2++;
};
return (null);
}
private function leaveRoom(_arg1:Event):void{
var _local2:GuestTwo = (_arg1.target as GuestTwo);
_gameInterface.roomArr[(_local2.roomNum - 1)].gotoAndStop(2);
_gameInterface.roomArr[(_local2.roomNum - 1)].isHaveGuest = false;
}
public function gameTimeEnd(_arg1:Event):void{
stopGuestTime();
isEndTime = true;
this.removeGuestTime();
_gameInterface.time.removeEventListener(Time.TIME_END, gameTimeEnd);
}
private function addGuest(_arg1:GuestTwo):void{
this.addObj(_arg1, "guest");
}
private function initGameInterface():void{
}
public function levelUp():void{
var _local1:Timer;
if (!isEndTime){
return;
};
if (_objList["guest"].length == 0){
trace("游戏结束");
this.removeEventListener(Event.ENTER_FRAME, frameHandler);
_gameInterface.isPause = true;
clearThing();
if (GameData.sellGold >= GameData.targetGoal){
_gameInterface.levelUpCom();
_gameInterface.levelUpRemoveObj();
trace("``````````````````");
_local1 = new Timer(2500, 1);
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, endGame);
_local1.start();
} else {
trace("你没有过关,游戏失败");
_gameInterface.levelUpRemoveObj();
this.dispatchEvent(new Event(END_GAME_FAIL));
};
if (clickPointOut != null){
_gameInterface.removeChild(clickPointOut);
clickPointOut = null;
_gameInterface.removeChild(clickMc);
clickMc = null;
};
};
}
private function leaveChair(_arg1:Event):void{
var _local2:GuestTwo = (_arg1.target as GuestTwo);
_gameInterface.chairArr[(_local2.chairNum - 1)].sitPersonBool = false;
trace(("客人离开了位置报错···" + isCeShi));
if (((!(isEndTime)) && (!(isCeShi)))){
this.startGuestTime();
};
}
private function timerHandler(_arg1:TimerEvent):void{
startGuestTimeNum = (startGuestTimeNum + 1000);
if (startGuestTimeNum <= guestTimeNum){
return;
};
startGuestTimeNum = 0;
var _local2:Boolean;
var _local3:int;
while (_local3 < _gameInterface.chairArr.length) {
if (!_gameInterface.chairArr[_local3].sitPersonBool){
_local2 = false;
};
_local3++;
};
if (_local2){
stopGuestTime();
return;
};
getGuest();
}
private function rollOut(_arg1:MouseEvent):void{
var _local2:int;
while (_local2 < _gameInterface.filterArr.length) {
_gameInterface.filterArr[_local2].filters = null;
_local2++;
};
}
private function clearThing():void{
var _local1:int;
var _local2:int;
var _local3:int;
this.removeEventListener(Event.ENTER_FRAME, frameHandler);
while (this._objList["waiter"].length > 0) {
_local1 = (this._objList["waiter"].length - 1);
while (_local1 >= 0) {
if ((this._objList["waiter"][_local1] is Cashier)){
_gameInterface.hideDeskWoman(!(isShowCashier()));
cashier = null;
};
this._objList["waiter"].splice(_local1, 1);
_local1--;
};
};
while (addMoneyArr.length > 0) {
_local2 = (addMoneyArr.length - 1);
while (_local2 >= 0) {
_gameInterface.removeChild(addMoneyArr[_local2]);
addMoneyArr.splice(_local2, 1);
_local2--;
};
};
while (pleaseWaitingArr.length > 0) {
_local3 = (pleaseWaitingArr.length - 1);
while (_local3 >= 0) {
_gameInterface.removeChild(pleaseWaitingArr[_local3]);
pleaseWaitingArr.splice(_local3, 1);
_local3--;
};
};
_gameInterface.isPause = true;
_gameInterface.removeEventListener(GameInterface.CLOTHES, clothesClick);
_gameInterface.removeEventListener(GameInterface.ROOM, roomClick);
_gameInterface.removeEventListener(GameInterface.DESK, deskClick);
_gameInterface.removeEventListener(GameInterface.PAUSE, pauseHandler);
_gameInterface.removeEventListener(GameInterface.BACK_MENU, backMenuHandler);
removeRoll();
}
private function addEndHelp():void{
endHelp = new EndHelp();
_gameInterface.addChild(endHelp);
endHelp.x = 350;
endHelp.y = -100;
TweenLite.to(endHelp, 0.2, {y:250, onComplete:endHelpHandler});
}
private function chairHandler():Number{
var _local1:int;
while (_local1 < _gameInterface.chairArr.length) {
if (!_gameInterface.chairArr[_local1].sitPersonBool){
return (_local1);
};
_local1++;
};
trace("座位已经坐满了");
return (-1);
}
private function addWaiter(_arg1:WaiterTwo):void{
this.addObj(_arg1, "waiter");
}
private function continerHandler(_arg1:MouseEvent):void{
MySound.playBtnSound();
pausePage.continue_btn.removeEventListener(MouseEvent.CLICK, continerHandler);
_gameInterface.removeChild(pausePage);
pausePage = null;
trace("继续了游戏");
jixu();
}
public function allGuestUpdate():void{
var _local3:GuestTwo;
var _local4:int;
var _local5:int;
var _local6:WaiterTwo;
var _local1:int;
while (_local1 < _objList["guest"].length) {
_local3 = _objList["guest"][_local1];
if (_local3.action == "removeGuest"){
this.removeObjByName(_local3.name, "guest");
_local4 = 0;
while (_local4 < _gameInterface.objArr.length) {
if (_gameInterface.objArr[_local4] == _local3){
_gameInterface.objArr.splice(_local4, 1);
};
_local4++;
};
_local5 = 0;
while (_local5 < _gameInterface.filterArr.length) {
if (_gameInterface.filterArr[_local4] == _local3){
_gameInterface.filterArr.splice(_local4, 1);
_local3.removeEventListener(MouseEvent.ROLL_OVER, rollOver);
_local3.removeEventListener(MouseEvent.ROLL_OUT, rollOut);
};
_local5++;
};
_local3.parent.removeChild(_local3);
if (isCeShi){
if (guestNum < 2){
this.getGuest();
} else {
isCeShi = false;
_gameInterface.removeEventListener(GameInterface.CLOTHES, clothesClick);
_gameInterface.removeEventListener(GameInterface.ROOM, roomClick);
_gameInterface.removeEventListener(GameInterface.DESK, deskClick);
_gameInterface.removeEventListener(GameInterface.PAUSE, pauseHandler);
_gameInterface.removeEventListener(GameInterface.BACK_MENU, backMenuHandler);
this.removeEventListener(Event.ENTER_FRAME, frameHandler);
addEndHelp();
return;
};
};
} else {
_local3.update();
};
_local1++;
};
var _local2:int;
while (_local2 < _objList["waiter"].length) {
_local6 = _objList["waiter"][_local2];
_local6.update();
_local2++;
};
levelUp();
}
private function findSettleGuest():GuestTwo{
var _local1:int;
while (_local1 < this._objList["guest"].length) {
if (((((!(_objList["guest"][_local1].getDesk)) && ((_objList["guest"][_local1].action == "prepareBuyClothes")))) && (!((_objList["guest"][_local1].waiter == null))))){
return ((_objList["guest"][_local1] as GuestTwo));
};
_local1++;
};
return (null);
}
private function roomClick(_arg1:RoomEvent):void{
if (!_objList["guest"]){
return;
};
if (this._objList["guest"].length <= 0){
return;
};
var _local2:Number = _arg1.number;
var _local3:MovieClip = _arg1.room;
if (findGuestRoom(_local2) == null){
return;
};
var _local4:GuestTwo = findGuestRoom(_local2);
if (((_local4.clothesNum) && ((_local4.location == "clothes")))){
clothesHaveGuestArr[(_local4.clothesNum - 1)] = false;
};
_local4.roomNum = _local2;
_local4.action = "beginGoRoom";
trace(("客人的房间" + _local3));
_local4.room = (_local3 as Room);
_local3.isHaveGuest = true;
trace("有房间被电击了,符合的客人去试衣间");
}
private function endHelpHandler():void{
TweenLite.to(endHelp, 1.5, {onComplete:startGame});
}
private function deskClick(_arg1:Event):void{
trace("点击桌子");
if (!_objList["guest"]){
return;
};
if (this._objList["guest"].length <= 0){
return;
};
if (findSettleGuest() == null){
return;
};
var _local2:GuestTwo = findSettleGuest();
if (((_local2.clothesNum) && ((_local2.location == "clothes")))){
trace("找到合适的客人准备去付账,并且把相应的衣服位置空出来");
clothesHaveGuestArr[(_local2.clothesNum - 1)] = false;
};
_local2.action = "prepareGoDesk";
}
private function rollOver(_arg1:MouseEvent):void{
var _local2:int;
while (_local2 < _gameInterface.filterArr.length) {
_gameInterface.filterArr[_local2].filters = null;
_local2++;
};
var _local3:GlowFilterExample = new GlowFilterExample((_arg1.target as Sprite));
}
public function stopGuestTime():void{
guestTime.stop();
}
private function noEndGame(_arg1:MouseEvent):void{
MySound.playBtnSound();
clearIsEndGame();
jixu();
}
private function startGame():void{
_gameInterface.removeChild(endHelp);
endHelp = null;
init();
}
private function removeRoll():void{
var _local2:Sprite;
var _local1:int;
while (_local1 < _gameInterface.filterArr.length) {
_local2 = (_gameInterface.filterArr[_local1] as Sprite);
_local2.removeEventListener(MouseEvent.ROLL_OVER, rollOver);
_local2.removeEventListener(MouseEvent.ROLL_OUT, rollOut);
_local1++;
};
}
private function addFilter():void{
var _local2:Sprite;
var _local1:int;
while (_local1 < _gameInterface.filterArr.length) {
_local2 = (_gameInterface.filterArr[_local1] as Sprite);
_local2.addEventListener(MouseEvent.ROLL_OVER, rollOver);
_local2.addEventListener(MouseEvent.ROLL_OUT, rollOut);
_local1++;
};
}
private function changeClothesWaiter(_arg1:Number):void{
var _local3:WaiterTwo;
var _local2:GuestTwo = findGuestClothesTwo(_arg1);
if (_local2 == null){
return;
};
if (_local2.waiter != null){
_local3 = _local2.waiter;
} else {
if (GameData.waiterNum <= 1){
_local3 = (_objList["waiter"][0] as WaiterTwo);
if ((_local3 is Cashier)){
if (_local3.isFree == false){
return;
};
(_local3 as Cashier).cashierHide = false;
} else {
if (_local3.isFree == false){
return;
};
};
} else {
if (findWaiter(_local2) == null){
return;
};
_local3 = (findWaiter(_local2) as WaiterTwo);
};
};
if (((!((_local2 == null))) && (!((_local3 == null))))){
if (((_local3.isFree) && (!((_local3 == null))))){
trace(("服务员的原客人::" + _local3.severGuest));
if (_local3.severGuest != null){
trace(("服务员的原客人::" + _local3.severGuest.name));
_local3.severGuest.getWaiter = false;
_local3.severGuest.waiter = null;
if (((!((_local3.severGuest.action == "tryClothes"))) && (!((_local3.severGuest.action == "seeClothes"))))){
_local3.severGuest.waiteWaiter = true;
};
_local3.severGuest = null;
};
_local3.isHaveGuest = true;
_local3.action = "beginFindGuest";
_local3.severGuest = (_local2 as GuestTwo);
trace(((("现在的客人名字::" + _local3.severGuest.name) + "````````") + _local3.severGuest));
_local3.severGuest.waiter = _local3;
_local3.severGuest.action = "haveChangeClothes";
};
};
}
private function findWaiter(_arg1:DisplayObject):WaiterTwo{
var _local3:WaiterTwo;
var _local4:Point;
var _local5:Number;
var _local6:DisplayObject;
var _local10:Number;
var _local2:Point = new Point(_arg1.x, _arg1.y);
var _local7:Number = -11;
var _local8:Boolean;
var _local9:int;
while (_local9 < _objList["waiter"].length) {
_local3 = (_objList["waiter"][_local9] as WaiterTwo);
if (!_local3.isFree){
} else {
if (!_local3.isHaveGuest){
if (!_local8){
_local8 = true;
if (_local7 >= 0){
_local7 = -11;
};
};
_local4 = new Point(_local3.x, _local3.y);
_local10 = Point.distance(_local2, _local4);
if (_local7 < 0){
_local7 = _local9;
_local5 = _local10;
_local6 = _local3;
} else {
if (_local10 <= _local5){
_local5 = _local10;
_local6 = _local3;
};
};
} else {
if (_local8){
} else {
_local4 = new Point(_local3.x, _local3.y);
_local10 = Point.distance(_local2, _local4);
if (_local7 < 0){
_local7 = _local9;
_local5 = _local10;
_local6 = _local3;
} else {
if (_local10 <= _local5){
_local5 = _local10;
_local6 = _local3;
};
};
};
};
};
_local9++;
};
trace(("距离最短的服务员" + _local6));
if (_local6 == null){
return (null);
};
return ((_local6 as WaiterTwo));
}
public function isShowCashier():Boolean{
if (cashier == null){
return (false);
};
if (cashier.isCashierAndWaiter){
if (cashier.cashierHide){
cashier.visible = false;
} else {
cashier.visible = true;
};
} else {
return (false);
};
return (cashier.visible);
}
private function zuobi():void{
_gameInterface.stage.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
}
public static function hidePointOut():void{
if (clickPointOut != null){
clickPointOut.visible = false;
clickMc.visible = false;
clickMc.rotation = 0;
};
}
public static function showPointOut(_arg1:Number, _arg2:Number, _arg3:Number):void{
if (clickPointOut != null){
clickPointOut.visible = true;
clickPointOut.x = 0;
clickPointOut.y = 0;
clickPointOut.gotoAndStop(_arg3);
_gameInterface.setChildIndex(clickPointOut, (_gameInterface.numChildren - 1));
trace("显示提示框");
};
}
}
}//package game
Section 16
//GameWorld (game.GameWorld)
package game {
import flash.display.*;
import element.*;
public class GameWorld extends Sprite {
public var _objList:Array;
public function GameWorld(){
_objList = new Array();
}
public function removeObj(_arg1:DisplayObject, _arg2:String):void{
var _local3:int;
while (_local3 < _objList[_arg2].length) {
if (_objList[_arg2][_local3] == _arg1){
removeChild(_arg1);
_objList[_arg2].splice(_local3, 1);
};
_local3++;
};
}
public function removeObjByName(_arg1:String, _arg2:String):void{
var _local3:int;
while (_local3 < _objList[_arg2].length) {
if (_objList[_arg2][_local3].name == _arg1){
_objList[_arg2].splice(_local3, 1);
};
_local3++;
};
}
public function addObj(_arg1:DisplayObject, _arg2:String):void{
if (!_objList[_arg2]){
_objList[_arg2] = [];
};
_objList[_arg2].push(_arg1);
}
protected function findByName(_arg1:String, _arg2:String):Person{
var _local3:int;
while (_local3 < _objList[_arg2].length) {
if (_objList[_arg2][_local3].name == _arg1){
return (_objList[_arg2][_local3]);
};
_local3++;
};
return (null);
}
}
}//package game
Section 17
//GlowFilterExample (my.GlowFilterExample)
package my {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
public class GlowFilterExample extends Sprite {
private var size:uint;// = 80
private var offset:uint;// = 50
private var s:Sprite;
private var bgColor:uint;// = 0xFFCC00
public function GlowFilterExample(_arg1:Sprite){
s = _arg1;
var _local2:BitmapFilter = getBitmapFilter();
var _local3:Array = new Array();
_local3.push(_local2);
s.filters = _local3;
}
private function getBitmapFilter():BitmapFilter{
var _local1:Number = 13515065;
var _local2:Number = 1;
var _local3:Number = 5;
var _local4:Number = 5;
var _local5:Number = 5;
var _local6:Boolean;
var _local7:Boolean;
var _local8:Number = BitmapFilterQuality.HIGH;
return (new GlowFilter(_local1, _local2, _local3, _local4, _local5, _local8, _local6, _local7));
}
private function hs(_arg1:MouseEvent):void{
s.filters = null;
}
}
}//package my
Section 18
//MySound (my.MySound)
package my {
import flash.media.*;
public class MySound {
public static var specialSoundChannel:SoundChannel;
public static var btnSound:Sound;
public static var specialSound:Sound;
public static var soundBool:Boolean;
public static var allSoundTransform:SoundTransform;
public static var backSoundTrans:SoundTransform;
public static var backSound:Sound;
public static var backSoundStr:String;
public static var btnSoundChannel:SoundChannel;
public static var backSoundChannel:SoundChannel;
public static function lessBackSound():void{
if (!soundBool){
return;
};
if (backSoundTrans.volume > 0){
backSoundTrans.volume = (backSoundTrans.volume - 0.0025);
backSoundChannel.soundTransform = backSoundTrans;
} else {
backSoundTrans.volume = 0;
backSoundChannel.soundTransform = backSoundTrans;
};
}
public static function playBackSound(_arg1:String):void{
if (!soundBool){
return;
};
if (((!((backSound == null))) && (!((backSoundChannel == null))))){
backSoundChannel.stop();
backSoundChannel = null;
backSound = null;
};
if (_arg1 == "beginGame"){
backSound = new BeginSound();
backSoundChannel = backSound.play(0, 999);
} else {
if (_arg1 == "atGame"){
backSound = new BackSound();
backSoundChannel = backSound.play(0, 999);
} else {
if (_arg1 == "buyThing"){
trace("播发买东西的背景音乐");
backSound = new BuyThingSound();
backSoundChannel = backSound.play(0, 999);
} else {
if (_arg1 == "winGame"){
backSound = new WinBackSound();
backSoundChannel = backSound.play(0, 999);
} else {
if (_arg1 == "failGame"){
backSound = new FailBackSound();
backSoundChannel = backSound.play(0, 999);
} else {
if (_arg1 == "levelUpSound"){
backSound = new LevelUpSound();
backSoundChannel = backSound.play(0, 1);
};
};
};
};
};
};
backSoundStr = _arg1;
backSoundTrans = backSoundChannel.soundTransform;
backSoundTrans.volume = 1;
backSoundChannel.soundTransform = backSoundTrans;
}
public static function playSpecialSound(_arg1:String):void{
var _local2:SoundTransform;
var _local3:SoundTransform;
var _local4:SoundTransform;
var _local5:SoundTransform;
if (!soundBool){
return;
};
if (_arg1 == "hello"){
specialSound = new Hello();
specialSoundChannel = specialSound.play();
} else {
if (_arg1 == "helloTwo"){
specialSound = new HelloTwo();
specialSoundChannel = specialSound.play();
} else {
if (_arg1 == "goodBye"){
specialSound = new GoodBye();
specialSoundChannel = specialSound.play();
_local2 = specialSoundChannel.soundTransform;
_local2.volume = 0.5;
specialSoundChannel.soundTransform = _local2;
} else {
if (_arg1 == "hiThere"){
specialSound = new HiThere();
specialSoundChannel = specialSound.play();
} else {
if (_arg1 == "ok"){
specialSound = new OK();
specialSoundChannel = specialSound.play();
} else {
if (_arg1 == "print"){
specialSound = new PrintInvoice();
specialSoundChannel = specialSound.play();
} else {
if (_arg1 == "mayIHelpYou"){
specialSound = new MayIHelpYou();
specialSoundChannel = specialSound.play();
_local3 = specialSoundChannel.soundTransform;
_local3.volume = 0.2;
specialSoundChannel.soundTransform = _local3;
} else {
if (_arg1 == "waitress"){
specialSound = new Waitress();
specialSoundChannel = specialSound.play();
} else {
if (_arg1 == "wait"){
specialSound = new Wait();
specialSoundChannel = specialSound.play();
} else {
if (_arg1 == "menMian"){
specialSound = new MenMian();
specialSoundChannel = specialSound.play();
} else {
if (_arg1 == "buyThis"){
specialSound = new BuyThis();
specialSoundChannel = specialSound.play();
_local4 = specialSoundChannel.soundTransform;
_local4.volume = 0.5;
specialSoundChannel.soundTransform = _local4;
} else {
if (_arg1 == "getThing"){
specialSound = new GetThing();
specialSoundChannel = specialSound.play();
} else {
if (_arg1 == "changeNight"){
specialSound = new ChangeNight();
specialSoundChannel = specialSound.play();
} else {
if (_arg1 == "mayITryOn"){
specialSound = new MayITryOn();
specialSoundChannel = specialSound.play();
} else {
if (_arg1 == "menLing"){
specialSound = new MenLing();
specialSoundChannel = specialSound.play();
_local5 = specialSoundChannel.soundTransform;
_local5.volume = 0.6;
specialSoundChannel.soundTransform = _local5;
};
};
};
};
};
};
};
};
};
};
};
};
};
};
};
}
public static function playBuyThingSound():void{
if (!soundBool){
return;
};
}
public static function playBtnSound():void{
if (soundBool){
btnSound = new BtnSound();
btnSound.play();
};
}
public static function stopOrPlaySound():void{
if (soundBool){
backSoundTrans = backSoundChannel.soundTransform;
backSoundTrans.volume = 1;
trace("游戏打开声音");
backSoundChannel.soundTransform = backSoundTrans;
} else {
backSoundTrans = backSoundChannel.soundTransform;
backSoundTrans.volume = 0;
trace("游戏静音");
backSoundChannel.soundTransform = backSoundTrans;
};
}
}
}//package my
Section 19
//StringHandler (my.StringHandler)
package my {
public class StringHandler {
public static function strChangNum(_arg1:String):Number{
var _local2:RegExp = /\d/igx;
var _local3:Number = Number(_arg1.match(_local2).join(""));
return (_local3);
}
public static function strLossNum(_arg1:String):String{
var _local2:RegExp = /\d+/g;
var _local3:String = _arg1.replace(_local2, "");
return (_local3);
}
}
}//package my
Section 20
//AStar (util.astar.AStar)
package util.astar {
public class AStar {
private var _path:Array;
private var _startNode:Node;
private var _straightCost:Number;// = 1
private var _closed:Array;
private var _endNode:Node;
private var _heuristic:Function;
private var _grid:Grid;
private var _open:Array;
private var _diagCost:Number;// = 1.4142135623731
public function AStar(){
_heuristic = manhattan;
super();
}
private function manhattan(_arg1:Node):Number{
return (((Math.abs((_arg1.x - _endNode.x)) * _straightCost) + (Math.abs((_arg1.y + _endNode.y)) * _straightCost)));
}
private function isOpen(_arg1:Node):Boolean{
var _local2:int;
while (_local2 < _open.length) {
if (_open[_local2] == _arg1){
return (true);
};
_local2++;
};
return (false);
}
private function euclidian(_arg1:Node):Number{
var _local2:Number = (_arg1.x - _endNode.x);
var _local3:Number = (_arg1.y - _endNode.y);
return ((Math.sqrt(((_local2 * _local2) + (_local3 * _local3))) * _straightCost));
}
public function search():Boolean{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:Node;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local1:Node = _startNode;
while (_local1 != _endNode) {
_local2 = Math.max(0, (_local1.x - 1));
_local3 = Math.min((_grid.numCols - 1), (_local1.x + 1));
_local4 = Math.max(0, (_local1.y - 1));
_local5 = Math.min((_grid.numRows - 1), (_local1.y + 1));
_local6 = _local2;
while (_local6 <= _local3) {
_local8 = _local4;
while (_local8 <= _local5) {
if (((((((((((_local6 + 1) == _local1.x)) && (((_local8 + 1) == _local1.y)))) || (((((_local6 - 1) == _local1.x)) && (((_local8 + 1) == _local1.y)))))) || (((((_local6 - 1) == _local1.x)) && (((_local8 - 1) == _local1.y)))))) || (((((_local6 + 1) == _local1.x)) && (((_local8 - 1) == _local1.y)))))){
} else {
_local9 = _grid.getNode(_local6, _local8);
if ((((((((_local9 == _local1)) || (!(_local9.walkable)))) || (!(_grid.getNode(_local1.x, _local9.y).walkable)))) || (!(_grid.getNode(_local9.x, _local1.y).walkable)))){
} else {
_local10 = _straightCost;
if (!(((_local1.x == _local9.x)) || ((_local1.y == _local9.y)))){
_local10 = _diagCost;
};
_local11 = (_local1.g + (_local10 * _local9.costMultiplier));
_local12 = _heuristic(_local9);
_local13 = (_local11 + _local12);
if (((isOpen(_local9)) || (isClosed(_local9)))){
if (_local9.f > _local13){
_local9.f = _local13;
_local9.g = _local11;
_local9.h = _local12;
_local9.parent = _local1;
};
} else {
_local9.f = _local13;
_local9.g = _local11;
_local9.h = _local12;
_local9.parent = _local1;
_open.push(_local9);
};
};
};
_local8++;
};
_local6++;
};
_local7 = 0;
while (_local7 < _open.length) {
_local7++;
};
_closed.push(_local1);
if (_open.length == 0){
trace("no path found");
return (false);
};
_open.sortOn("f", Array.NUMERIC);
_local1 = (_open.shift() as Node);
};
buildPath();
return (true);
}
public function get visited():Array{
return (_closed.concat(_open));
}
public function get path():Array{
return (_path);
}
private function diagonal(_arg1:Node):Number{
var _local2:Number = Math.abs((_arg1.x - _endNode.x));
var _local3:Number = Math.abs((_arg1.y - _endNode.y));
var _local4:Number = Math.min(_local2, _local3);
var _local5:Number = (_local2 + _local3);
return (((_diagCost * _local4) + (_straightCost * (_local5 - (2 * _local4)))));
}
private function isClosed(_arg1:Node):Boolean{
var _local2:int;
while (_local2 < _closed.length) {
if (_closed[_local2] == _arg1){
return (true);
};
_local2++;
};
return (false);
}
private function buildPath():void{
_path = new Array();
var _local1:Node = _endNode;
_path.push(_local1);
while (_local1 != _startNode) {
_local1 = _local1.parent;
_path.unshift(_local1);
};
}
public function findPath(_arg1:Grid):Boolean{
_grid = _arg1;
_open = new Array();
_closed = new Array();
_startNode = _grid.startNode;
_endNode = _grid.endNode;
_startNode.g = 0;
_startNode.h = _heuristic(_startNode);
_startNode.f = (_startNode.g + _startNode.h);
return (search());
}
}
}//package util.astar
Section 21
//Grid (util.astar.Grid)
package util.astar {
public class Grid {
private var _numRows:int;
private var _startNode:Node;
private var _nodes:Array;
private var _numCols:int;
private var _endNode:Node;
public function Grid(_arg1:int, _arg2:int){
var _local4:int;
super();
_numCols = _arg1;
_numRows = _arg2;
_nodes = new Array();
var _local3:int;
while (_local3 < _numCols) {
_nodes[_local3] = new Array();
_local4 = 0;
while (_local4 < _numRows) {
_nodes[_local3][_local4] = new Node(_local3, _local4);
_local4++;
};
_local3++;
};
}
public function setStartNode(_arg1:int, _arg2:int):void{
_startNode = (_nodes[_arg1][_arg2] as Node);
}
public function get startNode():Node{
return (_startNode);
}
public function setWalkable(_arg1:int, _arg2:int, _arg3:Boolean):void{
_nodes[_arg1][_arg2].walkable = _arg3;
}
public function getNode(_arg1:int, _arg2:int):Node{
return ((_nodes[_arg1][_arg2] as Node));
}
public function get numCols():int{
return (_numCols);
}
public function setEndNode(_arg1:int, _arg2:int):void{
_endNode = (_nodes[_arg1][_arg2] as Node);
}
public function get endNode():Node{
return (_endNode);
}
public function get numRows():int{
return (_numRows);
}
}
}//package util.astar
Section 22
//Node (util.astar.Node)
package util.astar {
public class Node {
public var walkable:Boolean;// = true
public var g:Number;
public var h:Number;
public var parent:Node;
public var f:Number;
public var costMultiplier:Number;// = 1
public var x:int;
public var y:int;
public function Node(_arg1:int, _arg2:int){
this.x = _arg1;
this.y = _arg2;
}
}
}//package util.astar
Section 23
//AddGoldMoney (util.AddGoldMoney)
package util {
import flash.display.*;
import com.greensock.*;
import flash.text.*;
public class AddGoldMoney extends MovieClip {
public var money_txt:TextField;
private var initX:Number;
private var initY:Number;
public function AddGoldMoney(_arg1:Number, _arg2:DisplayObjectContainer, _arg3:Number, _arg4:Number){
this.money_txt.text = ("+" + _arg1.toString());
_arg2.addChild(this);
this.x = _arg3;
this.y = _arg4;
initX = _arg3;
initY = _arg4;
TweenLite.to(this, 3, {y:(initY - 50), alpha:0});
}
}
}//package util
Section 24
//BuyThingPage (util.BuyThingPage)
package util {
import flash.display.*;
import com.greensock.*;
import flash.events.*;
import flash.utils.*;
import my.*;
import data.*;
public class BuyThingPage extends MovieClip {
public var coin_mc:MovieClip;
public var buyLight_mc:MovieClip;
public var next_btn:SimpleButton;
public var buyClothes_mc:MovieClip;
public var buyFlower_mc:MovieClip;
public var cancel_btn:SimpleButton;
private var thingGoldArr:Array;
public var buyRoom_mc:MovieClip;
private var showSoldOutArr:Array;
public var buy_btn:MovieClip;
private var soldOutArr:Array;
public var buyWaiter_mc:MovieClip;
private var currentBuyThingPrice:Number;
public var buyThingArr:Array;
public var noMoney_mc:MovieClip;
public var buyRug_mc:MovieClip;
private var pointOutGoldArr:Array;
private var lastX:Number;
private var lastY:Number;
public var myGoldArr:Array;
public var buyDesk_mc:MovieClip;
public var soldOut1:SoldOut;
public var soldOut2:SoldOut;
public var soldOut3:SoldOut;
public var soldOut4:SoldOut;
public var soldOut5:SoldOut;
public var soldOut6:SoldOut;
public var soldOut7:SoldOut;
public var soldOut8:SoldOut;
public var soldOut9:SoldOut;
private var currentBuyThing:MovieClip;
public var __id2_:MovieClip;
public var buyWall_mc:MovieClip;
public var introduceThing_mc:MovieClip;
private var currentBuyThingName:String;
public var pointOut_mc:MovieClip;
private var lastIndex:Number;
public var buyChair_mc:MovieClip;
public static const LEVEL_UP_BEGIN:String = "level_up_begin";
public static var waiterNumMax:Number = 3;
public static var chairNumMax:Number = 6;
public static var clothesNumMax:Number = 6;
public static var roomNumMax:Number = 9;
public function BuyThingPage(){
buyThingArr = new Array();
myGoldArr = new Array();
thingGoldArr = new Array();
pointOutGoldArr = new Array();
soldOutArr = new Array();
var _local1 = 1;
while (_local1 <= 9) {
this[("soldOut" + _local1)].visible = false;
soldOutArr.push(this[("soldOut" + _local1)]);
_local1++;
};
initMyGold();
__setProp___id2__();
}
private function pricePointOut():void{
next_btn.removeEventListener(MouseEvent.CLICK, nextLevelHandler);
buy_btn.removeEventListener(MouseEvent.CLICK, buyHandler);
cancel_btn.removeEventListener(MouseEvent.CLICK, cancelHandler);
this.setChildIndex(pointOut_mc, (this.numChildren - 1));
TweenLite.to(pointOut_mc, 0.2, {y:150, onComplete:pointOutEnd});
NumberHandlerTwo.getNumber(currentBuyThingPrice, this.pointOutGoldArr);
}
private function initShowNum():void{
buyFlower_mc.yuNum_mc.num_mc.gotoAndStop((2 - GameData.flowerLevel));
buyFlower_mc.soldOut = soldOut1;
buyChair_mc.yuNum_mc.num_mc.gotoAndStop((7 - GameData.chairNum));
buyChair_mc.soldOut = soldOut2;
buyDesk_mc.yuNum_mc.num_mc.gotoAndStop((3 - GameData.deskLevel));
buyDesk_mc.soldOut = soldOut3;
if (GameData.lightBool){
buyLight_mc.yuNum_mc.num_mc.gotoAndStop(1);
} else {
buyLight_mc.yuNum_mc.num_mc.gotoAndStop(2);
};
buyLight_mc.soldOut = soldOut4;
buyRug_mc.yuNum_mc.num_mc.gotoAndStop((3 - GameData.ditanLevel));
buyRug_mc.soldOut = soldOut5;
buyRoom_mc.yuNum_mc.num_mc.gotoAndStop((10 - GameData.roomNum));
buyRoom_mc.soldOut = soldOut6;
buyWall_mc.yuNum_mc.num_mc.gotoAndStop((3 - GameData.wallLevel));
buyWall_mc.soldOut = soldOut9;
buyWaiter_mc.yuNum_mc.num_mc.gotoAndStop((4 - GameData.waiterNum));
buyWaiter_mc.soldOut = soldOut7;
buyClothes_mc.yuNum_mc.num_mc.gotoAndStop((7 - GameData.clothesLevel));
buyClothes_mc.soldOut = soldOut8;
}
private function buyRug(_arg1:MouseEvent):void{
MySound.playBtnSound();
var _local2:MovieClip = (_arg1.currentTarget as MovieClip);
buyThing(_local2, GameData.rugGold, "rug");
}
public function init():void{
introduceThing_mc.visible = false;
noMoney_mc.visible = false;
buy_btn.visible = false;
cancel_btn.visible = false;
NumberHandlerTwo.getNumber(GameData.totalGold, myGoldArr);
initAlpha();
addMouseEvent();
next_btn.addEventListener(MouseEvent.CLICK, nextLevelHandler);
}
private function buyThingHandler(_arg1:String):void{
trace(_arg1);
MySound.playSpecialSound("getThing");
switch (_arg1){
case "flower":
GameData.levelUpSellPrice(GameData.flowerLevelUp);
break;
case "desk":
GameData.levelUpSellPrice(GameData.deskLevelUp);
break;
case "rug":
GameData.levelUpSellPrice(GameData.rugLevelUp);
break;
case "wall":
GameData.levelUpSellPrice(GameData.wallLevelUp);
break;
default:
break;
};
}
private function initAlpha():void{
initShowNum();
if (GameData.flowerLevel >= 1){
buyFlower_mc.soldOut.visible = true;
buyFlower_mc.alpha = 0.3;
};
if (GameData.chairNum >= 6){
buyChair_mc.soldOut.visible = true;
buyChair_mc.alpha = 0.3;
};
if (GameData.deskLevel >= 2){
buyDesk_mc.soldOut.visible = true;
buyDesk_mc.alpha = 0.3;
};
if (GameData.lightBool){
buyLight_mc.soldOut.visible = true;
buyLight_mc.alpha = 0.3;
};
if (GameData.ditanLevel >= 2){
buyRug_mc.soldOut.visible = true;
buyRug_mc.alpha = 0.3;
};
if (GameData.roomNum >= 9){
buyRoom_mc.soldOut.visible = true;
buyRoom_mc.alpha = 0.3;
};
if (GameData.wallLevel >= 2){
buyWall_mc.soldOut.visible = true;
buyWall_mc.alpha = 0.3;
};
if (GameData.waiterNum >= 3){
buyWaiter_mc.waiter_mc.gotoAndStop(3);
buyWaiter_mc.alpha = 0.3;
buyWaiter_mc.soldOut.visible = true;
} else {
if ((((GameData.waiterNum < 3)) && ((GameData.waiterNum > 0)))){
buyWaiter_mc.waiter_mc.gotoAndStop((GameData.waiterNum + 1));
} else {
buyWaiter_mc.waiter_mc.gotoAndStop(1);
};
};
if ((((GameData.clothesLevel >= 0)) && ((GameData.clothesLevel < 6)))){
buyClothes_mc.clothes_mc.gotoAndStop((GameData.clothesLevel + 7));
trace("当前要买的衣服在第几帧");
} else {
buyClothes_mc.clothes_mc.gotoAndStop(12);
buyClothes_mc.alpha = 0.3;
buyClothes_mc.soldOut.visible = true;
};
}
private function buyLight(_arg1:MouseEvent):void{
MySound.playBtnSound();
var _local2:MovieClip = (_arg1.currentTarget as MovieClip);
buyThing(_local2, GameData.lightGold, "light");
}
private function limitTime(_arg1:String):Boolean{
if (_arg1 == "flower"){
if (GameData.flowerLevel >= 1){
return (true);
};
} else {
if (_arg1 == "desk"){
if (GameData.deskLevel >= 2){
return (true);
};
} else {
if (_arg1 == "light"){
if (GameData.lightBool){
return (true);
};
} else {
if (_arg1 == "rug"){
if (GameData.ditanLevel >= 2){
return (true);
};
} else {
if (_arg1 == "wall"){
if (GameData.wallLevel >= 2){
return (true);
};
} else {
if (_arg1 == "waiter"){
if (GameData.waiterNum >= 3){
return (true);
};
} else {
if (_arg1 == "clothes"){
if (GameData.clothesLevel >= 6){
return (true);
};
} else {
if (_arg1 == "room"){
if (GameData.roomNum >= 9){
return (true);
};
} else {
if (_arg1 == "chair"){
if (GameData.chairNum >= 6){
return (true);
};
};
};
};
};
};
};
};
};
};
return (false);
}
private function buyWaiter(_arg1:MouseEvent):void{
MySound.playBtnSound();
var _local2:MovieClip = (_arg1.currentTarget as MovieClip);
buyThing(_local2, GameData.waiterGold, "waiter");
}
private function buyThingCom():void{
this.setChildIndex(currentBuyThing, lastIndex);
currentBuyThingName = "";
currentBuyThingPrice = 0;
isHideThing(false);
showAllBuyThing();
}
public function initMyGold():void{
var _local1 = 1;
while (_local1 <= 6) {
this.coin_mc[("mc" + _local1)].stop();
myGoldArr.push(this.coin_mc[("mc" + _local1)]);
this.introduceThing_mc[("mc" + _local1)].stop();
thingGoldArr.push(this.introduceThing_mc[("mc" + _local1)]);
this.pointOut_mc[("mc" + _local1)].stop();
pointOutGoldArr.push(this.pointOut_mc[("mc" + _local1)]);
_local1++;
};
}
private function pointOutEnd():void{
var _local1:Timer = new Timer(1000, 1);
_local1.addEventListener(TimerEvent.TIMER_COMPLETE, timeCom);
_local1.start();
}
private function buyDesk(_arg1:MouseEvent):void{
MySound.playBtnSound();
var _local2:MovieClip = (_arg1.currentTarget as MovieClip);
buyThing(_local2, GameData.deskGold, "desk");
}
private function buyThing(_arg1:MovieClip, _arg2:Number, _arg3:String):void{
currentBuyThingPrice = _arg2;
currentBuyThingName = _arg3;
currentBuyThing = _arg1;
clickHandler(_arg1);
this.setChildIndex(_arg1, (this.numChildren - 1));
TweenLite.to(_arg1, 0.5, {x:330, y:180, scaleX:2, scaleY:2});
NumberHandler.getNumber(_arg2, thingGoldArr);
var _local4:int;
while (_local4 < this.soldOutArr.length) {
soldOutArr[_local4].visible = false;
_local4++;
};
switch (_arg3){
case "flower":
introduceThing_mc.gotoAndStop(1);
break;
case "chair":
introduceThing_mc.gotoAndStop(3);
break;
case "desk":
introduceThing_mc.gotoAndStop(2);
break;
case "light":
introduceThing_mc.gotoAndStop(4);
break;
case "rug":
introduceThing_mc.gotoAndStop(5);
break;
case "room":
introduceThing_mc.gotoAndStop(6);
break;
case "waiter":
introduceThing_mc.gotoAndStop(7);
break;
case "clothes":
introduceThing_mc.gotoAndStop(8);
break;
case "wall":
introduceThing_mc.gotoAndStop(9);
break;
default:
break;
};
}
private function cancelHandler(_arg1:MouseEvent):void{
TweenLite.to(currentBuyThing, 0.5, {x:lastX, y:lastY, scaleX:1, scaleY:1});
currentBuyThingName = "";
currentBuyThingPrice = 0;
isHideThing(false);
showAllBuyThing();
}
private function timeCom(_arg1:TimerEvent):void{
_arg1.target.removeEventListener(TimerEvent.TIMER_COMPLETE, timeCom);
next_btn.addEventListener(MouseEvent.CLICK, nextLevelHandler);
buy_btn.addEventListener(MouseEvent.CLICK, buyHandler);
cancel_btn.addEventListener(MouseEvent.CLICK, cancelHandler);
TweenLite.to(pointOut_mc, 0.2, {y:-250});
GameData.totalGold = (GameData.totalGold - currentBuyThingPrice);
gameInterfaceDataChange(currentBuyThingName);
NumberHandlerTwo.getNumber(GameData.totalGold, myGoldArr);
trace(("当qian买的东西:::" + currentBuyThingName));
trace(limitTime(currentBuyThingName));
buyThingHandler(currentBuyThingName);
if (!limitTime(currentBuyThingName)){
return;
};
currentBuyThing.alpha = 0.3;
TweenLite.to(currentBuyThing, 0.5, {x:lastX, y:lastY, scaleX:1, scaleY:1, onComplete:buyThingCom});
}
private function addMouseEvent():void{
buyFlower_mc.addEventListener(MouseEvent.CLICK, buyFlower);
buyChair_mc.addEventListener(MouseEvent.CLICK, buyChair);
buyDesk_mc.addEventListener(MouseEvent.CLICK, buyDesk);
buyLight_mc.addEventListener(MouseEvent.CLICK, buyLight);
buyRug_mc.addEventListener(MouseEvent.CLICK, buyRug);
buyRoom_mc.addEventListener(MouseEvent.CLICK, buyRoom);
buyWaiter_mc.addEventListener(MouseEvent.CLICK, buyWaiter);
buyClothes_mc.addEventListener(MouseEvent.CLICK, buyClothes);
buyWall_mc.addEventListener(MouseEvent.CLICK, buyWall);
buyFlower_mc.mouseChildren = false;
buyChair_mc.mouseChildren = false;
buyDesk_mc.mouseChildren = false;
buyLight_mc.mouseChildren = false;
buyRug_mc.mouseChildren = false;
buyRoom_mc.mouseChildren = false;
buyWaiter_mc.mouseChildren = false;
buyClothes_mc.mouseChildren = false;
buyWall_mc.mouseChildren = false;
buyThingArr.push(buyFlower_mc);
buyThingArr.push(buyChair_mc);
buyThingArr.push(buyDesk_mc);
buyThingArr.push(buyLight_mc);
buyThingArr.push(buyRug_mc);
buyThingArr.push(buyRoom_mc);
buyThingArr.push(buyWaiter_mc);
buyThingArr.push(buyClothes_mc);
buyThingArr.push(buyWall_mc);
var _local1:int;
while (_local1 < buyThingArr.length) {
if (buyThingArr[_local1].alpha < 0.4){
buyThingArr[_local1].mouseChildren = false;
buyThingArr[_local1].mouseEnabled = false;
buyThingArr[_local1].buttonMode = false;
} else {
buyThingArr[_local1].buttonMode = true;
};
_local1++;
};
buy_btn.addEventListener(MouseEvent.CLICK, buyHandler);
cancel_btn.addEventListener(MouseEvent.CLICK, cancelHandler);
}
private function buyWall(_arg1:MouseEvent):void{
MySound.playBtnSound();
var _local2:MovieClip = (_arg1.currentTarget as MovieClip);
buyThing(_local2, GameData.wallGold, "wall");
}
function __setProp___id2__(){
try {
__id2_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id2_.Type = "logo-ingame";
__id2_.Goto = 1;
try {
__id2_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
private function buyFlower(_arg1:MouseEvent):void{
MySound.playBtnSound();
var _local2:MovieClip = (_arg1.currentTarget as MovieClip);
buyThing(_local2, GameData.flowerGold, "flower");
}
private function buyRoom(_arg1:MouseEvent):void{
MySound.playBtnSound();
var _local2:MovieClip = (_arg1.currentTarget as MovieClip);
buyThing(_local2, GameData.roomGold, "room");
}
private function showAllBuyThing():void{
var _local1:int;
while (_local1 < this.buyThingArr.length) {
buyThingArr[_local1].visible = true;
if (buyThingArr[_local1].alpha <= 0.4){
buyThingArr[_local1].mouseChildren = false;
buyThingArr[_local1].mouseEnabled = false;
buyThingArr[_local1].buttonMode = false;
buyThingArr[_local1].soldOut.visible = true;
buyThingArr[_local1].soldOut.alpha = 1;
} else {
buyThingArr[_local1].mouseChildren = true;
buyThingArr[_local1].mouseEnabled = true;
buyThingArr[_local1].buttonMode = true;
buyThingArr[_local1].soldOut.visible = false;
};
_local1++;
};
isHideThing(false);
}
private function clickHandler(_arg1:MovieClip):void{
lastX = _arg1.x;
lastY = _arg1.y;
var _local2:int;
while (_local2 < this.buyThingArr.length) {
if (buyThingArr[_local2].name != _arg1.name){
buyThingArr[_local2].visible = false;
} else {
_arg1.visible = true;
_arg1.mouseChildren = false;
_arg1.mouseEnabled = false;
_arg1.buttonMode = false;
};
_local2++;
};
isHideThing(true);
lastIndex = this.getChildIndex(_arg1);
}
private function nextLevelHandler(_arg1:MouseEvent):void{
MySound.playBtnSound();
trace("下一关开始");
noMoney_mc.visible = false;
buy_btn.visible = true;
cancel_btn.visible = true;
if (currentBuyThing != null){
currentBuyThing.x = lastX;
currentBuyThing.y = lastY;
currentBuyThing.scaleX = 1;
currentBuyThing.scaleY = 1;
currentBuyThing = null;
};
currentBuyThingName = "";
currentBuyThingPrice = 0;
isHideThing(false);
showAllBuyThing();
this.dispatchEvent(new Event(LEVEL_UP_BEGIN));
}
private function gameInterfaceDataChange(_arg1:String):void{
if (_arg1 == "flower"){
GameData.flowerLevel = (GameData.flowerLevel + 1);
} else {
if (_arg1 == "chair"){
GameData.chairNum = (GameData.chairNum + 1);
} else {
if (_arg1 == "desk"){
GameData.deskLevel = (GameData.deskLevel + 1);
} else {
if (_arg1 == "light"){
GameData.lightBool = true;
} else {
if (_arg1 == "rug"){
GameData.ditanLevel = (GameData.ditanLevel + 1);
} else {
if (_arg1 == "room"){
GameData.roomNum = (GameData.roomNum + 1);
} else {
if (_arg1 == "waiter"){
GameData.waiterNum = (GameData.waiterNum + 1);
if (GameData.waiterNum < 3){
buyWaiter_mc.waiter_mc.nextFrame();
};
} else {
if (_arg1 == "clothes"){
GameData.clothesLevel = (GameData.clothesLevel + 1);
if (GameData.clothesLevel < 6){
buyClothes_mc.clothes_mc.gotoAndStop((7 + GameData.clothesLevel));
};
} else {
if (_arg1 == "wall"){
GameData.wallLevel = (GameData.wallLevel + 1);
};
};
};
};
};
};
};
};
};
initShowNum();
}
private function isHideThing(_arg1:Boolean):void{
introduceThing_mc.visible = _arg1;
buy_btn.visible = _arg1;
cancel_btn.visible = _arg1;
if (currentBuyThingName == "waiter"){
buy_btn.gotoAndStop(2);
} else {
buy_btn.gotoAndStop(1);
};
}
private function OKHandler(_arg1:MouseEvent):void{
MySound.playBtnSound();
noMoney_mc.visible = false;
buy_btn.visible = true;
cancel_btn.visible = true;
}
private function buyChair(_arg1:MouseEvent):void{
MySound.playBtnSound();
var _local2:MovieClip = (_arg1.currentTarget as MovieClip);
buyThing(_local2, GameData.chairGold, "chair");
}
private function buyClothes(_arg1:MouseEvent):void{
MySound.playBtnSound();
var _local2:MovieClip = (_arg1.currentTarget as MovieClip);
buyThing(_local2, GameData.clothesGold, "clothes");
}
private function buyHandler(_arg1:MouseEvent):void{
MySound.playBtnSound();
if (GameData.totalGold >= currentBuyThingPrice){
trace("买东西弹框出来");
pricePointOut();
} else {
noMoney_mc.visible = true;
this.setChildIndex(noMoney_mc, (this.numChildren - 1));
noMoney_mc.ok_btn.addEventListener(MouseEvent.CLICK, OKHandler);
buy_btn.visible = false;
cancel_btn.visible = false;
};
}
}
}//package util
Section 25
//ClothesEvent (util.ClothesEvent)
package util {
import flash.events.*;
public class ClothesEvent extends Event {
public var number:Number;
public var clothesCurrentNum:Number;
public function ClothesEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
this.number = _arg2;
this.clothesCurrentNum = _arg3;
super(_arg1, _arg4, _arg5);
}
}
}//package util
Section 26
//GameData (util.GameData)
package util {
public class GameData {
public static const wallLevelUp:Number = 30;
public static const rugLevelUp:Number = 15;
public static const targetGoalAdd:Number = 80;
public static const deskLevelUp:Number = 20;
public static const flowerLevelUp:Number = 10;
public static var chairNum:Number;
public static var sellInitGold:Number = 0;
public static var rugGold:Number = 250;
public static var lightGold:Number = 350;
public static var deskGold:Number = 500;
public static var clothesLevel:Number;
public static var lightBool:Boolean;
public static var roomNum:Number;
public static var gameLevel:Number = 1;
public static var clothesSellPriceArr:Array = new Array(90, 90, 100, 100, 110, 110, 120, 130, 140, 150, 170, 200);
public static var chairGold:Number = 150;
public static var clothesGold:Number = 400;
public static var wallGold:Number = 800;
public static var totalGold:Number = 0;
public static var shopperRefreshArr:Array = [20000, 20000, 15000, 15000, 12000, 12000, 10000, 10000, 8000, 8000, 7000, 7000, 6000, 6000, 6000, 5000, 5000, 5000, 4000, 4000];
public static var sellGold:Number = 0;
public static var targetGoal:Number = 450;
public static var wallLevel:Number;
public static var roomGold:Number = 250;
public static var waiterNum:Number;
public static var waiterGold:Number = 400;
public static var ditanLevel:Number;
public static var flowerLevel:Number;
public static var flowerGold:Number = 120;
public static var deskLevel:Number;
public static var clothesInitPriceArr:Array = new Array(90, 90, 115, 115, 130, 130, 150, 160, 170, 180, 500, 800);
public static function levelUpSellPrice(_arg1:Number):void{
var _local2:int;
while (_local2 < clothesSellPriceArr.length) {
clothesSellPriceArr[_local2] = (clothesSellPriceArr[_local2] + _arg1);
_local2++;
};
}
public static function initLevelUpSellPrice():void{
if (deskLevel > 1){
levelUpSellPrice(deskLevelUp);
};
if (ditanLevel > 1){
levelUpSellPrice(rugLevelUp);
};
if (wallLevel > 1){
levelUpSellPrice(wallLevelUp);
};
if (flowerLevel > 0){
levelUpSellPrice(flowerLevelUp);
};
}
public static function initTargetGoal():void{
if (gameLevel == 1){
targetGoal = 200;
} else {
if (gameLevel == 2){
targetGoal = 240;
} else {
if ((((gameLevel >= 3)) && ((gameLevel <= 10)))){
targetGoal = (((gameLevel + 1) * 90) - 80);
} else {
if ((((gameLevel > 10)) && ((gameLevel <= 15)))){
targetGoal = (((gameLevel + 1) * 100) - 80);
} else {
if ((((gameLevel > 15)) && ((gameLevel <= 20)))){
targetGoal = (((gameLevel + 1) * 120) - 80);
};
};
};
};
};
}
}
}//package util
Section 27
//GuestEvent (util.GuestEvent)
package util {
import flash.display.*;
import flash.events.*;
public class GuestEvent extends Event {
public var clickName:String;
public var targetObj:DisplayObject;
public function GuestEvent(_arg1:String, _arg2:String, _arg3:DisplayObject, _arg4:Boolean=false, _arg5:Boolean=false){
super(_arg1, _arg4, _arg5);
this.clickName = _arg2;
this.targetObj = _arg3;
}
}
}//package util
Section 28
//McPointHandler (util.McPointHandler)
package util {
import flash.display.*;
import flash.geom.*;
import game.*;
public class McPointHandler {
public static function getStagePoint(_arg1:MovieClip, _arg2:Point):Point{
return (_arg1.localToGlobal(_arg2));
}
public static function getGridPoint(_arg1:MovieClip, _arg2:Point):Point{
var _local3:Point = _arg1.localToGlobal(_arg2);
var _local4:Number = Math.floor((_local3.x / Game._cellSize));
var _local5:Number = Math.floor((_local3.y / Game._cellSize));
return (new Point(((_local4 * Game._cellSize) + (Game._cellSize / 2)), ((_local5 * Game._cellSize) + (Game._cellSize / 2))));
}
}
}//package util
Section 29
//RoomEvent (util.RoomEvent)
package util {
import flash.display.*;
import flash.events.*;
public class RoomEvent extends Event {
public var number:Number;
public var room:MovieClip;
public function RoomEvent(_arg1:String, _arg2:Number, _arg3:MovieClip, _arg4:Boolean=false, _arg5:Boolean=false){
this.number = _arg2;
this.room = _arg3;
super(_arg1, _arg4, _arg5);
}
}
}//package util
Section 30
//StrEvent (util.StrEvent)
package util {
import flash.events.*;
public class StrEvent extends Event {
public var clickName:String;
public function StrEvent(_arg1:String, _arg2:String, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.clickName = _arg2;
}
}
}//package util
Section 31
//StringHandler (util.StringHandler)
package util {
public class StringHandler {
public static function strChangNum(_arg1:String):Number{
var _local2:RegExp = /\d/igx;
var _local3:Number = Number(_arg1.match(_local2).join(""));
return (_local3);
}
public static function strLossNum(_arg1:String):String{
var _local2:RegExp = /\d+/g;
var _local3:String = _arg1.replace(_local2, "");
return (_local3);
}
}
}//package util
Section 32
//Time (util.Time)
package util {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Time extends MovieClip {
public var lastTime:Number;
private var rotationNum:Number;
private var time:Timer;
private var clock:MovieClip;
public var isNight:Boolean;
private var timeNum:Number;
private var _stage:DisplayObjectContainer;
public static const TIME_END:String = "time_end";
public static const GET_NIGHT:String = "get_night";
public function Time(_arg1:MovieClip){
clock = _arg1;
}
private function timerHandler(_arg1:TimerEvent):void{
rotationNum++;
if ((rotationNum % 10) != 0){
return;
};
if (isNight){
clock.zhen_mc.rotation = (clock.zhen_mc.rotation + (360 / Math.floor((timeNum / 10))));
} else {
clock.zhen_mc.rotation = (clock.zhen_mc.rotation + (270 / Math.floor((timeNum / 10))));
};
lastTime = (lastTime + 10);
if (isNight){
if (lastTime >= ((timeNum * 3) / 4)){
this.dispatchEvent(new Event(GET_NIGHT));
};
};
}
private function timerCom(_arg1:TimerEvent):void{
time.stop();
time.removeEventListener(TimerEvent.TIMER, timerHandler);
time.removeEventListener(TimerEvent.TIMER_COMPLETE, timerCom);
trace("游戏时间结束");
time = null;
this.dispatchEvent(new Event(TIME_END));
}
public function pauseTime():void{
trace(("时间TIME" + time));
if (time != null){
time.stop();
};
}
public function startTime(_arg1:Number, _arg2:Boolean):void{
rotationNum = 0;
timeNum = _arg1;
isNight = _arg2;
if (!isNight){
timeNum = Math.floor((((_arg1 * 3) / 4) / 100));
} else {
timeNum = Math.floor((_arg1 / 100));
};
lastTime = 0;
trace(("需要执行的时间为::" + timeNum));
time = new Timer(100, timeNum);
time.addEventListener(TimerEvent.TIMER, timerHandler);
time.addEventListener(TimerEvent.TIMER_COMPLETE, timerCom);
time.start();
}
public function removeTime():void{
if (time != null){
time.stop();
time.removeEventListener(TimerEvent.TIMER, timerHandler);
time.removeEventListener(TimerEvent.TIMER_COMPLETE, timerCom);
trace("游戏时间结束");
time = null;
};
}
public function continueTime():void{
if (time != null){
time.start();
};
}
}
}//package util
Section 33
//level_btn_220 (weddingshop_fla.level_btn_220)
package weddingshop_fla {
import flash.display.*;
public dynamic class level_btn_220 extends MovieClip {
public function level_btn_220(){
addFrameScript(14, frame15);
}
function frame15(){
stop();
}
}
}//package weddingshop_fla
Section 34
//LOGOTitter_209 (weddingshop_fla.LOGOTitter_209)
package weddingshop_fla {
import flash.display.*;
import flash.events.*;
public dynamic class LOGOTitter_209 extends MovieClip {
public var Goto:Number;
public var Type:String;
public var Logo:MovieClip;
public function LOGOTitter_209(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
Logo.buttonMode = true;
Logo.mouseChildren = false;
Logo.addEventListener(MouseEvent.CLICK, NewLogo);
Logo.addEventListener(MouseEvent.MOUSE_OVER, Over);
Logo.addEventListener(MouseEvent.MOUSE_OUT, Out);
}
public function NewLogo(_arg1){
trace(Type);
MoreGameURLOK.MoreGameURLOK(Type);
}
public function Over(_arg1){
gotoAndStop(2);
}
public function Out(_arg1){
gotoAndStop(1);
}
}
}//package weddingshop_fla
Section 35
//LOGOTitter_210 (weddingshop_fla.LOGOTitter_210)
package weddingshop_fla {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.filters.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class LOGOTitter_210 extends MovieClip {
public var LogoColor:MovieClip;
public var Logo:MovieClip;
public function LOGOTitter_210(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
LogoColor.gotoAndStop(MovieClip(parent).Goto);
gotoAndStop(MoreGameURLOK.Goto);
}
function frame2(){
LogoColor.gotoAndStop(MovieClip(parent).Goto);
gotoAndStop(MoreGameURLOK.Goto);
}
}
}//package weddingshop_fla
Section 36
//MainTimeline (weddingshop_fla.MainTimeline)
package weddingshop_fla {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.filters.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var Goto:String;
public var domain:String;
public var ServerFps;
public var TitterIntro:MovieClip;
public var portal:String;
public var Url:String;
public var loader:URLLoader;
public var GameName:String;
public var MochiBotKey:String;
public var utm_content:String;
public var sender:LocalConnection;
public var url:String;
public var continueButton:Number;
public var branding:String;
public var myGame:MyGame;
public function MainTimeline(){
addFrameScript(0, frame1, 20, frame21);
}
public function CuntryType(_arg1:String){
var _local2:String;
switch (_arg1){
case "mary.com":
_local2 = "MaryCOM";
break;
case "titter.com":
_local2 = "TitterCOM";
break;
case "titter.fr":
_local2 = "TitterFR";
break;
case "titter.es":
_local2 = "TitterES";
break;
case "titter.pt":
_local2 = "TitterPT";
break;
case "titter.nl":
_local2 = "TitterNL";
break;
case "titter.it":
_local2 = "TitterIT";
break;
case "warda.com":
_local2 = "WardaCOM";
break;
case "titter.com.cn":
_local2 = "TitterCOMCN";
break;
case "titter.co.id":
_local2 = "TitterCOID";
break;
case "tessaspiele.de":
_local2 = "TessaspieleDE";
break;
case "tessagames.co.uk":
_local2 = "TessagamesCOUK";
break;
case "titter.pl":
_local2 = "TitterPL";
break;
case "titter.no":
_local2 = "TitterNO";
break;
case "titter.se":
_local2 = "TitterSE";
break;
case "titter.dk":
_local2 = "TitterDK";
break;
case "titter.hu":
_local2 = "TitterHU";
break;
case "titter.gr":
_local2 = "TitterGR";
break;
case "titter.tw":
_local2 = "TitterTW";
break;
case "titter.fi":
_local2 = "TitterFI";
break;
case "irgytessy.ru":
_local2 = "IrgytessyRU";
break;
case "kikirti.com":
_local2 = "KikirtiCOM";
break;
};
Url = ("http://www." + _arg1);
Goto = _local2;
MoreGameURLOK.Goto = Goto;
}
public function com(_arg1){
var _local2:String;
_local2 = _arg1.target.data.toLowerCase();
trace(_local2);
CuntryType(_local2);
TitterIntro.titterBtn.Logo.gotoAndStop(Goto);
TitterIntro.Loading.gotoAndStop(Goto);
NewLoadingReady();
}
public function ingameOK(_arg1){
utm_content = "ingame";
MoreGameURL(true);
}
public function preloader(_arg1){
utm_content = "preloader";
MoreGameURL(true);
}
public function gameover(_arg1){
utm_content = "gameover";
MoreGameURL(true);
}
public function LogoMoreGame(_arg1:String){
utm_content = _arg1;
MoreGameURL(true);
}
function frame21(){
myGame = new MyGame();
this.addChild(myGame);
myGame.setStage(this.stage);
myGame.init();
stop();
}
public function youwin(_arg1){
utm_content = "youwin";
MoreGameURL(true);
}
public function GameUrl(){
var _local1:String = ((((((("?utm_campaign=" + GameName) + "&utm_content=") + utm_content) + "&utm_medium=") + branding) + "&utm_source=") + url);
var _local2:String = ("http://www.titter.com/tessa-s-wedding.html" + _local1);
var _local3:URLRequest = new URLRequest(_local2);
navigateToURL(_local3);
}
function frame1(){
MochiBotKey = "df3e0e5a";
GameName = "Wedding Shop";
branding = "original";
continueButton = 1;
ServerFps = stage.frameRate;
stage.frameRate = 30;
MochiBot.track(this, MochiBotKey);
sender = new LocalConnection();
url = root.loaderInfo.url;
domain = sender.domain;
utm_content = "intro";
TitterIntro.GameURL.addEventListener(MouseEvent.CLICK, preloader);
Url = "http://www.mary.com";
Goto = "MaryCOM";
if (domain != "localhost"){
loader = new URLLoader(new URLRequest("http://api.jaludo.com/geoip/index.php?return=domain&type=gameshell&portal=mary"));
loader.addEventListener(Event.COMPLETE, com);
} else {
NewLoadingReady();
};
stop();
MoreGameURLOK.MoreGameURLOK = LogoMoreGame;
MoreGameURLOK.Goto = Goto;
}
public function menu(_arg1){
utm_content = "menu";
MoreGameURL(true);
}
public function NewLoadingReady(){
var onEnterFramee:Function;
onEnterFramee = function (_arg1:Event){
var _local2:Number;
var _local3:Number;
if (framesLoaded == totalFrames){
trace("Loading.......(100%)");
stage.removeEventListener(Event.ENTER_FRAME, onEnterFramee);
TitterIntro.gotoAndStop(2);
} else {
_local2 = (root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal);
_local3 = Math.round((_local2 * 100));
TitterIntro.LoadingPic.gotoAndStop(_local3);
TitterIntro.loadTxt.text = (_local3 + "%");
};
};
stage.addEventListener(Event.ENTER_FRAME, onEnterFramee);
}
public function MoreGameURL(_arg1){
var _local2:String = ((((((("?utm_campaign=" + GameName) + "&utm_content=") + utm_content) + "&utm_medium=") + branding) + "&utm_source=") + url);
var _local3:String = (Url + _local2);
var _local4:URLRequest = new URLRequest(_local3);
navigateToURL(_local4);
}
public function LoadGamePlay(){
SoundMixer.stopAll();
stage.frameRate = ServerFps;
gotoAndStop(21);
}
public function intro(_arg1){
utm_content = "intro";
MoreGameURL(true);
}
}
}//package weddingshop_fla
Section 37
//Timeline_175 (weddingshop_fla.Timeline_175)
package weddingshop_fla {
import flash.display.*;
public dynamic class Timeline_175 extends MovieClip {
public var sound_btn:SimpleButton;
public function Timeline_175(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package weddingshop_fla
Section 38
//Timeline_202 (weddingshop_fla.Timeline_202)
package weddingshop_fla {
import flash.display.*;
public dynamic class Timeline_202 extends MovieClip {
public var statusBar_mc:MovieClip;
public function Timeline_202(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package weddingshop_fla
Section 39
//Timeline_839 (weddingshop_fla.Timeline_839)
package weddingshop_fla {
import flash.display.*;
public dynamic class Timeline_839 extends MovieClip {
public var p:MovieClip;
public function Timeline_839(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package weddingshop_fla
Section 40
//Timeline_874 (weddingshop_fla.Timeline_874)
package weddingshop_fla {
import flash.display.*;
public dynamic class Timeline_874 extends MovieClip {
public var buy_btn:SimpleButton;
public function Timeline_874(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package weddingshop_fla
Section 41
//Timeline_894 (weddingshop_fla.Timeline_894)
package weddingshop_fla {
import flash.display.*;
public dynamic class Timeline_894 extends MovieClip {
public function Timeline_894(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package weddingshop_fla
Section 42
//Timeline_99 (weddingshop_fla.Timeline_99)
package weddingshop_fla {
import flash.display.*;
public dynamic class Timeline_99 extends MovieClip {
public function Timeline_99(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package weddingshop_fla
Section 43
//YDK_1 (weddingshop_fla.YDK_1)
package weddingshop_fla {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.filters.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class YDK_1 extends MovieClip {
public var Loading:MovieClip;
public var Gif:MovieClip;
public var Loaded:MovieClip;
public var Continue:MovieClip;
public var loadTxt:TextField;
public var LoadingPic:MovieClip;
public var titterBtn:MovieClip;
public var GameURL:SimpleButton;
public function YDK_1(){
addFrameScript(0, frame1, 1, frame2, 150, frame151);
}
function frame151(){
MovieClip(root).LoadGamePlay();
stop();
}
public function run(_arg1){
var _local2:* = root;
var _local3:* = parent;
if (MovieClip(_local2).LoadingGif){
MovieClip(_local2).LoadGamePlay();
} else {
MovieClip(_local2).IntroOK = true;
SoundMixer.stopAll();
play();
};
}
function frame2(){
stop();
Continue.Continue.mouseChildren = false;
Continue.Continue.buttonMode = true;
Continue.Continue.addEventListener(MouseEvent.MOUSE_OVER, run);
}
function frame1(){
stop();
}
}
}//package weddingshop_fla
Section 44
//YDK_11 (weddingshop_fla.YDK_11)
package weddingshop_fla {
import flash.display.*;
public dynamic class YDK_11 extends MovieClip {
public function YDK_11(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package weddingshop_fla
Section 45
//YDK_2 (weddingshop_fla.YDK_2)
package weddingshop_fla {
import flash.display.*;
import flash.events.*;
public dynamic class YDK_2 extends MovieClip {
public var role2_mc:MovieClip;
public var Frame:Number;
public function YDK_2(){
addFrameScript(0, frame1, 15, frame16, 24, frame25, 32, frame33, 40, frame41, 127, frame128);
}
function frame1(){
Frame = 20;
}
function frame128(){
stop();
}
public function run(_arg1){
Loading(Frame);
}
function frame33(){
Frame = 60;
addEventListener(Event.ENTER_FRAME, run);
}
function frame25(){
Frame = 40;
addEventListener(Event.ENTER_FRAME, run);
}
function frame41(){
Frame = 80;
addEventListener(Event.ENTER_FRAME, run);
}
function frame16(){
Frame = 20;
addEventListener(Event.ENTER_FRAME, run);
}
public function Loading(_arg1){
var _local2:Number = (root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal);
var _local3:Number = Math.round((_local2 * 100));
if (_local3 < _arg1){
stop();
} else {
removeEventListener(Event.ENTER_FRAME, run);
play();
};
}
}
}//package weddingshop_fla
Section 46
//YDK_21 (weddingshop_fla.YDK_21)
package weddingshop_fla {
import flash.display.*;
public dynamic class YDK_21 extends MovieClip {
public var glowMc:MovieClip;
public var Logo:MovieClip;
public function YDK_21(){
addFrameScript(0, frame1, 5, frame6, 9, frame10);
}
function frame1(){
stop();
}
function frame6(){
stop();
}
function frame10(){
gotoAndPlay(1);
}
}
}//package weddingshop_fla
Section 47
//YDK_22 (weddingshop_fla.YDK_22)
package weddingshop_fla {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.filters.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class YDK_22 extends MovieClip {
public function YDK_22(){
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(MovieClip(root).Goto);
stop();
}
}
}//package weddingshop_fla
Section 48
//YDK_8 (weddingshop_fla.YDK_8)
package weddingshop_fla {
import flash.display.*;
public dynamic class YDK_8 extends MovieClip {
public function YDK_8(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package weddingshop_fla
Section 49
//YDK_90 (weddingshop_fla.YDK_90)
package weddingshop_fla {
import flash.display.*;
public dynamic class YDK_90 extends MovieClip {
public function YDK_90(){
addFrameScript(49, frame50);
}
function frame50(){
stop();
}
}
}//package weddingshop_fla
Section 50
//YDK_94 (weddingshop_fla.YDK_94)
package weddingshop_fla {
import flash.display.*;
public dynamic class YDK_94 extends MovieClip {
public function YDK_94(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package weddingshop_fla
Section 51
//YDK_95 (weddingshop_fla.YDK_95)
package weddingshop_fla {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.filters.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class YDK_95 extends MovieClip {
public function YDK_95(){
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(MovieClip(root).Goto);
stop();
}
}
}//package weddingshop_fla
Section 52
//YDK_98 (weddingshop_fla.YDK_98)
package weddingshop_fla {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.filters.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class YDK_98 extends MovieClip {
public function YDK_98(){
addFrameScript(0, frame1);
}
function frame1(){
gotoAndStop(MovieClip(root).Goto);
}
}
}//package weddingshop_fla
Section 53
//BackSound (BackSound)
package {
import flash.media.*;
public dynamic class BackSound extends Sound {
}
}//package
Section 54
//BeginPage (BeginPage)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.filters.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class BeginPage extends MovieClip {
public var mcBtn:MovieClip;
public var __id4_:MovieClip;
public function BeginPage(){
__setProp___id4__();
}
function __setProp___id4__(){
try {
__id4_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id4_.Type = "logo-menu";
__id4_.Goto = 1;
try {
__id4_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 55
//BeginSound (BeginSound)
package {
import flash.media.*;
public dynamic class BeginSound extends Sound {
}
}//package
Section 56
//BtnSound (BtnSound)
package {
import flash.media.*;
public dynamic class BtnSound extends Sound {
}
}//package
Section 57
//BuyThingSound (BuyThingSound)
package {
import flash.media.*;
public dynamic class BuyThingSound extends Sound {
}
}//package
Section 58
//BuyThis (BuyThis)
package {
import flash.media.*;
public dynamic class BuyThis extends Sound {
}
}//package
Section 59
//Chair (Chair)
package {
import flash.display.*;
public dynamic class Chair extends MovieClip {
public var chairL_mc:MovieClip;
public var light_mc:MovieClip;
}
}//package
Section 60
//ChangeNight (ChangeNight)
package {
import flash.media.*;
public dynamic class ChangeNight extends Sound {
}
}//package
Section 61
//Click (Click)
package {
import flash.display.*;
public dynamic class Click extends MovieClip {
}
}//package
Section 62
//ClickPoint (ClickPoint)
package {
import flash.display.*;
public dynamic class ClickPoint extends MovieClip {
}
}//package
Section 63
//DongHuaPage (DongHuaPage)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.filters.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class DongHuaPage extends MovieClip {
public var __id1_:MovieClip;
public function DongHuaPage(){
addFrameScript(0, frame1);
__setProp___id1__();
}
function frame1(){
}
function __setProp___id1__(){
try {
__id1_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id1_.Type = "logo-menu";
__id1_.Goto = 1;
try {
__id1_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 64
//EndGameFail (EndGameFail)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.filters.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class EndGameFail extends MovieClip {
public var yes_btn:SimpleButton;
public var __id0_:MovieClip;
public var quit_btn:SimpleButton;
public var chahua_mc:MovieClip;
public function EndGameFail(){
__setProp___id0__();
}
function __setProp___id0__(){
try {
__id0_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id0_.Type = "logo-donepage";
__id0_.Goto = 1;
try {
__id0_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 65
//EndHelp (EndHelp)
package {
import flash.display.*;
public dynamic class EndHelp extends MovieClip {
}
}//package
Section 66
//FailBackSound (FailBackSound)
package {
import flash.media.*;
public dynamic class FailBackSound extends Sound {
}
}//package
Section 67
//FlxSave (FlxSave)
package {
import flash.net.*;
public class FlxSave {
protected var _so:SharedObject;
public var data:Object;
public var name:String;
public function FlxSave(){
name = null;
_so = null;
data = null;
}
public function read(_arg1:String):Object{
if (_so == null){
trace("WARNING: You must call FlxSave.bind()\nbefore calling FlxSave.read().");
return (null);
};
return (data[_arg1]);
}
public function forceSave(_arg1:uint=0):Boolean{
var MinFileSize = _arg1;
if (_so == null){
trace("WARNING: You must call FlxSave.bind()\nbefore calling FlxSave.forceSave().");
return (false);
};
var status:Object;
try {
status = _so.flush(MinFileSize);
} catch(e:Error) {
trace("WARNING: There was a problem flushing\nthe shared object data from FlxSave.");
return (false);
};
return ((status == SharedObjectFlushStatus.FLUSHED));
}
public function bind(_arg1:String):Boolean{
var Name = _arg1;
name = null;
_so = null;
data = null;
name = Name;
try {
_so = SharedObject.getLocal(name);
} catch(e:Error) {
trace("WARNING: There was a problem binding to\nthe shared object data from FlxSave.");
name = null;
_so = null;
data = null;
return (false);
};
data = _so.data;
return (true);
}
public function erase(_arg1:uint=0):Boolean{
if (_so == null){
trace("WARNING: You must call FlxSave.bind()\nbefore calling FlxSave.erase().");
return (false);
};
_so.clear();
return (forceSave(_arg1));
}
public function write(_arg1:String, _arg2:Object, _arg3:uint=0):Boolean{
if (_so == null){
trace("WARNING: You must call FlxSave.bind()\nbefore calling FlxSave.write().");
return (false);
};
data[_arg1] = _arg2;
return (forceSave(_arg3));
}
}
}//package
Section 68
//FuWuYuanOne (FuWuYuanOne)
package {
import flash.display.*;
public dynamic class FuWuYuanOne extends MovieClip {
public var display_mc:MovieClip;
}
}//package
Section 69
//FuWuYuanThree (FuWuYuanThree)
package {
import flash.display.*;
public dynamic class FuWuYuanThree extends MovieClip {
public var display_mc:MovieClip;
}
}//package
Section 70
//FuWuYuanTwo (FuWuYuanTwo)
package {
import flash.display.*;
public dynamic class FuWuYuanTwo extends MovieClip {
public var display_mc:MovieClip;
}
}//package
Section 71
//GetLevel (GetLevel)
package {
import flash.display.*;
public dynamic class GetLevel extends MovieClip {
public function GetLevel(){
addFrameScript(10, frame11);
}
function frame11(){
stop();
}
}
}//package
Section 72
//GetThing (GetThing)
package {
import flash.media.*;
public dynamic class GetThing extends Sound {
}
}//package
Section 73
//GoodBye (GoodBye)
package {
import flash.media.*;
public dynamic class GoodBye extends Sound {
}
}//package
Section 74
//GuestBa (GuestBa)
package {
import flash.display.*;
public dynamic class GuestBa extends MovieClip {
public var time_mc:MovieClip;
public var display_mc:MovieClip;
}
}//package
Section 75
//GuestEr (GuestEr)
package {
import flash.display.*;
public dynamic class GuestEr extends MovieClip {
public var time_mc:MovieClip;
public var display_mc:MovieClip;
}
}//package
Section 76
//GuestJiu (GuestJiu)
package {
import flash.display.*;
public dynamic class GuestJiu extends MovieClip {
public var time_mc:MovieClip;
public var display_mc:MovieClip;
}
}//package
Section 77
//GuestLiu (GuestLiu)
package {
import flash.display.*;
public dynamic class GuestLiu extends MovieClip {
public var time_mc:MovieClip;
public var display_mc:MovieClip;
}
}//package
Section 78
//GuestOne (GuestOne)
package {
import flash.display.*;
public dynamic class GuestOne extends MovieClip {
public var p:MovieClip;
public var display_mc:MovieClip;
public var time_mc:MovieClip;
}
}//package
Section 79
//GuestQi (GuestQi)
package {
import flash.display.*;
public dynamic class GuestQi extends MovieClip {
public var time_mc:MovieClip;
public var display_mc:MovieClip;
}
}//package
Section 80
//GuestSan (GuestSan)
package {
import flash.display.*;
public dynamic class GuestSan extends MovieClip {
public var time_mc:MovieClip;
public var display_mc:MovieClip;
}
}//package
Section 81
//GuestShi (GuestShi)
package {
import flash.display.*;
public dynamic class GuestShi extends MovieClip {
public var time_mc:MovieClip;
public var display_mc:MovieClip;
}
}//package
Section 82
//GuestShiEr (GuestShiEr)
package {
import flash.display.*;
public dynamic class GuestShiEr extends MovieClip {
public var time_mc:MovieClip;
public var display_mc:MovieClip;
}
}//package
Section 83
//GuestShiSan (GuestShiSan)
package {
import flash.display.*;
public dynamic class GuestShiSan extends MovieClip {
public var time_mc:MovieClip;
public var display_mc:MovieClip;
}
}//package
Section 84
//GuestShiSi (GuestShiSi)
package {
import flash.display.*;
public dynamic class GuestShiSi extends MovieClip {
public var time_mc:MovieClip;
public var display_mc:MovieClip;
}
}//package
Section 85
//GuestShiYi (GuestShiYi)
package {
import flash.display.*;
public dynamic class GuestShiYi extends MovieClip {
public var time_mc:MovieClip;
public var display_mc:MovieClip;
}
}//package
Section 86
//GuestSi (GuestSi)
package {
import flash.display.*;
public dynamic class GuestSi extends MovieClip {
public var time_mc:MovieClip;
public var display_mc:MovieClip;
}
}//package
Section 87
//GuestWu (GuestWu)
package {
import flash.display.*;
public dynamic class GuestWu extends MovieClip {
public var time_mc:MovieClip;
public var display_mc:MovieClip;
}
}//package
Section 88
//Hello (Hello)
package {
import flash.media.*;
public dynamic class Hello extends Sound {
}
}//package
Section 89
//HelloTwo (HelloTwo)
package {
import flash.media.*;
public dynamic class HelloTwo extends Sound {
}
}//package
Section 90
//HiThere (HiThere)
package {
import flash.media.*;
public dynamic class HiThere extends Sound {
}
}//package
Section 91
//InputName (InputName)
package {
import flash.display.*;
import flash.text.*;
public dynamic class InputName extends MovieClip {
public var back_btn:SimpleButton;
public var shuru_txt:TextField;
public var tishi_mc:MovieClip;
public var yes_btn:SimpleButton;
}
}//package
Section 92
//IsEndGame (IsEndGame)
package {
import flash.display.*;
public dynamic class IsEndGame extends MovieClip {
public var yes_btn:SimpleButton;
public var no_btn:SimpleButton;
}
}//package
Section 93
//Level (Level)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.filters.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Level extends MovieClip {
public var mc18:MovieClip;
public var mc19:MovieClip;
public var __id3_:MovieClip;
public var mc15:MovieClip;
public var number_mc:MovieClip;
public var mc13:MovieClip;
public var mc20:MovieClip;
public var next_btn:SimpleButton;
public var mc1:MovieClip;
public var mc2:MovieClip;
public var mc3:MovieClip;
public var mc4:MovieClip;
public var mc5:MovieClip;
public var mc6:MovieClip;
public var mc7:MovieClip;
public var mc8:MovieClip;
public var mc9:MovieClip;
public var back_btn:SimpleButton;
public var mc10:MovieClip;
public var mc12:MovieClip;
public var mc14:MovieClip;
public var mc16:MovieClip;
public var mc17:MovieClip;
public var mc11:MovieClip;
public function Level(){
__setProp___id3__();
}
function __setProp___id3__(){
try {
__id3_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id3_.Type = "logo-menu";
__id3_.Goto = 1;
try {
__id3_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 94
//LevelUpSound (LevelUpSound)
package {
import flash.media.*;
public dynamic class LevelUpSound extends Sound {
}
}//package
Section 95
//LoadLevel (LoadLevel)
package {
public class LoadLevel {
public var currentLevel:Number;
public var levelArr:Array;
private var flxSave:FlxSave;
public function LoadLevel(){
flxSave = new FlxSave();
super();
setPreLoadLevel();
}
public function setPreLoadLevel():void{
flxSave.bind("name");
if (((flxSave) && (!((flxSave.data.levelArrs == null))))){
trace("打开保存的数据");
this.levelArr = flxSave.data.levelArrs;
};
}
public function putLevel(_arg1:Object):void{
var _local2:Array;
trace("每次开始下一关的时候保存数据");
if (((!((flxSave.data == null))) && ((flxSave.data.levelArrs == null)))){
_local2 = new Array();
flxSave.data.levelArrs = _local2;
flxSave.data.levelArrs.unshift(_arg1);
levelArr = flxSave.data.levelArrs;
} else {
flxSave.data.levelArrs.unshift(_arg1);
levelArr = flxSave.data.levelArrs;
};
}
public function updateFlxSave():void{
flxSave.data.levelArrs = levelArr;
}
}
}//package
Section 96
//LoadPage (LoadPage)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.filters.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class LoadPage extends MovieClip {
public var back_btn:SimpleButton;
public var __id5_:MovieClip;
public var cha1:SimpleButton;
public var cha2:SimpleButton;
public var cha3:SimpleButton;
public var cha4:SimpleButton;
public var cha5:SimpleButton;
public var cha6:SimpleButton;
public var cha7:SimpleButton;
public var sureDel_mc:MovieClip;
public var wb1:TextField;
public var wb2:TextField;
public var wb3:TextField;
public var wb4:TextField;
public var wb5:TextField;
public var wb6:TextField;
public var wb7:TextField;
public var btn1:SimpleButton;
public var btn2:SimpleButton;
public var btn3:SimpleButton;
public var btn4:SimpleButton;
public var btn5:SimpleButton;
public var btn6:SimpleButton;
public var mc1:MovieClip;
public var mc2:MovieClip;
public var btn7:SimpleButton;
public var fanye_mc:MovieClip;
public function LoadPage(){
__setProp___id5__();
}
function __setProp___id5__(){
try {
__id5_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id5_.Type = "logo-menu";
__id5_.Goto = 1;
try {
__id5_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
}
}//package
Section 97
//MayIHelpYou (MayIHelpYou)
package {
import flash.media.*;
public dynamic class MayIHelpYou extends Sound {
}
}//package
Section 98
//MayITryOn (MayITryOn)
package {
import flash.media.*;
public dynamic class MayITryOn extends Sound {
}
}//package
Section 99
//MenLing (MenLing)
package {
import flash.media.*;
public dynamic class MenLing extends Sound {
}
}//package
Section 100
//MenMian (MenMian)
package {
import flash.media.*;
public dynamic class MenMian extends Sound {
}
}//package
Section 101
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
if (Security.sandboxType == "localWithFile"){
return (null);
};
var _local3:MochiBot = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
var _local4 = "http://core.mochibot.com/my/core.swf";
var _local5:URLVariables = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
var _local6:String = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
var _local7:URLRequest = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
var _local8:Loader = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 102
//MoreGameURLOK (MoreGameURLOK)
package {
public class MoreGameURLOK {
public static var Goto:String;
public static var MoreGameURLOK:Function;
public static function Ready(){
}
}
}//package
Section 103
//Music2 (Music2)
package {
import flash.media.*;
public dynamic class Music2 extends Sound {
}
}//package
Section 104
//MyGame (MyGame)
package {
import flash.display.*;
import com.greensock.*;
import flash.events.*;
import game.*;
import util.*;
import my.*;
public class MyGame extends Sprite {
private var tempObj:Object;
private var level:MovieClip;
private var winPage:MovieClip;
private var loadPage:MovieClip;
public var gameLevel:Number;
private var currentPageNum:Number;
private var levelMcArr:Array;
private var beginPage:MovieClip;
private var delLoadStr:String;
private var beginDongHua:MovieClip;
private var game:Game;
private var inputName:MovieClip;
private var _stage:DisplayObjectContainer;
public static var firstPlay:Boolean;
public static var isLoadGame:Boolean;
public static var gameName:String;
public static var save:LoadLevel;
private function updateLoadPage():void{
var _local1:int;
if (save.levelArr != null){
_local1 = 0;
while (_local1 < 7) {
trace(("`````````对象数量::" + save.levelArr.length));
if ((((currentPageNum - 1) * 7) + _local1) < save.levelArr.length){
trace(save.levelArr[_local1].name);
loadPage[("wb" + (_local1 + 1))].text = save.levelArr[(_local1 + ((currentPageNum - 1) * 7))].name;
loadPage[("btn" + (_local1 + 1))].addEventListener(MouseEvent.CLICK, btnClick);
loadPage[("cha" + (_local1 + 1))].addEventListener(MouseEvent.CLICK, chaClick);
} else {
loadPage[("wb" + (_local1 + 1))].text = "";
};
_local1++;
};
};
}
private function showLevel():void{
level.number_mc.visible = true;
level.number_mc.mouseChildren = false;
level.number_mc.mouseEnabled = false;
var _local1 = 1;
while (_local1 <= 20) {
levelMcArr.push(level[("mc" + _local1)]);
if (_local1 <= level.number_mc.currentFrame){
level[("mc" + _local1)].addEventListener(MouseEvent.CLICK, levelClick);
level[("mc" + _local1)].buttonMode = true;
};
_local1++;
};
if (tempObj != null){
gameName = tempObj.name;
};
level.back_btn.addEventListener(MouseEvent.CLICK, levelBack);
level.next_btn.addEventListener(MouseEvent.CLICK, levelNext);
}
private function btnClick(_arg1:MouseEvent):void{
MySound.playBtnSound();
loadPage.visible = false;
var _local2:String = _arg1.target.name;
var _local3:Number = StringHandler.strChangNum(_local2);
var _local4:String = loadPage[("wb" + _local3)].text;
var _local5:int;
while (_local5 <= save.levelArr.length) {
if (save.levelArr[_local5].name == _local4){
tempObj = save.levelArr[_local5];
break;
};
_local5++;
};
level = new Level();
this.addChild(level);
level.number_mc.gotoAndStop(tempObj.getLevel);
level.number_mc.visible = false;
TweenLite.to(level.number_mc, 0.5, {onComplete:showLevel});
}
private function keyYes():void{
gameName = inputName.shuru_txt.text;
SaveGameObj.coverSaveObj();
this.removeInputName();
beginPage.visible = false;
level = new Level();
this.addChild(level);
level.number_mc.gotoAndStop(1);
level.number_mc.visible = false;
TweenLite.to(level.number_mc, 0.5, {onComplete:showLevel});
}
public function init():void{
trace("开始游戏");
save = new LoadLevel();
levelMcArr = new Array();
beginLoadData();
beginPage = new BeginPage();
this.addChild(beginPage);
beginPage.mcBtn.load_btn.addEventListener(MouseEvent.CLICK, loadHandler);
beginPage.mcBtn.playGame_btn.addEventListener(MouseEvent.CLICK, playGameHandler);
beginPage.mcBtn.moreGames_btn.addEventListener(MouseEvent.CLICK, moreGamesHandler);
if ((((save.levelArr == null)) || ((save.levelArr.length == 0)))){
beginPage.mcBtn.load_btn.visible = false;
} else {
beginPage.mcBtn.load_btn.visible = true;
};
if (!GameInterface.IS_STOP_SOUND){
MySound.soundBool = true;
MySound.playBackSound("beginGame");
};
}
private function yesName(_arg1:MouseEvent):void{
var _local4:Boolean;
var _local5:int;
MySound.playBtnSound();
if (inputName.shuru_txt.text == ""){
return;
};
trace("保存玩家名字");
var _local2:String = inputName.shuru_txt.text;
var _local3:Object = new Object();
_local3.name = _local2;
if (save.levelArr != null){
if (save.levelArr.length > 0){
_local5 = 0;
while (_local5 < save.levelArr.length) {
if (save.levelArr[_local5].name == _local2){
inputName.tishi_mc.visible = true;
inputName.tishi_mc.yes_btn.addEventListener(MouseEvent.CLICK, tishiYes);
inputName.tishi_mc.no_btn.addEventListener(MouseEvent.CLICK, tishiNo);
_local4 = true;
};
_local5++;
};
};
};
if (_local4){
return;
};
if (tempObj != null){
tempObj = null;
};
gameName = inputName.shuru_txt.text;
SaveGameObj.initSaveObj();
trace(((("`````````````````新保存一个关卡" + save.levelArr) + ",,,") + gameName));
this.removeInputName();
beginPage.visible = false;
level = new Level();
this.addChild(level);
level.number_mc.gotoAndStop(1);
level.number_mc.visible = false;
TweenLite.to(level.number_mc, 0.5, {onComplete:showLevel});
_stage.removeEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
}
private function loadHandler(_arg1:MouseEvent):void{
MySound.playBtnSound();
currentPageNum = 1;
loadPage = new LoadPage();
this.addChild(loadPage);
loadPage.sureDel_mc.visible = false;
loadPage.back_btn.addEventListener(MouseEvent.CLICK, loadPageBack);
beginPage.visible = false;
trace(save.levelArr);
updateLoadPage();
isLoadGame = true;
loadPage.fanye_mc.addEventListener(MouseEvent.CLICK, fanyeClick);
loadPage.fanye_mc.num_txt.text = currentPageNum.toString();
}
private function keyUpHandler(_arg1:KeyboardEvent):void{
var _local4:Boolean;
var _local5:int;
trace(("你点击的监控代码::" + _arg1.keyCode));
if (_arg1.keyCode != 13){
return;
};
if (inputName.shuru_txt.text == ""){
return;
};
if (inputName.tishi_mc.visible){
this.keyYes();
_stage.removeEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
return;
};
trace("保存玩家名字");
var _local2:String = inputName.shuru_txt.text;
var _local3:Object = new Object();
_local3.name = _local2;
if (save.levelArr != null){
if (save.levelArr.length > 0){
_local5 = 0;
while (_local5 < save.levelArr.length) {
if (save.levelArr[_local5].name == _local2){
inputName.tishi_mc.visible = true;
inputName.tishi_mc.yes_btn.addEventListener(MouseEvent.CLICK, tishiYes);
inputName.tishi_mc.no_btn.addEventListener(MouseEvent.CLICK, tishiNo);
_local4 = true;
};
_local5++;
};
};
};
if (_local4){
return;
};
if (tempObj != null){
tempObj = null;
};
gameName = inputName.shuru_txt.text;
SaveGameObj.initSaveObj();
trace(((("`````````````````新保存一个关卡" + save.levelArr) + ",,,") + gameName));
this.removeInputName();
beginPage.visible = false;
level = new Level();
this.addChild(level);
level.number_mc.gotoAndStop(1);
level.number_mc.visible = false;
TweenLite.to(level.number_mc, 0.5, {onComplete:showLevel});
_stage.removeEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
}
private function backName(_arg1:MouseEvent):void{
MySound.playBtnSound();
this.removeInputName();
}
private function levelBack(_arg1:MouseEvent):void{
MySound.playBtnSound();
this.removeChild(level);
level = null;
if (loadPage != null){
loadPage.visible = true;
} else {
if (beginPage != null){
beginPage.visible = true;
if ((((save.levelArr == null)) || ((save.levelArr.length == 0)))){
beginPage.mcBtn.load_btn.visible = false;
} else {
beginPage.mcBtn.load_btn.visible = true;
};
};
};
}
private function loadPageBack(_arg1:MouseEvent):void{
var _local2:int;
if (save.levelArr != null){
_local2 = 0;
while (_local2 < 7) {
loadPage[("btn" + (_local2 + 1))].removeEventListener(MouseEvent.CLICK, btnClick);
_local2++;
};
};
loadPage.back_btn.removeEventListener(MouseEvent.CLICK, loadPageBack);
beginPage.visible = true;
this.removeChild(loadPage);
loadPage = null;
isLoadGame = false;
MySound.playBtnSound();
if ((((save.levelArr == null)) || ((save.levelArr.length == 0)))){
beginPage.mcBtn.load_btn.visible = false;
} else {
beginPage.mcBtn.load_btn.visible = true;
};
}
private function levelNext(_arg1:MouseEvent):void{
MySound.playBtnSound();
this.removeLevelPage();
if (loadPage != null){
this.removeLoadPage();
};
if (beginPage != null){
this.removeBeginPage();
};
var _local2:int;
while (_local2 < save.levelArr.length) {
if (gameName == save.levelArr[_local2].name){
gameLevel = save.levelArr[_local2].getLevel;
};
_local2++;
};
playGame(gameName);
}
private function sureYes(_arg1:MouseEvent):void{
MySound.playBtnSound();
var _local2:Number = StringHandler.strChangNum(delLoadStr);
var _local3:String = loadPage[("wb" + _local2)].text;
var _local4:int;
while (_local4 < save.levelArr.length) {
if (save.levelArr[_local4].name == _local3){
SaveGameObj.removeObj(_local3);
delLoadStr = "";
loadPage.sureDel_mc.visible = false;
loadPage[("btn" + _local2)].removeEventListener(MouseEvent.CLICK, btnClick);
loadPage[("cha" + _local2)].removeEventListener(MouseEvent.CLICK, chaClick);
};
_local4++;
};
var _local5:int;
while (_local5 < 7) {
loadPage[("btn" + (_local5 + 1))].removeEventListener(MouseEvent.CLICK, btnClick);
loadPage[("cha" + (_local5 + 1))].removeEventListener(MouseEvent.CLICK, chaClick);
trace("删除点击事件");
_local5++;
};
updateLoadPage();
}
private function winPageFrame(_arg1:Event):void{
if (winPage.currentFrame == winPage.totalFrames){
winPage.removeEventListener(Event.ENTER_FRAME, winPageFrame);
winPage.playGame_btn.visible = true;
winPage.lastMoreGame_btn.visible = true;
winPage.playGame_btn.addEventListener(MouseEvent.CLICK, init);
};
}
private function playGameHandler(_arg1:MouseEvent):void{
trace("前面要先进行一个加载");
inputName = new InputName();
this.addChild(inputName);
inputName.shuru_txt.text = "";
inputName.shuru_txt.maxChars = 10;
inputName.tishi_mc.visible = false;
inputName.yes_btn.addEventListener(MouseEvent.CLICK, yesName);
inputName.back_btn.addEventListener(MouseEvent.CLICK, backName);
MySound.playBtnSound();
_stage.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
}
private function removeLevelPage():void{
if (level != null){
this.removeChild(level);
level.back_btn.removeEventListener(MouseEvent.CLICK, levelBack);
level.next_btn.removeEventListener(MouseEvent.CLICK, levelNext);
level = null;
};
}
private function quitGameHandler(_arg1:Event):void{
init();
}
private function removeBeginPage():void{
if (beginPage != null){
beginPage.mcBtn.load_btn.removeEventListener(MouseEvent.CLICK, loadHandler);
beginPage.mcBtn.playGame_btn.removeEventListener(MouseEvent.CLICK, playGameHandler);
this.removeChild(beginPage);
beginPage = null;
};
}
private function sureNo(_arg1:MouseEvent):void{
MySound.playBtnSound();
loadPage.sureDel_mc.visible = false;
delLoadStr = "";
}
private function removeLoadPage():void{
if (loadPage != null){
loadPage.back_btn.removeEventListener(MouseEvent.CLICK, loadPageBack);
this.removeChild(loadPage);
loadPage = null;
};
}
public function setStage(_arg1:DisplayObjectContainer):void{
_stage = _arg1;
}
private function winPageHandler():void{
winPage = new WinPage();
this.addChild(winPage);
winPage.addEventListener(Event.ENTER_FRAME, winPageFrame);
winPage.playGame_btn.visible = false;
winPage.lastMoreGame_btn.visible = false;
}
private function moreGamesHandler(_arg1:MouseEvent){
MovieClip(this.root).LogoMoreGame("moregames-menu");
}
private function playGame(_arg1:String):void{
initGameDataNumber(_arg1);
var _local2:int;
while (_local2 < save.levelArr.length) {
if (gameName == save.levelArr[_local2].name){
GameData.gameLevel = gameLevel;
GameData.initTargetGoal();
};
_local2++;
};
GameData.initLevelUpSellPrice();
beginDongHua = new DongHuaPage();
this.addChild(beginDongHua);
beginDongHua.x = 352;
beginDongHua.y = 0xFF;
beginDongHua.addEventListener(MouseEvent.CLICK, donghuaClick);
beginDongHua.addEventListener(Event.ENTER_FRAME, donghuaFrame);
beginDongHua.gotoAndPlay(1);
}
private function tishiYes(_arg1:MouseEvent):void{
MySound.playBtnSound();
gameName = inputName.shuru_txt.text;
SaveGameObj.coverSaveObj();
this.removeInputName();
beginPage.visible = false;
level = new Level();
this.addChild(level);
level.number_mc.gotoAndStop(1);
level.number_mc.visible = false;
TweenLite.to(level.number_mc, 0.5, {onComplete:showLevel});
_stage.removeEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
}
private function chaClick(_arg1:MouseEvent):void{
MySound.playBtnSound();
loadPage.sureDel_mc.visible = true;
loadPage.sureDel_mc.yes_btn.addEventListener(MouseEvent.CLICK, sureYes);
loadPage.sureDel_mc.no_btn.addEventListener(MouseEvent.CLICK, sureNo);
var _local2:String = _arg1.target.name;
delLoadStr = _local2;
}
private function tishiNo(_arg1:MouseEvent):void{
MySound.playBtnSound();
inputName.tishi_mc.yes_btn.removeEventListener(MouseEvent.CLICK, tishiYes);
inputName.tishi_mc.no_btn.removeEventListener(MouseEvent.CLICK, tishiNo);
inputName.tishi_mc.visible = false;
}
private function removeInputName():void{
if (inputName != null){
inputName.yes_btn.removeEventListener(MouseEvent.CLICK, yesName);
inputName.back_btn.removeEventListener(MouseEvent.CLICK, backName);
this.removeChild(inputName);
inputName = null;
};
}
private function initGameDataNumber(_arg1:String):void{
var _local2:int;
while (_local2 < save.levelArr.length) {
if (save.levelArr[_local2].name == _arg1){
GameData.totalGold = save.levelArr[_local2].totalGold;
GameData.gameLevel = save.levelArr[_local2].getLevel;
GameData.deskLevel = save.levelArr[_local2].deskLevel;
GameData.ditanLevel = save.levelArr[_local2].ditanLevel;
GameData.wallLevel = save.levelArr[_local2].wallLevel;
GameData.clothesLevel = save.levelArr[_local2].clothesLevel;
GameData.flowerLevel = save.levelArr[_local2].flowerLevel;
GameData.waiterNum = save.levelArr[_local2].waiterNum;
GameData.roomNum = save.levelArr[_local2].roomNum;
GameData.chairNum = save.levelArr[_local2].chairNum;
GameData.lightBool = save.levelArr[_local2].lightBool;
GameData.initTargetGoal();
break;
};
_local2++;
};
}
private function donghuaFrame(_arg1:Event):void{
MySound.lessBackSound();
if (beginDongHua.currentFrame == beginDongHua.totalFrames){
beginDongHua.removeEventListener(Event.ENTER_FRAME, donghuaFrame);
this.removeChild(beginDongHua);
beginDongHua = null;
trace("游戏正式开始");
game = new Game();
this.addChild(game);
(game as Game).init();
(game as Game).addEventListener(Game.QUIT_GAME, quitGameHandler);
};
}
private function fanyeClick(_arg1:MouseEvent):void{
if (save.levelArr == null){
return;
};
var _local2:String = _arg1.target.name;
var _local3:Number = (Math.floor(((save.levelArr.length - 1) / 7)) + 1);
if (_local2 == "back_btn"){
if (currentPageNum > 1){
currentPageNum--;
loadPage.fanye_mc.num_txt.text = currentPageNum.toString();
fanyeHandler();
} else {
return;
};
} else {
if (_local2 == "next_btn"){
if (currentPageNum < _local3){
currentPageNum++;
loadPage.fanye_mc.num_txt.text = currentPageNum.toString();
fanyeHandler();
} else {
return;
};
};
};
}
private function levelClick(_arg1:MouseEvent):void{
MySound.playBtnSound();
var _local2:String = _arg1.target.name;
trace(("当前是打开的关卡::" + _local2));
gameLevel = StringHandler.strChangNum(_local2);
this.removeLevelPage();
if (loadPage != null){
this.removeLoadPage();
};
if (beginPage != null){
this.removeBeginPage();
};
playGame(gameName);
}
private function donghuaClick(_arg1:MouseEvent):void{
if (beginDongHua.currentFrame < 208){
beginDongHua.gotoAndPlay(208);
} else {
if (beginDongHua.currentFrame >= 208){
beginDongHua.gotoAndPlay(362);
beginDongHua.removeEventListener(MouseEvent.CLICK, donghuaClick);
};
};
}
private function beginLoadData():void{
}
private function fanyeHandler():void{
var _local1:int;
while (_local1 < 7) {
loadPage[("btn" + (_local1 + 1))].removeEventListener(MouseEvent.CLICK, btnClick);
loadPage[("cha" + (_local1 + 1))].removeEventListener(MouseEvent.CLICK, chaClick);
trace("删除点击事件");
_local1++;
};
var _local2:int;
while (_local2 < 7) {
if ((((currentPageNum - 1) * 7) + _local2) < save.levelArr.length){
loadPage[("wb" + (_local2 + 1))].text = save.levelArr[(_local2 + ((currentPageNum - 1) * 7))].name;
loadPage[("btn" + (_local2 + 1))].addEventListener(MouseEvent.CLICK, btnClick);
loadPage[("cha" + (_local2 + 1))].addEventListener(MouseEvent.CLICK, chaClick);
} else {
loadPage[("wb" + (_local2 + 1))].text = "";
};
_local2++;
};
}
}
}//package
Section 105
//OK (OK)
package {
import flash.media.*;
public dynamic class OK extends Sound {
}
}//package
Section 106
//PausePage (PausePage)
package {
import flash.display.*;
public dynamic class PausePage extends MovieClip {
public var continue_btn:SimpleButton;
}
}//package
Section 107
//PleaseWaiting (PleaseWaiting)
package {
import flash.display.*;
public dynamic class PleaseWaiting extends MovieClip {
}
}//package
Section 108
//PrintInvoice (PrintInvoice)
package {
import flash.media.*;
public dynamic class PrintInvoice extends Sound {
}
}//package
Section 109
//Room (Room)
package {
import flash.display.*;
public dynamic class Room extends MovieClip {
public var dian2:MovieClip;
public var dian3:MovieClip;
public var dian5:MovieClip;
public var dian8:MovieClip;
public var dian9:MovieClip;
public var dian4:MovieClip;
public var hunsha_mc:MovieClip;
public var dian6:MovieClip;
public var dian10:MovieClip;
public var dian11:MovieClip;
public var dian12:MovieClip;
public var person_mc:MovieClip;
public var dian7:MovieClip;
public var men_mc:MovieClip;
public var roomNum_mc:MovieClip;
public var dian1:MovieClip;
}
}//package
Section 110
//SaveGameObj (SaveGameObj)
package {
import game.*;
import util.*;
public class SaveGameObj {
public static function saveObj():void{
var _local1:Object = new Object();
_local1.name = MyGame.gameName;
var _local2:int;
while (_local2 < MyGame.save.levelArr.length) {
if (MyGame.save.levelArr[_local2].name == _local1.name){
MyGame.save.levelArr[_local2].totalGold = GameData.totalGold;
if (MyGame.save.levelArr[_local2].getLevel <= GameData.gameLevel){
MyGame.save.levelArr[_local2].getLevel = GameData.gameLevel;
};
MyGame.save.levelArr[_local2].deskLevel = GameData.deskLevel;
MyGame.save.levelArr[_local2].ditanLevel = GameData.ditanLevel;
MyGame.save.levelArr[_local2].wallLevel = GameData.wallLevel;
MyGame.save.levelArr[_local2].clothesLevel = GameData.clothesLevel;
MyGame.save.levelArr[_local2].flowerLevel = GameData.flowerLevel;
MyGame.save.levelArr[_local2].waiterNum = GameData.waiterNum;
MyGame.save.levelArr[_local2].roomNum = GameData.roomNum;
MyGame.save.levelArr[_local2].chairNum = GameData.chairNum;
MyGame.save.levelArr[_local2].lightBool = GameData.lightBool;
trace("覆盖当前进行的关卡保存的数据");
return;
};
_local2++;
};
}
public static function coverSaveObj():void{
var _local1:Object = new Object();
_local1.name = MyGame.gameName;
var _local2:int;
while (_local2 < MyGame.save.levelArr.length) {
if (MyGame.save.levelArr[_local2].name == _local1.name){
MyGame.save.levelArr[_local2].totalGold = 0;
MyGame.save.levelArr[_local2].getLevel = 1;
MyGame.save.levelArr[_local2].deskLevel = 1;
MyGame.save.levelArr[_local2].ditanLevel = 1;
MyGame.save.levelArr[_local2].wallLevel = 1;
MyGame.save.levelArr[_local2].clothesLevel = 0;
MyGame.save.levelArr[_local2].flowerLevel = 0;
MyGame.save.levelArr[_local2].waiterNum = 0;
MyGame.save.levelArr[_local2].roomNum = 2;
MyGame.save.levelArr[_local2].chairNum = 3;
MyGame.save.levelArr[_local2].lightBool = false;
break;
};
_local2++;
};
}
public static function initSaveObj():void{
var _local1:Object = new Object();
_local1.name = MyGame.gameName;
_local1.totalGold = 0;
_local1.getLevel = 1;
_local1.deskLevel = 1;
_local1.ditanLevel = 1;
_local1.wallLevel = 1;
_local1.clothesLevel = 0;
_local1.flowerLevel = 0;
_local1.waiterNum = 0;
_local1.roomNum = 2;
_local1.chairNum = 3;
_local1.lightBool = false;
MyGame.save.putLevel(_local1);
trace("初始化存储的数据");
}
public static function removeObj(_arg1:String):void{
var _local2:int;
if (MyGame.save.levelArr != null){
_local2 = 0;
while (_local2 < MyGame.save.levelArr.length) {
if (_arg1 == MyGame.save.levelArr[_local2].name){
MyGame.save.levelArr.splice(_local2, 1);
MyGame.save.updateFlxSave();
};
_local2++;
};
};
}
}
}//package
Section 111
//ShouYinYuan (ShouYinYuan)
package {
import flash.display.*;
public dynamic class ShouYinYuan extends MovieClip {
public var display_mc:MovieClip;
}
}//package
Section 112
//SoldOut (SoldOut)
package {
import flash.display.*;
public dynamic class SoldOut extends MovieClip {
}
}//package
Section 113
//TargetGoal (TargetGoal)
package {
import flash.display.*;
public dynamic class TargetGoal extends MovieClip {
public var mc6:MovieClip;
public var mc2:MovieClip;
public var mc4:MovieClip;
public var mc1:MovieClip;
public var mc3:MovieClip;
public var mc5:MovieClip;
}
}//package
Section 114
//Wait (Wait)
package {
import flash.media.*;
public dynamic class Wait extends Sound {
}
}//package
Section 115
//Waitress (Waitress)
package {
import flash.media.*;
public dynamic class Waitress extends Sound {
}
}//package
Section 116
//WinBackSound (WinBackSound)
package {
import flash.media.*;
public dynamic class WinBackSound extends Sound {
}
}//package
Section 117
//WinPage (WinPage)
package {
import flash.display.*;
import flash.geom.*;
import flash.events.*;
import flash.filters.*;
import flash.utils.*;
import flash.net.*;
import flash.media.*;
import flash.text.*;
import flash.system.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.printing.*;
import flash.profiler.*;
import flash.sampler.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class WinPage extends MovieClip {
public var playGame_btn:SimpleButton;
public var lastMoreGame_btn:SimpleButton;
public var __id6_:MovieClip;
public function WinPage(){
addFrameScript(10, frame11);
__setProp___id6__();
}
function __setProp___id6__(){
try {
__id6_["componentInspectorSetting"] = true;
} catch(e:Error) {
};
__id6_.Type = "logo-donepage";
__id6_.Goto = 1;
try {
__id6_["componentInspectorSetting"] = false;
} catch(e:Error) {
};
}
function frame11(){
stop();
}
}
}//package