Frame 1
stop();
initPumkins = function () {
i = 1;
while (i <= maxPumkins) {
newname = "p" add i;
p0.duplicateMovieClip(newname, 12 + i);
p = eval (newname);
p.col = colors[i];
p.pumkin.initcolor = i;
p.myNum = i;
newname = "s" add i;
s0.duplicateMovieClip(newname, i);
p.myShadow = newname;
i++;
}
};
initClouds = function () {
c1.xv = 3;
c2.xv = 1.3;
c3.xv = 1.4;
c4.xv = 2;
i = 1;
while (i <= 4) {
c = eval ("c" + i);
c.onEnterFrame = function () {
this._x = this._x + this.xv;
if (this._x > 700) {
this._x = (this._x - 700) - this._width;
this._y = random(120);
}
};
i++;
}
};
transXYZ = function (x, y, z) {
widthDif = front._width - back._width;
ydif = front._y - back._y;
yw = y * widthDif;
w = back._width + yw;
groundY = back._y + (y * ydif);
basex = back._x - (yw / 2);
nx = basex + (x * w);
ny = groundY - (z * w);
nscale = minscale + ((100 - minscale) * y);
var o = new object();
o.x = nx;
o.y = ny;
o.scale = nscale;
o.groundY = groundY;
return(o);
};
makeRandomList = function (n) {
var a = new array();
var c = new array();
i = 1;
while (i <= n) {
a.unshift(i);
i++;
}
i = 1;
while (i <= n) {
pos = random(a.length);
b = a.splice(pos, 1)[0];
c.unshift(b);
i++;
}
return(c);
};
Instance of Symbol 48 MovieClip "p0" in Frame 1
/* no clip actions */
Instance of Symbol 64 MovieClip in Frame 1
/* no clip actions */
Frame 2
friction = 0.99;
elas = 0.6;
maxheight = 200;
minscale = 50;
gravity = -0.005;
colors = new array(0, "red", "blue", "green", "yellow", "orange", "purple", "pink", "brown", "gray", "white", "black");
maxPumkins = colors.length - 1;
initClouds();
initPumkins();
colorOrder = makeRandomList(maxPumkins);
colorOrder.unshift("x");
Frame 13
count = 0;
pumkinClicked = function (num) {
if (clickArray[num] == 0) {
clickArray[num] = 1;
clicked++;
}
if (clicked >= count) {
bringIn();
}
};
bringIn = function () {
trace(count);
if (count < maxPumkins) {
count++;
p = eval ("p" + colorOrder[count]);
p.orderNum = count;
x = random(100) / 100;
y = random(100) / 100;
z = 1;
xv = random(100) / 3000;
yv = random(100) / 3000;
if (random(2)) {
xv = -xv;
}
if (random(2)) {
yv = -yv;
}
p.place(x, y, z, xv, yv, zv);
p.incomingSnd.start();
} else {
i = 1;
while (i <= maxPumkins) {
p = eval ("p" + i);
p.jump(1);
i++;
}
}
clicked = 0;
clickArray = new array();
clickArray.unshift("x");
i = 1;
while (i <= count) {
clickArray.push(0);
i++;
}
};
Frame 14
bringIn();
trace(maxPumkins);
stop();
Instance of Symbol 21 MovieClip in Symbol 22 MovieClip Frame 1
onClipEvent (load) {
if (random(2)) {
_xscale = (-_xscale);
}
}
Symbol 34 MovieClip Frame 1
stop();
Symbol 46 MovieClip Frame 1
stop();
chance = 4;
onEnterFrame = function () {
if (random(100) < chance) {
gotoAndStop(random(4) + 1);
}
};
Symbol 46 MovieClip Frame 11
onEnterFrame = function () {
};
Symbol 46 MovieClip Frame 15
onEnterFrame = function () {
};
Symbol 46 MovieClip Frame 19
onEnterFrame = function () {
};
Symbol 46 MovieClip Frame 22
gotoAndStop (1);
Symbol 47 MovieClip Frame 1
function ChangeColor(colorRef) {
skin.gotoAndStop(colorRef);
}
function ChangeFace(faceName) {
switch (faceName) {
case "no" :
myface.gotoAndStop("no");
return;
case "roll" :
myface.gotoAndStop("roll");
return;
case "click" :
myface.gotoAndStop("click");
return;
case "speak" :
myface.gotoAndPlay("speak");
}
}
Symbol 47 MovieClip Frame 2
ChangeColor(initColor);
stop();
Symbol 48 MovieClip Frame 1
place = function (x_, y_, z_, xv_, yv_, zv_) {
active = 1;
x = x_;
y = y_;
z = z_;
xv = xv_;
yv = yv_;
zv = zv_;
pumkin.changeFace("click");
incoming = 1;
};
initSound = function () {
this.createEmptyMovieClip("speech", 1);
mySnd = new sound(speech);
mySnd.attachSound(col + ".mp3");
mySnd.setVolume(100);
this.createEmptyMovieClip("bounce", 2);
bounceSnd = new sound(bounce);
bounceSnd.attachSound("bounce");
this.createEmptyMovieClip("incoming", 3);
incomingSnd = new sound(incoming);
incomingSnd.setVolume(10);
incomingSnd.attachSound("incoming");
};
jump = function (high) {
pumkin.changeFace("speak");
leaping = 1;
xv = random(100) / 3000;
yv = random(100) / 3000;
zv = 0.04 + (random(10) / 300);
if (high == 1) {
xv = xv * 2;
yv = yv * 2;
zv = zv * 2;
pumkin.changeFace("click");
}
if (random(2)) {
xv = -xv;
}
if (random(2)) {
yv = -yv;
}
};
frameAction = function () {
if (yscaleFactor < 1) {
yscaleFactor = yscaleFactor * 1.3;
if (yScaleFactor > 1) {
yScaleFactor = 1;
}
}
if (((x + xv) > 1) || ((x + xv) < 0)) {
xv = -xv;
}
if (((y + yv) > 1) || ((y + yv) < 0)) {
yv = -yv;
}
x = x + xv;
y = y + yv;
zv = zv + _parent.gravity;
nz = z + zv;
xv = xv * _parent.friction;
yv = yv * _parent.friction;
if (nz < 0) {
if (incoming == 1) {
pumkin.changeFace("no");
}
incoming = 0;
zv = (-zv) * _parent.elas;
xv = xv * _parent.elas;
yv = yv * _parent.elas;
nz = 0;
leaping = 0;
vol = (zv / 0.06) * 100;
if (vol > 100) {
vol = 100;
}
if (vol > 10) {
bounceSnd.setPan(-100 + (x * 200));
bounceSnd.setVolume(vol);
bounceSnd.start();
}
yscaleFactor = 1 - (zv * 7);
}
z = nz;
var o = _parent.transXYZ(x, y, z);
this._x = o.x;
this._y = o.y;
this._xscale = o.scale;
this._yscale = o.scale * yscaleFactor;
this.swapDepths(12 + int(100 * y));
s = _parent[myShadow];
s._x = _x;
s._y = o.groundY;
baseScale = o.scale;
sc = baseScale - (z * 200);
if (sc < 0) {
sc = 0;
}
s._xscale = sc;
s._yscale = sc;
};
doPress = function () {
pumkin.changeFace("click");
};
doRelease = function () {
mySnd.setPan(-50 + (x * 100));
mySnd.start();
jump();
_parent.pumkinClicked(orderNum);
};
doRollOver = function () {
pumkin.changeFace("roll");
};
doRollOut = function () {
if (!leaping) {
pumkin.changeFace("no");
}
};
myButton.onPress = function () {
doPress();
};
myButton.onRelease = function () {
doRelease();
};
myButton.onReleaseOutside = function () {
doRelease();
};
myButton.onRollOver = function () {
doRollOver();
};
myButton.onRollOut = function () {
doRollOut();
};
Symbol 48 MovieClip Frame 2
active = 0;
yscaleFactor = 1;
initSound();
stop();
onEnterFrame = function () {
if (active) {
frameAction();
}
};
Symbol 64 MovieClip Frame 1
stop();