Frame 1
System.useCodepage = true;
stopAllSounds();
this.stop();
Frame 2
function soundPlay(name, loop) {
if (this.gameVolume > 0) {
this.soundObj[name].start(0, loop);
this.soundObj[name].setVolume(this.gameVolume);
}
}
function DispatchGameData(point, score) {
var _local2 = new LoadVars();
_local2.code = "helpanimals";
_local2.point = point;
_local2.score = score;
_local2.sendAndLoad("./getpoint.php", _local2, "POST");
_local2.onLoad = function () {
if (_root.rtnurl.length > 2) {
getURL (_root.rtnurl);
} else {
getURL ("../");
}
};
}
var soundName = ["shipdown", "landdown", "sinkingg", "move"];
var soundObj = Array();
var gameVolume = 100;
var i = 0;
while (i <= soundName.length) {
soundObj[soundName[i]] = new Sound();
soundObj[soundName[i]].attachSound(soundName[i]);
i++;
}
Instance of Symbol 191 MovieClip "MENT" in Frame 2
onClipEvent (load) {
this._visible = false;
this.f = 0;
this.rnd = 0;
this.cnt = 0;
}
onClipEvent (enterFrame) {
if (((_parent.SHIP.gameplay == false) || (_parent.ANI.hand == true)) || (_parent.ANI.num >= 17)) {
this.cnt = 0;
this.f = 0;
this._visible = false;
} else {
this.cnt--;
if (this.cnt > 0) {
this._visible = true;
} else {
this._visible = false;
this.f++;
if (this.f >= this.rnd) {
this.cnt = 30;
this.f = 0;
this.rnd = random(50) + 20;
if ((_parent.SHIP.weigth[_parent.ANI._currentframe - 1] >= 40) || (_parent.SHIP.sinking == true)) {
this.gotoAndStop(3);
} else if ((_parent.SHIP._x < 200) && (_parent.SHIP.totalWeigth > 60)) {
this.gotoAndStop(4);
} else {
this.gotoAndStop(random(2) + 1);
}
this._visible = true;
}
}
}
}
Instance of Symbol 321 MovieClip "WATER1" in Frame 2
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 325 MovieClip "W1" in Frame 2
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 325 MovieClip "W2" in Frame 2
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 329 MovieClip "WATER2" in Frame 2
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 277 MovieClip "ANI" in Frame 2
onClipEvent (load) {
this.tx = this._x;
this.ty = this._y;
this.num = 0;
this.hand = false;
this.gotoAndStop(_parent.SHIP.chrAni[this.num]);
this.setMask(_parent.MASK);
}
on (press) {
this.hand = true;
this.setMask(undefined);
this.startDrag(true, 0, 0, 200, 420);
}
on (release, releaseOutside) {
this.stopDrag();
if ((((_parent.SHIP.sinking == false) && (this._y > 320)) && (this._x > (_parent.SHIP._x - 50))) && (this._x < (_parent.SHIP._x + 50))) {
_parent.SHIP.putShip(this._currentframe, this._x - _parent.SHIP._x);
}
this._x = this.tx;
this._y = this.ty;
this.setMask(_parent.MASK);
if (this.num >= 17) {
this._visible = false;
}
this.hand = false;
}
Instance of Symbol 333 MovieClip "LAND" in Frame 2
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 277 MovieClip "ANI2" in Frame 2
onClipEvent (load) {
this.f = 0;
this.action = false;
this._visible = false;
}
onClipEvent (enterFrame) {
if (this.action == true) {
this.f++;
if (this.f == 1) {
_parent.MENT2._x = this._x - 5;
_parent.MENT2._y = this._y - 30;
_parent.MENT2.gotoAndStop(random(3) + 1);
_parent.MENT2._visible = true;
} else if (this.f > 10) {
this.action = false;
_parent.MENT2._visible = false;
this._visible = false;
if ((_parent.ANI._visible == false) && (_parent.SHIP.num == 0)) {
_parent.SHIP.gameplay = false;
_parent.SHIP.showPopup();
}
}
} else {
this.f = 0;
}
}
Instance of Symbol 337 MovieClip "MENT2" in Frame 2
onClipEvent (load) {
this._visible = false;
}
Instance of Symbol 346 MovieClip "POPUP" in Frame 2
onClipEvent (load) {
this._visible = false;
}
Symbol 11 MovieClip Frame 1
this.stop();
Symbol 14 Button
on (release) {
this.gotoAndStop(2);
}
Symbol 17 Button
on (release) {
this.sBUTTON._visible = false;
this.hBUTTON._visible = false;
this.HELP._visible = true;
}
Symbol 22 Button
on (release) {
this._visible = false;
_parent.sBUTTON._visible = true;
_parent.hBUTTON._visible = true;
}
Symbol 23 MovieClip Frame 1
this._visible = false;
Symbol 74 MovieClip Frame 1
this.stop();
Symbol 85 MovieClip Frame 18
this.stop();
Symbol 185 MovieClip Frame 1
this.stop();
Instance of Symbol 85 MovieClip "BOX" in Symbol 185 MovieClip Frame 1
onClipEvent (load) {
this._visible = false;
}
Symbol 191 MovieClip Frame 1
this.stop();
Symbol 277 MovieClip Frame 1
this.stop();
Symbol 314 Button
on (press) {
this.hand = true;
}
on (release, releaseOutside) {
this.hand = false;
}
Symbol 315 MovieClip Frame 1
function setClear() {
this.num = 0;
this.center = 0;
this.totalWeigth = 0;
this._y = this.ty;
var _local2 = 1;
while (_local2 <= 5) {
this["A" + _local2]._y = -30;
this["A" + _local2]._visible = false;
_local2++;
}
}
function putShip(frame, xx) {
if (this.num < 5) {
var _local4 = this["A" + (++this.num)];
_local4.gotoAndStop(frame);
_local4._x = xx;
if (_local4._x < -50) {
_local4._x = -50;
}
if (_local4._x > 50) {
_local4._x = 50;
}
_local4._visible = true;
_parent.ANI.gotoAndStop(this.chrAni[++_parent.ANI.num]);
_root.soundPlay("shipdown", 1);
}
}
function outShipAni(tMC) {
this.num--;
if (this.num < 0) {
this.num = 0;
}
tMC._visible = false;
this.interval();
}
function inShipAni(tMC) {
_root.soundPlay("shipdown", 1);
this.num++;
tMC._x = _parent.ANI2._x - this._x;
if (tMC._x < -50) {
tMC._x = -50;
}
if (tMC._x > 50) {
tMC._x = 50;
}
tMC._visible = true;
this.interval();
}
function outShipAni2(tMC) {
var _local5 = tMC._currentframe;
var _local4 = 1;
while (_local4 <= this.totalAni) {
if (_parent["F" + _local4]._currentframe == _local5) {
_parent["F" + _local4].BOX.gotoAndPlay(1);
_parent["F" + _local4].BOX._visible = true;
break;
}
_local4++;
}
tMC._visible = false;
_root.soundPlay("landdown", 1);
}
function outShip() {
var _local4 = 1;
while (_local4 <= 5) {
if (this["A" + _local4]._visible == true) {
var _local5 = this["A" + _local4]._currentframe;
var _local3 = 1;
while (_local3 <= this.totalAni) {
if (_parent["F" + _local3]._currentframe == _local5) {
_parent["F" + _local3].BOX.gotoAndPlay(1);
_parent["F" + _local3].BOX._visible = true;
break;
}
_local3++;
}
}
_local4++;
}
this.setClear();
}
function outShip2() {
var _local4 = 1;
while (_local4 <= 5) {
if (this["A" + _local4]._visible == true) {
var _local5 = this["A" + _local4]._currentframe;
var _local3 = 1;
while (_local3 <= this.totalAni) {
if (_parent["F" + _local3]._currentframe == _local5) {
_parent["F" + _local3].gotoAndStop(_local5 + 17);
break;
}
_local3++;
}
}
_local4++;
}
this.setClear();
if (_parent.ANI._visible == false) {
this.gameplay = false;
this.showPopup();
}
}
function interval() {
this.center = 0;
this.totalWeigth = 0;
var _local5 = 1;
while (_local5 <= 5) {
if (this["A" + _local5]._visible == true) {
this.center = this.center + ((this["A" + _local5]._x * this.weigth[this["A" + _local5]._currentframe - 1]) / 50);
this.totalWeigth = this.totalWeigth + this.weigth[this["A" + _local5]._currentframe - 1];
}
_local5++;
}
this._y = this.ty + (this.totalWeigth / 6);
_local5 = 1;
while (_local5 <= 5) {
var _local4 = 1;
while (_local4 <= 5) {
if (((_local5 != _local4) && (this["A" + _local5]._visible == true)) && (this["A" + _local4]._visible == true)) {
if (Math.abs(this["A" + _local5]._x - this["A" + _local4]._x) < 23) {
if (this["A" + _local5]._x > this["A" + _local4]._x) {
this["A" + _local5]._x = this["A" + _local5]._x + 2;
this["A" + _local4]._x = this["A" + _local4]._x - 2;
} else {
this["A" + _local5]._x = this["A" + _local5]._x - 2;
this["A" + _local4]._x = this["A" + _local4]._x + 2;
}
}
}
_local4++;
}
_local5++;
}
_local5 = 1;
while (_local5 <= 5) {
if (this["A" + _local5]._x < -50) {
this["A" + _local5]._x = -50;
}
if (this["A" + _local5]._x > 50) {
this["A" + _local5]._x = 50;
}
_local5++;
}
if ((this.totalWeigth >= 100) || (Math.abs(this._rotation) > 20)) {
_parent.W1._visible = false;
_parent.W2._visible = false;
_parent.WATER1._visible = false;
_parent.WATER2._x = this._x;
_parent.WATER2._y = 440;
_parent.WATER2.gotoAndPlay(1);
_parent.WATER2._visible = true;
this.sinking = true;
_root.soundPlay("sinkingg", 2);
}
}
function showPopup() {
var _local5 = 2;
var _local4 = 0;
var _local3 = 1;
while (_local3 <= this.totalAni) {
if (_parent["F" + _local3].BOX._visible == true) {
_local4 = _local4 + 20;
} else {
if (_parent["F" + _local3]._currentframe > this.totalAni) {
_local4 = _local4 - 5;
}
_local5 = 1;
}
_local3++;
}
if (_local4 < 0) {
_local4 = 0;
}
_parent.ANI._visible = false;
_parent.POPUP.point = _local4;
_parent.POPUP.score = _local4;
_parent.POPUP.TXT = _local4;
_parent.POPUP.gotoAndStop(_local5);
_parent.POPUP._visible = true;
}
this.num = 0;
this.r = 0.3;
this.maxR = 4;
this.center = 0;
this.weigth = [30, 10, 20, 50, 10, 40, 50, 20, 20, 10, 10, 60, 10, 10, 15, 15, 40];
this.chrAni = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17];
this.totalAni = 17;
this.totalWeigth = 0;
this.tx = this._x;
this.ty = this._y;
this.speed = 4;
this.sinking = false;
this.maxTime = 100;
this.ts = getTimer();
this.gameplay = true;
this.snd = 0;
this.sndOn = false;
this.shipMove = 0;
this.hand = false;
var i = 0;
while (i < 100) {
var f1 = random(this.totalAni);
var f2 = random(this.totalAni);
if (f1 != f2) {
var c = this.chrAni[f1];
this.chrAni[f1] = this.chrAni[f2];
this.chrAni[f2] = c;
}
i++;
}
var i = 1;
while (i <= this.totalAni) {
_parent["F" + i].gotoAndStop(this.chrAni[i - 1]);
_parent["F" + i]._visible = true;
i++;
}
onEnterFrame = function () {
if (this.gameplay == true) {
var _local4 = this.maxTime - ((getTimer() - this.ts) / 1000);
_parent.TIMETXT = Math.round(_local4);
if (_local4 < 0) {
this.showPopup();
this.gameplay = false;
}
if (this.hand == true) {
if (this._x < _parent._xmouse) {
this.shipMove = 1;
} else if (this._x > _parent._xmouse) {
this.shipMove = -1;
} else {
this.shipMove = 0;
}
} else {
this.shipMove = 0;
}
if (this.sinking == true) {
this._y++;
if (this._rotation > 0) {
this._rotation = this._rotation + 0.5;
} else {
this._rotation = this._rotation - 0.5;
}
if (this._y > 530) {
this._x = this.tx;
this._y = this.ty;
this.outShip2();
this._rotation = 0;
_parent.WATER2._visible = false;
this.sinking = false;
}
} else {
this.interval();
this._rotation = this._rotation + this.r;
var _local6 = (-this.maxR) + this.center;
var _local5 = this.maxR + this.center;
if (this._rotation < _local6) {
this._rotation = _local6;
this.r = this.r * -1;
if (this.totalWeigth >= 10) {
_parent.W1._x = this._x - 50;
_parent.W1._y = 440;
_parent.W1.gotoAndPlay(1);
_parent.W1._visible = true;
}
} else if (this._rotation > _local5) {
this._rotation = _local5;
this.r = this.r * -1;
if (this.totalWeigth >= 10) {
_parent.W2._x = this._x + 50;
_parent.W2._y = 440;
_parent.W2.gotoAndPlay(1);
_parent.W2._visible = true;
}
}
if ((this.shipMove == -1) || (Key.isDown(37))) {
this._x = this._x - this.speed;
if (this._x < 130) {
this._x = 130;
} else {
if (this.sndOn == false) {
this.sndOn = true;
this.snd = 30;
}
_parent.WATER1._xscale = -100;
_parent.WATER1._x = this._x + 15;
_parent.WATER1._y = 440;
_parent.WATER1._visible = true;
}
} else if ((this.shipMove == 1) || (Key.isDown(39))) {
this._x = this._x + this.speed;
if (this._x > 490) {
this._x = 490;
} else {
if (this.sndOn == false) {
this.sndOn = true;
this.snd = 30;
}
_parent.WATER1._xscale = 100;
_parent.WATER1._x = this._x;
_parent.WATER1._y = 440;
_parent.WATER1._visible = true;
}
} else {
_parent.WATER1._visible = false;
}
}
if (this.snd == 30) {
_root.soundPlay("move", 1);
this.snd--;
} else if (this.snd == 0) {
this.sndOn = false;
} else {
this.snd--;
}
}
};
this.setClear();
this.stop();
Instance of Symbol 277 MovieClip "A1" in Symbol 315 MovieClip Frame 1
on (press) {
if ((_parent._parent.ANI2._visible == false) && (_parent.sinking == false)) {
if (_parent._x > 460) {
_parent._parent.ANI2._x = _parent._x + this._x;
_parent._parent.ANI2._y = _parent._y + this._y;
_parent._parent.ANI2.gotoAndStop(this._currentframe);
_parent._parent.ANI2._visible = true;
_parent._parent.ANI2.startDrag(true, 460, 200, 660, 420);
_parent.outShipAni(this);
} else {
this.startDrag(true, -50, -30, 50, -30);
}
}
}
on (release, releaseOutside) {
if (_parent._parent.ANI2._visible == true) {
_parent._parent.ANI2.stopDrag();
if (_parent._parent.LAND.hitTest(_parent._parent.ANI2._x, _parent._parent.ANI2._y, true)) {
_parent.outShipAni2(this);
_parent._parent.ANI2._x = 620;
_parent._parent.ANI2._y = 405;
_parent._parent.ANI2.action = true;
} else {
_parent._parent.ANI2._visible = false;
_parent.inShipAni(this);
}
} else {
this.stopDrag();
}
}
Instance of Symbol 277 MovieClip "A2" in Symbol 315 MovieClip Frame 1
on (press) {
if ((_parent._parent.ANI2._visible == false) && (_parent.sinking == false)) {
if (_parent._x > 460) {
_parent._parent.ANI2._x = _parent._x + this._x;
_parent._parent.ANI2._y = _parent._y + this._y;
_parent._parent.ANI2.gotoAndStop(this._currentframe);
_parent._parent.ANI2._visible = true;
_parent._parent.ANI2.startDrag(true, 460, 200, 660, 420);
_parent.outShipAni(this);
} else {
this.startDrag(true, -50, -30, 50, -30);
}
}
}
on (release, releaseOutside) {
if (_parent._parent.ANI2._visible == true) {
_parent._parent.ANI2.stopDrag();
if (_parent._parent.LAND.hitTest(_parent._parent.ANI2._x, _parent._parent.ANI2._y, true)) {
_parent.outShipAni2(this);
_parent._parent.ANI2._x = 620;
_parent._parent.ANI2._y = 405;
_parent._parent.ANI2.action = true;
} else {
_parent._parent.ANI2._visible = false;
_parent.inShipAni(this);
}
} else {
this.stopDrag();
}
}
Instance of Symbol 277 MovieClip "A3" in Symbol 315 MovieClip Frame 1
on (press) {
if ((_parent._parent.ANI2._visible == false) && (_parent.sinking == false)) {
if (_parent._x > 460) {
_parent._parent.ANI2._x = _parent._x + this._x;
_parent._parent.ANI2._y = _parent._y + this._y;
_parent._parent.ANI2.gotoAndStop(this._currentframe);
_parent._parent.ANI2._visible = true;
_parent._parent.ANI2.startDrag(true, 460, 200, 660, 420);
_parent.outShipAni(this);
} else {
this.startDrag(true, -50, -30, 50, -30);
}
}
}
on (release, releaseOutside) {
if (_parent._parent.ANI2._visible == true) {
_parent._parent.ANI2.stopDrag();
if (_parent._parent.LAND.hitTest(_parent._parent.ANI2._x, _parent._parent.ANI2._y, true)) {
_parent.outShipAni2(this);
_parent._parent.ANI2._x = 620;
_parent._parent.ANI2._y = 405;
_parent._parent.ANI2.action = true;
} else {
_parent._parent.ANI2._visible = false;
_parent.inShipAni(this);
}
} else {
this.stopDrag();
}
}
Instance of Symbol 277 MovieClip "A4" in Symbol 315 MovieClip Frame 1
on (press) {
if ((_parent._parent.ANI2._visible == false) && (_parent.sinking == false)) {
if (_parent._x > 460) {
_parent._parent.ANI2._x = _parent._x + this._x;
_parent._parent.ANI2._y = _parent._y + this._y;
_parent._parent.ANI2.gotoAndStop(this._currentframe);
_parent._parent.ANI2._visible = true;
_parent._parent.ANI2.startDrag(true, 460, 200, 660, 420);
_parent.outShipAni(this);
} else {
this.startDrag(true, -50, -30, 50, -30);
}
}
}
on (release, releaseOutside) {
if (_parent._parent.ANI2._visible == true) {
_parent._parent.ANI2.stopDrag();
if (_parent._parent.LAND.hitTest(_parent._parent.ANI2._x, _parent._parent.ANI2._y, true)) {
_parent.outShipAni2(this);
_parent._parent.ANI2._x = 620;
_parent._parent.ANI2._y = 405;
_parent._parent.ANI2.action = true;
} else {
_parent._parent.ANI2._visible = false;
_parent.inShipAni(this);
}
} else {
this.stopDrag();
}
}
Instance of Symbol 277 MovieClip "A5" in Symbol 315 MovieClip Frame 1
on (press) {
if ((_parent._parent.ANI2._visible == false) && (_parent.sinking == false)) {
if (_parent._x > 460) {
_parent._parent.ANI2._x = _parent._x + this._x;
_parent._parent.ANI2._y = _parent._y + this._y;
_parent._parent.ANI2.gotoAndStop(this._currentframe);
_parent._parent.ANI2._visible = true;
_parent._parent.ANI2.startDrag(true, 460, 200, 660, 420);
_parent.outShipAni(this);
} else {
this.startDrag(true, -50, -30, 50, -30);
}
}
}
on (release, releaseOutside) {
if (_parent._parent.ANI2._visible == true) {
_parent._parent.ANI2.stopDrag();
if (_parent._parent.LAND.hitTest(_parent._parent.ANI2._x, _parent._parent.ANI2._y, true)) {
_parent.outShipAni2(this);
_parent._parent.ANI2._x = 620;
_parent._parent.ANI2._y = 405;
_parent._parent.ANI2.action = true;
} else {
_parent._parent.ANI2._visible = false;
_parent.inShipAni(this);
}
} else {
this.stopDrag();
}
}
Symbol 325 MovieClip Frame 7
this._visible = false;
Symbol 328 MovieClip Frame 1
this._visible = false;
Symbol 328 MovieClip Frame 2
this.r = random(5);
if (this.r == 0) {
this._visible = true;
this.play();
} else {
this.gotoAndPlay(1);
}
Symbol 329 MovieClip Frame 63
this._visible = false;
Symbol 331 MovieClip Frame 1
this._visible = false;
Symbol 337 MovieClip Frame 1
this.stop();
Symbol 342 Button
on (release) {
this.BUTTON._visible = false;
_root.DispatchGameData(this.point, this.score);
}
Symbol 346 MovieClip Frame 1
this.stop();