Combined Code
movieClip 2 spaceBeepID {
frame 1 {
stop();
}
}
movieClip 4 songID {
}
movieClip 6 {
}
movieClip 7 star1ID {
}
movieClip 9 m2ID {
frame 1 {
stop();
}
frame 2 {
stop();
}
frame 3 {
stop();
}
}
frame 1 {
m1Mass = 5;
distx = 0;
disty = 0;
distJx = 0;
distJy = 0;
dist = 0;
a = 0;
b = 0;
c = 0;
distJ = 0;
aJ = 0;
bJ = 0;
cJ = 0;
n = 0;
s = 0;
G = 200;
force = 0;
forceJ = 0;
dx = 0;
dy = 0;
i = 0;
j = 0;
cc = 0;
_root.attachMovie('songID', 'songMC', 1);
m2Array = new Array();
wPer = 0;
hPer = 0;
randMass = 0;
randPosx = 0;
randPosy = 0;
randx = 0;
randy = 0;
xx = 0;
yy = 0;
spawnBuffer = 0;
camBoundsLeft = 0;
camBoundsRight = 0;
camBoundsTop = 0;
camBoundsBot = 0;
Mouse.hide();
m1._width = m1Mass;
m1._height = m1Mass;
onEnterFrame = function () {
dx = m1._x - _xmouse;
dy = m1._y - _ymouse;
m1._x -= dx / 10;
m1._y -= dy / 10;
wPer = m1._width / cam._width;
if (wPer > 0.06) {
cc += 0.01;
cam._width += 4 * (cc + m1Mass / 100);
cam._height += 3 * (cc + m1Mass / 100);
}
if (wPer < 0.02) {
cam._width -= 4 * m1Mass;
cam._height -= 3 * m1Mass;
}
randMass = random(m1Mass * 1.05);
camBoundsLeft = cam._x - cam._width / 2;
camBoundsRight = cam._x + cam._width / 2;
camBoundsTop = cam._y - cam._height / 2;
camBoundsBot = cam._y + cam._height / 2;
randx = Math.floor(Math.random() * (1 + camBoundsRight - camBoundsLeft)) + camBoundsLeft;
randy = Math.floor(Math.random() * (1 + camBoundsBot - camBoundsTop)) + camBoundsTop;
spawnBuffer = random(150);
if (randx >= cam._x) {
xx = camBoundsRight - randx;
randPosx = randx + xx + spawnBuffer;
} else {
xx = camBoundsLeft - randx;
randPosx = randx + xx - spawnBuffer;
}
if (randy >= cam._y) {
yy = camBoundsBot - randy;
randPosy = randy + yy + spawnBuffer;
} else {
yy = camBoundsTop - randy;
randPosy = randy + yy - spawnBuffer;
}
m1Mass = m1._width;
m1Mass = m1._height;
++n;
if (n > 3) {
n = 0;
if (m2Array.length < 20) {
s += 1;
newClip = _root.attachMovie('m2ID', 'm2' + s, s, {'_x': randx, '_y': randPosy, '_width': randMass, '_height': randMass});
m2Array.push(newClip);
}
}
i = 0;
while (i < m2Array.length) {
m2Array[i]._width = m2Mass;
m2Array[i]._height = m2Mass;
distx = m1._x - m2Array[i]._x;
disty = m1._y - m2Array[i]._y;
a = distx * distx;
b = disty * disty;
c = a + b;
dist = Math.sqrt(c);
force = G * (m1Mass * m2Array[i]._width) / dist * dist / m2Array[i]._width;
if (distx > 0) {
m2Array[i]._x += force * (0.01 * distx);
} else {
m2Array[i]._x -= force * (0.01 * -distx);
}
if (disty > 0) {
m2Array[i]._y += force * (0.01 * disty);
} else {
m2Array[i]._y -= force * (0.01 * -disty);
}
if (m2Array[i]._width > 500) {
m2Array[i].gotoAndPlay(3);
}
if (m2Array[i]._width > m1Mass) {
m2Array[i].gotoAndPlay(2);
} else {
m2Array[i].gotoAndPlay(1);
}
if (m1.hitTest(m2Array[i])) {
if (m1Mass >= m2Array[i]._width) {
m1._width += m2Array[i]._width / 5;
m1._height += m2Array[i]._width / 5;
loadMovie('', m2Array[i]);
m2Array.splice(i, 1);
_root.attachMovie('spaceBeepID', 'spaceBeepMC', 1);
} else {
loadMovie('', m2Array[i]);
loadMovie('', m1);
m2Array.splice(i, 1);
Mouse.show();
loadMovie('child_lose.swf', cam.childLoseTarget);
}
}
j = 0;
while (j < m2Array.length) {
distJx = m2Array[i]._x - m2Array[j]._x;
distJy = m2Array[i]._y - m2Array[j]._y;
aJ = distJx * distJx;
bJ = distJy * distJy;
cJ = aJ + bJ;
distJ = Math.sqrt(cJ);
forceJ = G * (m2Array[j]._width * m2Array[i]._width) / distJ * distJ / m2Array[j]._width;
if (distJx > 0) {
m2Array[j]._x += forceJ * (0.01 * distJx);
} else {
m2Array[j]._x -= forceJ * (0.01 * -distJx);
}
if (distJy > 0) {
m2Array[j]._y += forceJ * (0.01 * distJy);
} else {
m2Array[j]._y -= forceJ * (0.01 * -distJy);
}
if (m2Array[i] != m2Array[j]) {
if (m2Array[i].hitTest(m2Array[j])) {
if (m2Array[j]._width <= m2Array[i]._width) {
loadMovie('', m2Array[j]);
m2Array.splice(j, 1);
m2Array[i]._width += m2Array[j]._width / 2;
m2Array[i]._height += m2Array[j]._width / 2;
} else {
loadMovie('', m2Array[i]);
m2Array.splice(i, 1);
m2Array[j]._width += m2Array[i]._width / 2;
m2Array[j]._height += m2Array[i]._width / 2;
}
}
}
++j;
}
++i;
}
};
}
movieClip 10 {
frame 1 {
stop();
}
frame 2 {
stop();
}
}
// unknown tag 88 length 63
movieClip 15 {
}
movieClip 16 {
frame 1 {
function camControl() {
parentColor.setTransform(camColor.getTransform());
var v3 = sX / this._width;
var v4 = sY / this._height;
_parent._x = cX - this._x * v3;
_parent._y = cY - this._y * v4;
_parent._xscale = 100 * v3;
_parent._yscale = 100 * v4;
}
function resetStage() {
var v2 = {'ra': 100, 'rb': 0, 'ga': 100, 'gb': 0, 'ba': 100, 'bb': 0, 'aa': 100, 'ab': 0};
parentColor.setTransform(v2);
_parent._xscale = 100;
_parent._yscale = 100;
_parent._x = 0;
_parent._y = 0;
}
this._visible = true;
var oldMode = Stage.scaleMode;
Stage.scaleMode = 'exactFit';
var cX = Stage.width / 2;
var cY = Stage.height / 2;
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
var camColor = new Color(this);
var parentColor = new Color(_parent);
this.onEnterFrame = camControl;
this.onUnload = resetStage;
onMouseMove = function () {
txt_mass.text = _root.m1._width;
};
}
}
instance cam of movieClip 16 {
onClipEvent (enterFrame) {
_x = _x + (_root.m1._x - _x) / 20;
_y = _y + (_root.m1._y - _y) / 20;
}
}