Frame 1
Object.prototype.stageW = 600;
Object.prototype.stageH = 600;
Object.prototype.frameRate = 12;
totalActors = 3 + random(15);
i = 1;
while (i < totalActors) {
jack.duplicateMovieClip("proto" + i, 10 + i);
with (eval ("proto" + i)) {
_x = random(600);
_y = random(600);
}
i++;
}
stop();
Instance of Symbol 2 MovieClip "jack" in Frame 1
onClipEvent (load) {
stageXcenter = 150 + random(300);
stageYcenter = 150 + random(300);
stageRef = new Object();
scalePlusMinus = ((1 + random(2)) * 2) - 3;
scalingJack = false;
scaleQ = 0.1;
speedQ = 0.2;
}
onClipEvent (mouseUp) {
if (scalingJack) {
scalingJack = false;
scalePlusMinus = scalePlusMinus * -1;
} else {
scalingJack = true;
}
}
onClipEvent (enterFrame) {
stageRef.x = _xmouse;
stageRef.y = _ymouse;
this.localToGlobal(stageRef);
scaleFactor = (scaleQ * scalePlusMinus) * Math.round(Math.sqrt(Math.pow(Math.abs(stageRef.x - this.stageXcenter), 2) + Math.pow(Math.abs(stageRef.y - this.stageYcenter), 2)));
myX = _x;
myY = _y;
myWidth = _width;
myHeight = _height;
if (scalingJack) {
if (0 < (_xscale + scaleFactor)) {
_xscale = (_xscale + scaleFactor);
_yscale = (_yscale + scaleFactor);
} else {
_xscale = 10;
_yscale = 10;
}
myX = myX - ((_width - myWidth) / 2);
myY = myY - ((_height - myHeight) / 2);
myWidth = _width;
myHeight = _height;
}
myX = myX + ((this.stageXcenter - stageRef.x) * speedQ);
myY = myY + ((this.stageYcenter - stageRef.y) * speedQ);
if (this.stageW < myX) {
myX = (myX - this.stageW) - _width;
} else if ((myX + myWidth) < 0) {
myX = (myX + myWidth) + this.stageW;
}
if (this.stageH < myY) {
myY = (myY - this.stageH) - _height;
} else if ((myY + myHeight) < 0) {
myY = (myY + myHeight) + this.stageH;
}
_width = myWidth;
_height = myHeight;
_x = myX;
_y = myY;
}
Symbol 2 MovieClip Frame 1
stop();