Combined Code
movieClip 8 {
frame 25 {
gotoAndPlay(1);
}
}
movieClip 18 {
frame 14 {
gotoAndPlay(1);
}
}
movieClip 30 {
frame 1 {
stop();
}
frame 9 {
stop();
}
frame 18 {
stop();
}
frame 27 {
stop();
}
}
movieClip 38 {
frame 1 {
hit = '0';
ob1_y = /obstacle1/ob._y;
ob1_x = /obstacle1._x;
ob1_h = /obstacle1/ob._height / '2';
ob1_v = /obstacle1/ob._width / '2';
ob2_y = /obstacle2/ob._y;
ob2_x = /obstacle2._x;
ob2_h = /obstacle2/ob._height / '2';
ob2_v = /obstacle2/ob._width / '2';
ob3_y = /obstacle3/ob._y;
ob3_x = /obstacle3._x;
ob3_h = /obstacle3/ob._height / '2';
ob3_v = /obstacle3/ob._width / '2';
ob4_y = /obstacle4/ob._y;
ob4_x = /obstacle4._x;
ob4_h = /obstacle4/ob._height / '2';
ob4_v = /obstacle4/ob._width / '2';
ob5_y = /obstacle5/ob._y;
ob5_x = /obstacle5._x;
ob5_h = /obstacle5/ob._height / '2';
ob5_v = /obstacle5/ob._width / '2';
santa_y = /c2._y;
santa_x = /c2._x;
santa_h = /c2._height / '4';
santa_w = /c2._width / '4';
distance_x1 = ob1_x - santa_x;
distance_y1 = ob1_y - santa_y;
area1 = (ob1_h + ob1_w) * (santa_h + santa_w);
distance_x2 = ob2_x - santa_x;
distance_y2 = ob2_y - santa_y;
area2 = (ob2_h + ob2_w) * (santa_h + santa_w);
distance_x3 = ob3_x - santa_x;
distance_y3 = ob3_y - santa_y;
area3 = (ob3_h + ob3_w) * (santa_h + santa_w);
distance_x4 = ob4_x - santa_x;
distance_y4 = ob4_y - santa_y;
area4 = (ob4_h + ob4_w) * (santa_h + santa_w);
distance_x5 = ob5_x - santa_x;
distance_y5 = ob5_y - santa_y;
area5 = (ob5_h + ob5_w) * (santa_h + santa_w);
if (area1 >= distance_x1 * distance_x1 + distance_y1 * distance_y1) {
gotoAndPlay(3);
} else {
if (area2 >= distance_x2 * distance_x2 + distance_y2 * distance_y2) {
gotoAndPlay(3);
} else {
if (area3 >= distance_x3 * distance_x3 + distance_y3 * distance_y3) {
gotoAndPlay(3);
} else {
if (area4 >= distance_x4 * distance_x4 + distance_y4 * distance_y4) {
gotoAndPlay(3);
} else {
if (area5 >= distance_x5 * distance_x5 + distance_y5 * distance_y5) {
gotoAndPlay(3);
} else {
trace('safe');
}
}
}
}
}
}
frame 2 {
gotoAndPlay(1);
}
frame 3 {
trace('boom');
hit = '1';
}
frame 40 {
gotoAndPlay(1);
hit = '0';
}
}
movieClip 40 {
frame 2 {
gotoAndPlay(1);
}
}
movieClip 42 {
}
movieClip 44 {
}
movieClip 45 {
frame 1 {
stop();
}
frame 2 {
gotoAndPlay(1);
}
frame 3 {
stop();
}
frame 4 {
gotoAndPlay(3);
}
frame 5 {
stop();
}
frame 6 {
gotoAndPlay(5);
}
frame 7 {
stop();
}
frame 8 {
stop();
}
frame 9 {
stop();
}
frame 10 {
stop();
}
frame 11 {
stop();
}
frame 12 {
stop();
}
}
movieClip 46 {
frame 1 {
ob._y = '0' - ('75' + random('75'));
tellTarget ('ob') {
gotoAndPlay(random('10') + '1');
}
}
frame 2 {
if ('425' >= ob._y) {
ob._y = ob._y + ('5' + random('10'));
} else {
gotoAndPlay(4);
}
}
frame 3 {
gotoAndPlay(2);
}
frame 4 {
gotoAndPlay(1);
}
}
movieClip 50 {
frame 12 {
gotoAndPlay(1);
}
}
movieClip 55 {
frame 12 {
gotoAndPlay(1);
}
}
movieClip 57 {
}
movieClip 58 {
frame 1 {
/:step = random('9') + '3';
}
frame 2 {
gotoAndPlay(1);
}
}
movieClip 59 {
}
movieClip 61 {
frame 1 {
step = '15';
_x = /c2._x;
_y = /c2._y + '106';
}
frame 3 {
_y = _y + step;
gotoAndPlay(2);
if (_y >= '550') {
gotoAndPlay(1);
}
}
}
movieClip 77 {
frame 30 {
gotoAndPlay(1);
}
}
movieClip 79 {
frame 1 {
stop();
}
frame 8 {
stop();
}
frame 13 {
stop();
}
frame 18 {
stop();
}
frame 24 {
stop();
}
frame 30 {
stop();
}
frame 37 {
stop();
}
frame 42 {
stop();
}
frame 47 {
stop();
}
frame 53 {
stop();
}
frame 59 {
stop();
}
frame 67 {
stop();
}
frame 72 {
stop();
}
frame 77 {
stop();
}
frame 83 {
stop();
}
frame 89 {
play();
counter += '1';
}
frame 124 {
stop();
}
}
movieClip 85 {
frame 1 {
stop();
}
}
frame 35 {
gotoAndPlay(36);
}
button 91 {
on (release) {
gotoAndPlay(38);
}
}
frame 37 {
gotoAndPlay(36);
}
frame 38 {
/distance._y = '491.9';
tellTarget ('/gifts') {
gotoAndStop('three');
}
timer = '0';
/c2:counter = '0';
}
movieClip 94 {
}
frame 39 {
pi = '3.1416';
deltax = c2._x - c1._x;
deltay = c2._y - c1._y;
input = deltax * deltax + deltay * deltay;
call('sqrt');
distance = output;
ratio = deltay / deltax;
if ('0' < deltax) {
if ('1' < ratio) {
input = '1' / ratio;
call('arctan');
angle = '90' - output * '180' / pi;
} else {
if ('0' < ratio and ratio < '1') {
input = ratio;
call('arctan');
angle = output * '180' / '3.14';
} else {
if (ratio < '0' and '0' - '1' < ratio) {
input = ratio;
call('arctan');
angle = '360' + output * '180' / '3.14';
} else {
if (ratio < '0' - '1') {
input = '1' / ratio;
call('arctan');
angle = '270' - output * '180' / pi;
}
}
}
}
} else {
if (deltax < '0') {
if ('1' < ratio) {
input = '1' / ratio;
call('arctan');
angle = '270' - output * '180' / pi;
} else {
if ('0' < ratio and ratio < '1') {
input = ratio;
call('arctan');
angle = '180' + output * '180' / '3.14';
} else {
if (ratio < '0' and '0' - '1' < ratio) {
input = ratio;
call('arctan');
angle = '180' + output * '180' / '3.14';
} else {
if (ratio < '0' - '1') {
input = '1' / ratio;
call('arctan');
angle = '90' - output * '180' / pi;
}
}
}
}
} else {
if (deltax == '0') {
if ('0' < deltay) {
angle = '90';
} else {
if (deltay < '0') {
angle = '0' - '90';
} else {
if (deltay == '0') {
angle = 'null';
}
}
}
}
}
}
dline._xscale = distance * '10';
dline._yscale = distance * '10';
dline._x = c1._x;
dline._y = c1._y;
dline._rotation = angle;
}
frame 39 {
startDrag('/c2', true, '100', '275', '400', '275');
timer += '1';
/distance._y = /distance._y - '0.5';
trace(timer);
if ('472' >= timer) {
if (/c2:counter == '0') {
if ('150' >= /c2._x) {
tellTarget ('/c2') {
gotoAndPlay('left2');
}
} else {
if ('225' >= /c2._x) {
tellTarget ('/c2') {
gotoAndPlay('left1');
}
} else {
if ('275' >= /c2._x) {
tellTarget ('/c2') {
gotoAndPlay('bigBags');
}
} else {
if ('350' >= /c2._x) {
tellTarget ('/c2') {
gotoAndPlay('right1');
}
} else {
tellTarget ('/c2') {
gotoAndPlay('right2');
}
}
}
}
}
} else {
if (/c2:counter == '1') {
tellTarget ('/gifts') {
gotoAndStop('two');
}
if ('150' >= /c2._x) {
tellTarget ('/c2') {
gotoAndPlay('left2m');
}
} else {
if ('225' >= /c2._x) {
tellTarget ('/c2') {
gotoAndPlay('left1m');
}
} else {
if ('275' >= /c2._x) {
tellTarget ('/c2') {
gotoAndPlay('medBags');
}
} else {
if ('350' >= /c2._x) {
tellTarget ('/c2') {
gotoAndPlay('right1m');
}
} else {
tellTarget ('/c2') {
gotoAndPlay('right2m');
}
}
}
}
}
} else {
if (/c2:counter == '2') {
tellTarget ('/gifts') {
gotoAndStop('one');
}
if ('150' >= /c2._x) {
tellTarget ('/c2') {
gotoAndPlay('left2m');
}
} else {
if ('225' >= /c2._x) {
tellTarget ('/c2') {
gotoAndPlay('left1m');
}
} else {
if ('275' >= /c2._x) {
tellTarget ('/c2') {
gotoAndPlay('medBags');
}
} else {
if ('350' >= /c2._x) {
tellTarget ('/c2') {
gotoAndPlay('right1m');
}
} else {
tellTarget ('/c2') {
gotoAndPlay('right2m');
}
}
}
}
}
} else {
if (/c2:counter == '3') {
tellTarget ('/gifts') {
gotoAndStop('zero');
}
if ('150' >= /c2._x) {
tellTarget ('/c2') {
gotoAndPlay('left2s');
}
} else {
if ('225' >= /c2._x) {
tellTarget ('/c2') {
gotoAndPlay('left1s');
}
} else {
if ('275' >= /c2._x) {
tellTarget ('/c2') {
gotoAndPlay('smallBags');
}
} else {
if ('350' >= /c2._x) {
tellTarget ('/c2') {
gotoAndPlay('right1s');
}
} else {
tellTarget ('/c2') {
gotoAndPlay('right2s');
}
}
}
}
}
} else {
gotoAndPlay(143);
}
}
}
}
} else {
gotoAndPlay(93);
}
}
frame 40 {
if (/detect:hit == '0') {
gotoAndPlay(39);
} else {
gotoAndPlay(52);
}
}
frame 41 {
x = '1';
iterations = '20';
i = '0';
while (i < iterations) {
x -= (x * x - input) / '2' * x;
i += '1';
}
output = x;
}
frame 48 {
x = input;
arctan = x - x * x * x / '3' + x * x * x * x * x / '5' - x * x * x * x * x * x * x / '7' + x * x * x * x * x * x * x * x * x / '9' - x * x * x * x * x * x * x * x * x * x * x / '11' + x * x * x * x * x * x * x * x * x * x * x * x * x / '13' - x * x * x * x * x * x * x * x * x * x * x * x * x * x * x / '15' + x * x * x * x * x * x * x * x * x * x * x * x * x * x * x * x * x / '17' - x * x * x * x * x * x * x * x * x * x * x * x * x * x * x * x * x * x * x / '19' + x * x * x * x * x * x * x * x * x * x * x * x * x * x * x * x * x * x * x * x * x / '21' - x * x * x * x * x * x * x * x * x * x * x * x * x * x * x * x * x * x * x * x * x * x * x / '23';
output = arctan;
}
frame 52 {
stopDrag();
tellTarget ('/c2') {
gotoAndPlay('tumbling');
}
trace(/detect:hit);
}
frame 53 {
if (/detect:hit == '0') {
gotoAndPlay(39);
}
}
frame 87 {
gotoAndPlay(39);
}
frame 93 {
stopAllSounds();
}
frame 142 {
gotoAndPlay(193);
}
frame 143 {
stopAllSounds();
}
frame 192 {
gotoAndPlay(193);
}
frame 247 {
stop();
}