Frame 1
function bitOR(a, b) {
var _local1 = (a & 1) | (b & 1);
var _local2 = (a >>> 1) | (b >>> 1);
return((_local2 << 1) | _local1);
}
function bitXOR(a, b) {
var _local1 = (a & 1) ^ (b & 1);
var _local2 = (a >>> 1) ^ (b >>> 1);
return((_local2 << 1) | _local1);
}
function bitAND(a, b) {
var _local1 = (a & 1) & (b & 1);
var _local2 = (a >>> 1) & (b >>> 1);
return((_local2 << 1) | _local1);
}
function addme(x, y) {
var _local1 = (x & 65535) + (y & 65535);
var _local2 = ((x >> 16) + (y >> 16)) + (_local1 >> 16);
return((_local2 << 16) | (_local1 & 65535));
}
function rhex(num) {
var _local1 = num;
str = "";
j = 0;
while (j <= 3) {
str = str + (hex_chr.charAt((_local1 >> ((j * 8) + 4)) & 15) + hex_chr.charAt((_local1 >> (j * 8)) & 15));
j++;
}
return(str);
}
function str2blks_MD5(str) {
var _local1 = str;
nblk = ((_local1.length + 8) >> 6) + 1;
blks = new Array(nblk * 16);
i = 0;
while (i < (nblk * 16)) {
blks[i] = 0;
i++;
}
i = 0;
while (i < _local1.length) {
blks[i >> 2] = blks[i >> 2] | (_local1.charCodeAt(i) << ((((_local1.length * 8) + i) % 4) * 8));
i++;
}
blks[i >> 2] = blks[i >> 2] | (128 << ((((_local1.length * 8) + i) % 4) * 8));
var _local2 = _local1.length * 8;
blks[(nblk * 16) - 2] = _local2 & 255;
blks[(nblk * 16) - 2] = blks[(nblk * 16) - 2] | (((_local2 >>> 8) & 255) << 8);
blks[(nblk * 16) - 2] = blks[(nblk * 16) - 2] | (((_local2 >>> 16) & 255) << 16);
blks[(nblk * 16) - 2] = blks[(nblk * 16) - 2] | (((_local2 >>> 24) & 255) << 24);
return(blks);
}
function rol(num, cnt) {
return((num << cnt) | (num >>> (32 - cnt)));
}
function cmn(q, a, b, x, s, t) {
return(addme(rol(addme(addme(a, q), addme(x, t)), s), b));
}
function ff(a, b, c, d, x, s, t) {
var _local1 = b;
return(cmn(bitOR(bitAND(_local1, c), bitAND(~_local1, d)), a, _local1, x, s, t));
}
function gg(a, b, c, d, x, s, t) {
return(cmn(bitOR(bitAND(b, d), bitAND(c, ~d)), a, b, x, s, t));
}
function hh(a, b, c, d, x, s, t) {
return(cmn(bitXOR(bitXOR(b, c), d), a, b, x, s, t));
}
function ii(a, b, c, d, x, s, t) {
return(cmn(bitXOR(c, bitOR(b, ~d)), a, b, x, s, t));
}
function calcMD5(str) {
x = str2blks_MD5(str);
a = 1732584193 /* 0x67452301 */;
b = -271733879;
c = -1732584194;
d = 271733878 /* 0x10325476 */;
var _local1;
i = 0;
while (i < x.length) {
olda = a;
oldb = b;
oldc = c;
oldd = d;
_local1 = 0;
a = ff(a, b, c, d, x[i + 0], 7, -680876936);
d = ff(d, a, b, c, x[i + 1], 12, -389564586);
c = ff(c, d, a, b, x[i + 2], 17, 606105819);
b = ff(b, c, d, a, x[i + 3], 22, -1044525330);
a = ff(a, b, c, d, x[i + 4], 7, -176418897);
d = ff(d, a, b, c, x[i + 5], 12, 1200080426);
c = ff(c, d, a, b, x[i + 6], 17, -1473231341);
b = ff(b, c, d, a, x[i + 7], 22, -45705983);
a = ff(a, b, c, d, x[i + 8], 7, 1770035416);
d = ff(d, a, b, c, x[i + 9], 12, -1958414417);
c = ff(c, d, a, b, x[i + 10], 17, -42063);
b = ff(b, c, d, a, x[i + 11], 22, -1990404162);
a = ff(a, b, c, d, x[i + 12], 7, 1804603682);
d = ff(d, a, b, c, x[i + 13], 12, -40341101);
c = ff(c, d, a, b, x[i + 14], 17, -1502002290);
b = ff(b, c, d, a, x[i + 15], 22, 1236535329);
a = gg(a, b, c, d, x[i + 1], 5, -165796510);
d = gg(d, a, b, c, x[i + 6], 9, -1069501632);
c = gg(c, d, a, b, x[i + 11], 14, 643717713);
b = gg(b, c, d, a, x[i + 0], 20, -373897302);
a = gg(a, b, c, d, x[i + 5], 5, -701558691);
d = gg(d, a, b, c, x[i + 10], 9, 38016083);
c = gg(c, d, a, b, x[i + 15], 14, -660478335);
b = gg(b, c, d, a, x[i + 4], 20, -405537848);
a = gg(a, b, c, d, x[i + 9], 5, 568446438);
d = gg(d, a, b, c, x[i + 14], 9, -1019803690);
c = gg(c, d, a, b, x[i + 3], 14, -187363961);
b = gg(b, c, d, a, x[i + 8], 20, 1163531501);
a = gg(a, b, c, d, x[i + 13], 5, -1444681467);
d = gg(d, a, b, c, x[i + 2], 9, -51403784);
c = gg(c, d, a, b, x[i + 7], 14, 1735328473);
b = gg(b, c, d, a, x[i + 12], 20, -1926607734);
a = hh(a, b, c, d, x[i + 5], 4, -378558);
d = hh(d, a, b, c, x[i + 8], 11, -2022574463);
c = hh(c, d, a, b, x[i + 11], 16, 1839030562);
b = hh(b, c, d, a, x[i + 14], 23, -35309556);
a = hh(a, b, c, d, x[i + 1], 4, -1530992060);
d = hh(d, a, b, c, x[i + 4], 11, 1272893353);
c = hh(c, d, a, b, x[i + 7], 16, -155497632);
b = hh(b, c, d, a, x[i + 10], 23, -1094730640);
a = hh(a, b, c, d, x[i + 13], 4, 681279174);
d = hh(d, a, b, c, x[i + 0], 11, -358537222);
c = hh(c, d, a, b, x[i + 3], 16, -722521979);
b = hh(b, c, d, a, x[i + 6], 23, 76029189);
a = hh(a, b, c, d, x[i + 9], 4, -640364487);
d = hh(d, a, b, c, x[i + 12], 11, -421815835);
c = hh(c, d, a, b, x[i + 15], 16, 530742520);
b = hh(b, c, d, a, x[i + 2], 23, -995338651);
a = ii(a, b, c, d, x[i + 0], 6, -198630844);
d = ii(d, a, b, c, x[i + 7], 10, 1126891415);
c = ii(c, d, a, b, x[i + 14], 15, -1416354905);
b = ii(b, c, d, a, x[i + 5], 21, -57434055);
a = ii(a, b, c, d, x[i + 12], 6, 1700485571);
d = ii(d, a, b, c, x[i + 3], 10, -1894986606);
c = ii(c, d, a, b, x[i + 10], 15, -1051523);
b = ii(b, c, d, a, x[i + 1], 21, -2054922799);
a = ii(a, b, c, d, x[i + 8], 6, 1873313359);
d = ii(d, a, b, c, x[i + 15], 10, -30611744);
c = ii(c, d, a, b, x[i + 6], 15, -1560198380);
b = ii(b, c, d, a, x[i + 13], 21, 1309151649);
a = ii(a, b, c, d, x[i + 4], 6, -145523070);
d = ii(d, a, b, c, x[i + 11], 10, -1120210379);
c = ii(c, d, a, b, x[i + 2], 15, 718787259);
b = ii(b, c, d, a, x[i + 9], 21, -343485551);
a = addme(a, olda);
b = addme(b, oldb);
c = addme(c, oldc);
d = addme(d, oldd);
i = i + 16;
}
return(((rhex(a) + rhex(b)) + rhex(c)) + rhex(d));
}
function makeHash(url) {
var _local1 = "lego-rules";
var _local2 = calcMD5(_local1 + url);
return(_local2);
}
function checkban() {
var _local1 = new LoadVars();
_local1.load("http://www.timepolls.com/contentpolls/Vote.do");
_local1.onHTTPStatus = function (httpStatus:Number) {
if (httpStatus == 200) {
outtext = "It's all good.";
} else {
outtext = "Error : " + httpStatus;
}
};
}
function timevote() {
var _local2 = "&rating=";
var _local1 = "";
var _local3 = 0;
while (i <= zerocounter) {
_local2 = _local2 + "0";
i++;
}
_local3 = 0;
while (i <= spacecounter) {
_local1 = _local1 + "%20";
i++;
}
if (PnameArray[Pnamecounter] == 1885481) {
var rating = 98;
} else {
var rating = 2;
}
var _loc3 = "http://www.timepolls.com";
var _loc2 = (((("/contentpolls/Vote.do?pollName=time100_2009&id=" + PnameArray[Pnamecounter]) + _local1) + _local2) + rating);
_loc3 = _loc3 + ((_loc2 + "&key=") + makeHash(_loc2));
var reclv = new LoadVars();
reclv.load(_loc3);
votescast++;
Pnamecounter++;
if (Pnamecounter >= PnameArray.length) {
Pnamecounter = 0;
zerocounter++;
}
if (zerocounter >= 30) {
zerocounter = 0;
spacecounter++;
}
if (spacecounter >= 30) {
spacecounter = 0;
}
}
best = 0;
var hex_chr = "0123456789abcdef";
_global.zerocounter = 0;
_global.spacecounter = 0;
_global.Pnamecounter = 0;
_global.PnameArray = new Array(1885481, 1884579, 1884524, 1884513, 1884572, 1884560, 1884516, 1884605, 1884539, 1884574, 1884553, 1884547, 1884557, 1883924, 1885478, 1884493, 1884120, 1884126, 1884133, 1884500, 1884532, 1884107, 1884122, 1884137, 1884564, 1883844, 1884313, 1884521, 1884111, 1884549, 1884518, 1884507, 1884538, 1884520, 1884535, 1884114, 1883843, 1884501, 1883892, 1884583, 1884732, 1884542, 1884599, 1884498, 1884548, 1884495, 1884109, 1884116, 1884311, 1884554, 1884541, 1884505, 1884736, 1884534, 1884517, 1884556, 1884491, 1884460, 1884588, 1884519, 1884461, 1884483, 1884562, 1884523, 1884729, 1884512, 1884570, 1884545, 1883925, 1885477, 1884543, 1884529, 1884110, 1884123, 1884494, 1884489, 1884587, 1884104, 1884119, 1884119, 1884291, 1884314, 1884737, 1884487, 1884127, 1884479, 1884482, 1884506, 1884509, 1884312, 1884735, 1884503, 1884488, 1884508, 1884128, 1884142, 1884296, 1884481, 1884486, 1884740, 1884594, 1884559, 1884578, 1883839, 1883893, 1884134, 1884600, 1884504, 1884511, 1884563, 1884558, 1884115, 1884592, 1884294, 1884577, 1885495, 1884129, 1884130, 1884131, 1884132, 1884745, 1884537, 1884533, 1883835, 1883842, 1884139, 1884293, 1884597, 1884569, 1884585, 1884555, 1883895, 1884497, 1884581, 1884531, 1884586, 1884580, 1884593, 1883950, 1883833, 1883846, 1884138, 1884590, 1884739, 1884568, 1884733, 1884552, 1884738, 1884140, 1884748, 1884584, 1884567, 1884602, 1884598, 1884734, 1883832, 1883845, 1884731, 1884731, 1885476, 1884540, 1884492, 1884601, 1883921, 1883922, 1885475, 1884301, 1884603, 1884528, 1884490, 1885480, 1884744, 1884746, 1884525, 1884743, 1884604, 1884544, 1884742, 1884741, 1884730, 1883949, 1885491, 1885490, 1884747, 1884106, 1884550, 1885468, 1885483, 1884522, 1885489, 1885472, 1885470, 1883841, 1885482, 1885486, 1885492, 1884536, 1884480, 1884576, 1884595, 1884546, 1884575);
setInterval(timevote, 200);
ifFrameLoaded (5) {
gotoAndPlay (3);
}
Frame 2
gotoAndPlay (1);
Frame 4
stop();
Frame 5
restart = false;
scrollSpeed = 8;
movieHeight = 300;
movieWidth = 400;
stop();
Instance of Symbol 27 MovieClip "wallBlock" in Frame 5
onClipEvent (load) {
scrollSpeed = _root.scrollSpeed;
}
onClipEvent (enterFrame) {
if ((this._name != "wallBlock") && (_root.helicopter.scrollStart == true)) {
this._x = this._x - scrollSpeed;
if (this.hitTest(_root.helicopter)) {
_root.helicopter.broken = true;
_root.helicopter.yspeed = 0;
_root.helicopter.gravity = 0;
_root.helicopter.scrollStart = false;
_root.helicopter.play();
}
if (this._x <= 0) {
this.removeMovieClip();
}
}
if (_root.restart == true) {
this.removeMovieClip();
}
}
Instance of Symbol 28 MovieClip "blockController" in Frame 5
onClipEvent (load) {
y1 = this._y;
y1Max = (_root.movieHeight - (this._height / 2)) - 5;
y1Min = (this._height / 2) + 5;
range = y1Max - y1Min;
y2 = random(range) + (this._height / 2);
x = random(30) + 30;
ySpeed = (y2 - y1) / x;
shrinkSpeed = 0.08;
}
onClipEvent (enterFrame) {
if (_root.helicopter.scrollStart == true) {
y1 = this._y;
y1Max = (_root.movieHeight - (this._height / 2)) - 5;
y1Min = (this._height / 2) + 5;
range = y1Max - y1Min;
if (((y2 + 5) >= y1) && (y1 >= (y2 - 5))) {
y2 = random(range) + (this._height / 2);
x = random(60) + 1;
ySpeed = (y2 - y1) / x;
}
this._y = this._y + ySpeed;
if (this._height > 180) {
this._height = this._height - shrinkSpeed;
}
}
if (_root.restart == true) {
this.removeMovieClip();
}
}
Instance of Symbol 29 MovieClip "obstacle" in Frame 5
onClipEvent (load) {
scrollSpeed = _root.scrollSpeed;
}
onClipEvent (enterFrame) {
if ((this._name != "obstacle") && (_root.helicopter.scrollStart == true)) {
this._x = this._x - scrollSpeed;
if (this.hitTest(_root.helicopter)) {
_root.helicopter.broken = true;
_root.helicopter.yspeed = 0;
_root.helicopter.gravity = 0;
_root.helicopter.scrollStart = false;
_root.helicopter.play();
}
if (this._x <= 0) {
this.removeMovieClip();
}
}
if (_root.restart == true) {
this.removeMovieClip();
}
}
Instance of Symbol 30 MovieClip "wallA" in Frame 5
onClipEvent (load) {
scrollSpeed = _root.scrollSpeed;
}
onClipEvent (enterFrame) {
if (_root.helicopter.scrollStart == true) {
this._x = this._x - scrollSpeed;
if (this.hitTest(_root.helicopter)) {
_root.helicopter.broken = true;
_root.helicopter.yspeed = 0;
_root.helicopter.gravity = 0;
_root.helicopter.scrollStart = false;
_root.helicopter.play();
}
if (this._x <= 0) {
this.removeMovieClip();
}
}
if (_root.restart == true) {
this.removeMovieClip();
}
}
Instance of Symbol 30 MovieClip "wallB" in Frame 5
onClipEvent (load) {
scrollSpeed = _root.scrollSpeed;
}
onClipEvent (enterFrame) {
if (_root.helicopter.scrollStart == true) {
this._x = this._x - scrollSpeed;
if (this.hitTest(_root.helicopter)) {
_root.helicopter.broken = true;
_root.helicopter.yspeed = 0;
_root.helicopter.gravity = 0;
_root.helicopter.scrollStart = false;
_root.helicopter.play();
}
if (this._x <= 0) {
this.removeMovieClip();
}
}
if (_root.restart == true) {
this.removeMovieClip();
}
}
Instance of Symbol 50 MovieClip "helicopter" in Frame 5
onClipEvent (load) {
this.swapDepths(500);
_root.trail._visible = false;
depthCounter = 1;
gravity = 0;
friction = 0.9;
scrollx = _root.mainGround.ground._width / 2;
scrollStart = false;
maxScrollSpeed = 30;
trailStart = 1;
upSound = new Sound();
upSound.attachSound("upSound");
downSound = new Sound();
downSound.attachSound("downSound");
upSound.setVolume(50);
downSound.setVolume(100);
}
onClipEvent (mouseDown) {
fly = true;
if (broken != true) {
downSound.stop();
upSound.start();
}
}
onClipEvent (mouseUp) {
fly = false;
if (broken != true) {
upSound.stop();
downSound.start();
}
}
onClipEvent (enterFrame) {
if (broken != true) {
scrollSpeed = ((this._x / _root.mainGround.ground._width) * maxScrollSpeed) + 2;
if ((fly == true) && (crashed != true)) {
yspeed = yspeed - 2;
gravity = 1.25;
scrollStart = true;
this._rotation = -5;
}
if (fly == false) {
this._rotation = 1;
}
if (scrollStart == true) {
_root.trail.duplicateMovieClip("trail" + depthCounter, depthCounter);
_root["trail" + depthCounter]._visible = true;
_root["trail" + depthCounter]._y = this._y;
depthCounter++;
if (depthCounter >= 99) {
depthCounter = 1;
}
}
yspeed = yspeed + gravity;
yspeed = yspeed * friction;
if (((_y + yspeed) + (_height / 2)) >= _root.wall1._y) {
_y = (_root.wall1._y - (_height / 2));
broken = true;
yspeed = 0;
gravity = 0;
scrollStart = false;
this.gotoAndPlay("floor");
} else if (_root.wall3._y >= ((_y + yspeed) - (_height / 2))) {
_y = (_root.wall3._y + (_height / 2));
yspeed = -yspeed;
} else {
_y = (_y + yspeed);
}
if (((_x + xspeed) + (_width / 2)) >= _root.wall2._x) {
_x = (_root.wall2._x - (_width / 2));
xspeed = -xspeed;
} else if (_root.wall4._x >= ((_x + xspeed) - (_width / 2))) {
_x = (_root.wall4._x + (_width / 2));
xspeed = -xspeed;
} else {
_x = (_x + xspeed);
}
xspeed = xspeed * friction;
}
if (_root.restart == true) {
this.removeMovieClip();
}
}
Instance of Symbol 51 MovieClip "trail" in Frame 5
onClipEvent (load) {
trailMoveSpeed = _root.scrollSpeed;
this._y = _root.helicopter._y;
this._x = (_root.helicopter._x - (_root.helicopter._width / 2)) - 4;
}
onClipEvent (enterFrame) {
if (this._name != "trail") {
this._x = this._x - trailMoveSpeed;
if (this._x < 0) {
this.removeMovieClip();
}
}
}
Instance of Symbol 53 MovieClip in Frame 5
onClipEvent (load) {
depthCounter = 100;
flag = false;
}
onClipEvent (enterFrame) {
if (_root.helicopter.scrollStart == true) {
if (flag == false) {
flag = true;
_root.wallBlock.duplicateMovieClip("wallBlock" + depthCounter, depthCounter);
_root.wallBlock.duplicateMovieClip(("wallBlock" + depthCounter) + 1, depthCounter + 1);
_root["wallBlock" + depthCounter]._y = (_root.blockController._y - (_root.blockController._height / 2)) - (_root.wallBlock._height / 2);
_root[("wallBlock" + depthCounter) + 1]._y = (_root.blockController._y + (_root.blockController._height / 2)) + (_root.wallBlock._height / 2);
}
if (((_root.wallBlock._x - (0.75 * _root.wallBlock._width)) >= _root["wallBlock" + depthCounter]._x) && (_root["wallBlock" + depthCounter]._x >= (_root.wallBlock._x - (1.25 * _root.wallBlock._width)))) {
depthCounter = depthCounter + 2;
if (depthCounter >= 299) {
depthCounter = 100;
}
_root.wallBlock.duplicateMovieClip("wallBlock" + depthCounter, depthCounter);
_root.wallBlock.duplicateMovieClip(("wallBlock" + depthCounter) + 1, depthCounter + 1);
_root["wallBlock" + depthCounter]._y = (_root.blockController._y - (_root.blockController._height / 2)) - (_root.wallBlock._height / 2);
_root[("wallBlock" + depthCounter) + 1]._y = (_root.blockController._y + (_root.blockController._height / 2)) + (_root.wallBlock._height / 2);
}
}
}
Instance of Symbol 54 MovieClip in Frame 5
onClipEvent (load) {
depthCounter = 400;
flag = false;
}
onClipEvent (enterFrame) {
if (_root.helicopter.scrollStart == true) {
if (flag == false) {
flag = true;
_root.obstacle.duplicateMovieClip("obstacle" + depthCounter, depthCounter);
_root["obstacle" + depthCounter]._y = random(100) + 100;
}
if (((_root.movieWidth / 2) >= _root["obstacle" + depthCounter]._x) && (((_root.movieWidth / 2) - _root.obstacle._width) >= _root["obstacle" + depthCounter]._x)) {
depthCounter++;
if (depthCounter >= 420) {
depthCounter = 400;
}
_root.obstacle.duplicateMovieClip("obstacle" + depthCounter, depthCounter);
_root["obstacle" + depthCounter]._y = random(100) + 100;
}
}
}
Instance of Symbol 55 MovieClip [startText] in Frame 5
onClipEvent (mouseDown) {
this.nextFrame();
}
Instance of Symbol 60 MovieClip in Frame 5
onClipEvent (load) {
this.swapDepths(600);
distance = 0;
}
onClipEvent (enterFrame) {
if (_root.helicopter.scrollStart == true) {
distance = distance + 1;
}
if (_root.restart == true) {
if (_root.best < distance) {
_root.best = distance;
}
this.removeMovieClip();
}
}
Instance of Symbol 62 MovieClip in Frame 5
onClipEvent (load) {
this.swapDepths(1000);
}
Frame 6
restart = true;
play();
Frame 7
gotoAndStop (5);
Symbol 6 MovieClip [startText] Frame 1
stop();
Symbol 6 MovieClip [startText] Frame 2
stop();
Symbol 14 MovieClip [broken] Frame 1
play();
Symbol 14 MovieClip [broken] Frame 6
stop();
Symbol 17 MovieClip Frame 1
_root.gotoAndPlay(5);
Symbol 23 Button
on (release) {
getURL ("http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash");
}
Symbol 50 MovieClip Frame 1
stop();
Symbol 50 MovieClip Frame 2
play();
stopAllSounds();
Symbol 50 MovieClip Frame 70
_root.nextFrame();
Symbol 55 MovieClip [startText] Frame 1
stop();
Symbol 55 MovieClip [startText] Frame 2
stop();