Combined Code
movieClip 2 {
}
// unknown tag 88 length 63
movieClip 7 cust {
frame 1 {
function seektarget() {
if (this.money >= limit1) {
if (this.targetnum == 1) {
target = _root.target1;
} else {
target = _root.target2;
}
} else {
if (this.money >= limit2) {
if (this.targetnum == 1) {
target = _root.target2;
} else {
target = _root.target1;
}
} else {
if (this.doneshopping == false) {
target = _root.cashier;
} else {
target = _root.exitdoor;
}
}
}
if (this._y != target._y) {
this._y += (target._y - this._y) / speedy;
}
if (this._x != target._x) {
this._x += (target._x - this._x) / speedx;
}
}
function takeItems() {
if (this.custmask.hitTest(target) && target != _root.cashier) {
--money;
}
}
this.money = int(Math.random() * 50) + 1;
this.initmoney = this.money;
this.limit1 = int(Math.random() * money) + 1;
this.limit2 = int(Math.random() * limit1) + 1;
this.targetnum = int(Math.random() * 2) + 1;
this.doneshopping = false;
this.speedx = int(Math.random() * 60) + 30;
this.speedy = int(Math.random() * 60) + 30;
this.name.text = this._name;
this.onEnterFrame = function () {
this.moneyt.text = '$' + money;
seektarget();
takeItems();
if (this.custmask.hitTest(_root.cashier) && this.money <= limit1) {
_root.profit += limit1 + limit2;
this.doneshopping = true;
}
if (this.custmask.hitTest(_root.exitdoor) && this.doneshopping == true) {
++_root.donecust;
_root.missedsales += this.money + 1;
this.swapDepths(_parent.getNextHighestDepth());
this.removeMovieClip();
}
};
}
}
frame 1 {
nocust = 1;
instorecust = 0;
donecust = 0;
profit = 0;
missedsales = 0;
}
// unknown tag 88 length 35
movieClip 11 {
}
movieClip 14 {
}
movieClip 16 {
}
button 21 {
on (release) {
++nocust;
xloc = Math.random() * 550 + 1;
yloc = Math.random() * 400 + 1;
_root.attachMovie('cust', 'cust_' + nocust, _root.getNextHighestDepth(), {'_x': xloc, '_y': yloc});
}
}
movieClip 23 {
frame 1 {
this.onEnterFrame = function () {
this.UIt.text = 'Profit : $' + _root.profit + '\nCustomers: ' + _root.nocust + '\nIn-Store: ' + (_root.nocust - _root.donecust) + '\nMissedSales: $' + _root.missedsales;
};
}
}
movieClip 24 {
}
// unknown tag 88 length 94