Instance of Symbol 8 MovieClip in Frame 1
onClipEvent (enterFrame) {
Process = _parent.getBytesLoaded() / _parent.getBytesTotal();
gotoAndStop(Math.round(Process * 100));
if (_parent._framesloaded > 2) {
gotoAndStop (2);
}
}
Frame 2
stop();
_quality = "HIGH";
Instance of Symbol 8 MovieClip in Frame 2
onClipEvent (enterFrame) {
Process = _parent.getBytesLoaded() / _parent.getBytesTotal();
Percentage = Math.round(Process * 100);
gotoAndStop(Percentage);
_parent.LoadedText = Percentage + "% loaded";
if (_parent.getBytesLoaded() >= _parent.getBytesTotal()) {
_visible = false;
_parent.LoadedText = "";
if (_parent.SFGad._currentframe == 74) {
_parent.SFGad.play();
}
}
}
Frame 4
stop();
_quality = "HIGH";
Score = 0;
Level = 1;
Lives = 5;
halfPI = (Math.PI/2);
dblPI = (Math.PI*2);
Rad2Deg = 360 / dblPI;
Instance of Symbol 71 MovieClip "Instructions" in Frame 4
onClipEvent (load) {
function Enable() {
_visible = true;
for (obj in _parent) {
_parent[obj].enabled = false;
}
for (obj in _parent.PauseMenu) {
_parent.PauseMenu[obj].enabled = false;
}
}
function Disable() {
_visible = false;
for (obj in _parent) {
_parent[obj].enabled = true;
}
for (obj in _parent.PauseMenu) {
_parent.PauseMenu[obj].enabled = true;
}
}
_visible = false;
}
Frame 5
function Pause(OnOff) {
if (OnOff) {
PauseMenu._visible = true;
Paused = true;
Scene.Sleigh.Santa.stop();
OldQuality = _quality;
_quality = "HIGH";
} else {
PauseMenu._visible = false;
Paused = false;
if (SantaPlaying) {
Scene.Sleigh.Santa.play();
}
_quality = OldQuality;
}
}
function CheckLevel() {
if ((GiftsResolved > LastLevelUp) and ((GiftsResolved % 20) == 0)) {
SleighSpeed = SleighSpeed + 0.5;
Accuracy = Accuracy + 50;
Lives++;
LivesText.Update();
}
}
function InitLevel(L) {
switch (L) {
case 1 :
SleighSpeed = 2;
Accuracy = 100;
KidsNum = 10;
RightBound = 2000;
break;
case 2 :
SleighSpeed = 2.5;
Accuracy = 150;
KidsNum = 15;
RightBound = 2500;
break;
case 3 :
SleighSpeed = 3;
Accuracy = 200;
KidsNum = 20;
RightBound = 3000;
break;
case 4 :
SleighSpeed = 3.5;
Accuracy = 250;
KidsNum = 25;
LeftBound = -2000;
RightBound = 2000;
}
if (Level < 4) {
LeftBound = 0;
}
Scene.Background.gotoAndStop(L);
}
function CalcAngle(Xfrom, Yfrom, Xto, Yto) {
if ((Xfrom == Xto) and (Yfrom == Yto)) {
Angle = 0;
} else {
XDis = Math.abs(Xto - Xfrom);
YDis = Math.abs(Yto - Yfrom);
Angle = Math.atan(YDis / XDis);
if (Xto > Xfrom) {
if (Yto < Yfrom) {
Angle = halfPI - Angle;
} else {
Angle = halfPI + Angle;
}
} else if (Yto > Yfrom) {
Angle = (Math.PI + halfPI) - Angle;
} else {
Angle = (Math.PI + halfPI) + Angle;
}
if (Angle < 0) {
Angle = Angle + (Math.PI*2);
}
}
return(Angle);
}
function CalcDistance(Xfrom, Yfrom, Xto, Yto) {
xDistance = Math.abs(Xto - Xfrom);
yDistance = Math.abs(Yto - Yfrom);
LineDistance = Math.sqrt(Math.pow(xDistance, 2) + Math.pow(yDistance, 2));
return(LineDistance);
}
function DropGift(x, y, Type, xSpeed, ySpeed) {
NewGift = 0;
gf = 1;
while (gf <= TotalGifts) {
if (!Gifts[gf].Active) {
NewGift = gf;
break;
}
gf++;
}
if (NewGift == 0) {
TotalGifts++;
NewGift = TotalGifts;
Gifts[NewGift] = new Object();
Scene.GiftSample.duplicateMovieClip("Gift" + NewGift, Scene.getNextHighestDepth());
eval ("Scene.Gift" + NewGift).Snd = new Sound(eval ("Scene.Gift" + NewGift));
eval ("Scene.Gift" + NewGift).Snd.attachSound("Catch");
}
Gifts[NewGift].Active = true;
Gifts[NewGift].Type = Type;
Gifts[NewGift].x = x;
Gifts[NewGift].y = y;
Gifts[NewGift].xSpeed = xSpeed;
Gifts[NewGift].ySpeed = ySpeed;
eval ("Scene.Gift" + NewGift)._visible = true;
eval ("Scene.Gift" + NewGift)._x = x;
eval ("Scene.Gift" + NewGift)._y = y;
eval ("Scene.Gift" + NewGift).gotoAndStop(Gifts[NewGift].Type);
return(NewGift);
}
function TurnLamps(On) {
if (On) {
for (l in Scene.Background.Lamps) {
Scene.Background.Lamps[l].gotoAndStop(2);
}
} else {
for (l in Scene.Background.Lamps) {
Scene.Background.Lamps[l].gotoAndStop(1);
}
}
LampsOn = On;
}
function PutSmoke(x, y, Type) {
NewSmoke = 0;
ss = 1;
while (ss <= TotalSmokes) {
if (!eval ("Scene.Smoke" + ss).Active) {
NewSmoke = ss;
break;
}
ss++;
}
if (NewSmoke == 0) {
TotalSmokes++;
NewSmoke = TotalSmokes;
Scene.SmokeSample.duplicateMovieClip("Smoke" + NewSmoke, Scene.getNextHighestDepth());
Smokes[NewSmoke] = new Object();
eval ("Scene.Smoke" + NewSmoke).Snd = new Sound(eval ("Scene.Smoke" + NewSmoke));
eval ("Scene.Smoke" + NewSmoke).Snd.attachSound("Break");
}
if (FX) {
eval ("Scene.Smoke" + NewSmoke).Snd.start();
}
eval ("Scene.Smoke" + NewSmoke).Active = true;
eval ("Scene.Smoke" + NewSmoke)._x = x;
eval ("Scene.Smoke" + NewSmoke)._y = y;
eval ("Scene.Smoke" + NewSmoke)._visible = true;
eval ("Scene.Smoke" + NewSmoke).gotoAndPlay(1);
eval ("Scene.Smoke" + NewSmoke)._alpha = 80;
eval ("Scene.Smoke" + NewSmoke).Col = new Color(eval ("Scene.Smoke" + NewSmoke));
if (Type == 1) {
eval ("Scene.Smoke" + NewSmoke).Col.setRGB("0xFFBBCC");
}
if (Type == 2) {
eval ("Scene.Smoke" + NewSmoke).Col.setRGB("0xBBDDFF");
}
}
function PlaceKid(N, Min, Max) {
Kids[N] = {Type:random(2) + 1, HasGift:false};
Kids[N].x = Min + random(Max - Min);
Loop = true;
Xshift = 0;
do {
if (!Loop) {
break;
}
sh = 0;
while (sh <= 1) {
TooClose = false;
TestPlace = Kids[N].x + (Xshift * Shift[sh]);
ii = 1;
while (ii <= KidsNum) {
if ((ii != N) and (!isNaN(Kids[ii].x))) {
if (((Math.abs(TestPlace - Kids[ii].x) < 50) or (TestPlace < Min)) or (TestPlace > Max)) {
TooClose = true;
break;
}
}
ii++;
}
if (!TooClose) {
Kids[N].x = TestPlace;
Loop = false;
break;
}
if (Xshift == 0) {
break;
}
sh++;
}
Xshift++;
} while (Xshift <= (Max - Min));
if (isNaN(eval ("Scene.Kid" + N)._x)) {
Scene.KidSample.duplicateMovieClip("Kid" + N, Scene.getNextHighestDepth());
}
eval ("Scene.Kid" + N)._x = Kids[N].x;
eval ("Scene.Kid" + N)._y = 490;
eval ("Scene.Kid" + N).gotoAndStop(Kids[N].Type);
eval ("Scene.Kid" + N).Inside.gotoAndPlay(random(8) + 1);
GiftsToThrow[N] = {x:((Kids[N].x - Accuracy) - (SleighSpeed * 5)) + random(Accuracy * 2), Thrown:false};
}
TotalSmokes = 0;
TotalGifts = 0;
Gifts = new Array();
GiftInHands = 0;
Frame = 1;
LastFrame = 1;
Dt = new Date();
LastLampsTime = (LastTime = Dt.getTime());
XFly = (YFly = 0);
Acc = 2;
Direction = 1;
GiftsToThrow = new Array();
GiftsStack = new Array();
GiftsResolved = 0;
LastLevelUp = 0;
SantaPlaying = false;
OldQuality = _quality;
FX = true;
Music = true;
Paused = false;
JB = new Sound(S);
JB.attachSound("Song");
JB.start(0, 1000000);
Scene.Background._xscale = (Scene.Background._yscale = 100);
Scene.Background._x = -120;
Scene.Background._y = 0;
Shift = [-1, 1];
Kids = new Array();
InitLevel(Level);
DirectionCo = [Number.NaN, {x:0, y:-1}, {x:0.5, y:-0.5}, {x:1, y:0}, {x:0.5, y:0.5}, {x:0, y:1}, {x:-0.5, y:0.5}, {x:-1, y:0}, {x:-0.5, y:-0.5}];
CloakOffset = [Number.NaN, {x1:-10, y1:1, x2:10, y2:0}, {x1:-11, y1:1, x2:3, y2:-1}, {x1:-12, y1:1, x2:-3, y2:-1}, {x1:-11, y1:1, x2:3, y2:-1}, {x1:-10, y1:-1, x2:10, y2:2}];
i = 2;
while (i <= 4) {
CloakOffset[10 - i] = {x1:-CloakOffset[i].x2, y1:CloakOffset[i].y2, x2:-CloakOffset[i].x1, y2:CloakOffset[i].y1};
i++;
}
PointsNum = 20;
Schoulder = 11;
Cell = 5;
Elements = 5;
MiddleElement = 3;
CenterPoint = {x:372, y:200};
ElementsGap = (Schoulder * 2) / (Elements - 1);
Line = new Array();
ln = 1;
while (ln <= Elements) {
Line[ln] = new Array();
Line[ln][0] = {x:(CenterPoint.x - Schoulder) + ((ln - 1) * ElementsGap), y:CenterPoint.y, forces:new Array()};
i = 1;
while (i <= PointsNum) {
Line[ln][i] = {x:Line[ln][i - 1].x, y:Line[ln][i - 1].y + Cell, forces:new Array()};
i++;
}
ln++;
}
TempLine = new Array();
ln = 1;
while (ln <= Elements) {
TempLine[ln] = new Array();
i = 0;
while (i <= PointsNum) {
TempLine[ln][i] = {x:Line[ln][i].x, y:Line[ln][i].y};
i++;
}
ln++;
}
Scene.createEmptyMovieClip("Draw", Scene.getNextHighestDepth());
Scene.HeroSample.duplicateMovieClip("Hero", Scene.getNextHighestDepth());
Scene.HeroSample._visible = false;
Scene.GiftSample._visible = false;
Scene.KidSample._visible = false;
Scene.SmokeSample._visible = false;
i = 1;
while (i <= KidsNum) {
if (Level < 4) {
PlaceKid(i, LeftBound + 30, RightBound - 30);
} else {
PlaceKid(i, 30, 3970);
}
i++;
}
if (Level < 4) {
SortGTT = new Array();
for (SortItem in GiftsToThrow) {
SortGTT.push({x:GiftsToThrow[SortItem].x, num:SortItem});
}
SortGTT.sortOn("x", 16);
Gap = SleighSpeed * 29;
i = SortGTT.length - 1;
while (i >= 1) {
if (SortGTT[i].x > ((RightBound - Gap) - (SleighSpeed * 5))) {
SortGTT[i].x = (RightBound - Gap) - (SleighSpeed * 5);
}
if ((SortGTT[i].x - SortGTT[i - 1].x) < Gap) {
SortGTT[i - 1].x = SortGTT[i].x - Gap;
}
i--;
}
i = 0;
while (i < SortGTT.length) {
GiftsToThrow[SortGTT[i].num].x = SortGTT[i].x;
i++;
}
}
TurnLamps(false);
Instance of Symbol 365 MovieClip "ScoreText" in Frame 5
onClipEvent (load) {
function Update() {
DigitsArray = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
TempValue = _parent.Score;
i = 9;
while (i >= 0) {
TenPow = Math.pow(10, i);
DigitsArray[i] = Math.floor(TempValue / TenPow);
TempValue = TempValue - (DigitsArray[i] * TenPow);
i--;
}
LastDigit = 0;
i = 9;
while (i >= 0) {
if (DigitsArray[i] != 0) {
LastDigit = i;
break;
}
i--;
}
i = 0;
while (i <= LastDigit) {
DigNum = (i + 9) - LastDigit;
eval ("Digit" + DigNum).gotoAndStop(DigitsArray[i] + 1);
i++;
}
i = 0;
while (i <= (8 - LastDigit)) {
eval ("Digit" + i).gotoAndStop(11);
i++;
}
}
Update();
}
Instance of Symbol 369 MovieClip "LivesText" in Frame 5
onClipEvent (load) {
function Update() {
DigitsArray = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
TempValue = Math.ceil(_parent.Lives);
i = 9;
while (i >= 0) {
TenPow = Math.pow(10, i);
DigitsArray[i] = Math.floor(TempValue / TenPow);
TempValue = TempValue - (DigitsArray[i] * TenPow);
i--;
}
LastDigit = 0;
i = 9;
while (i >= 0) {
if (DigitsArray[i] != 0) {
LastDigit = i;
break;
}
i--;
}
i = 0;
while (i <= LastDigit) {
eval ("Digit" + i).gotoAndStop(DigitsArray[i] + 1);
i++;
}
i = 9;
while (i > LastDigit) {
eval ("Digit" + i).gotoAndStop(11);
i--;
}
}
Update();
}
Instance of Symbol 385 MovieClip "PauseMenu" in Frame 5
onClipEvent (load) {
_visible = false;
}
Frame 6
if (!Paused) {
if (Level == 4) {
LeftBound = Scene.Sleigh._x - 2000;
RightBound = Scene.Sleigh._x + 2000;
if (CenterPoint.x < (Scene.Background._x - 300)) {
Scene.Background._x = Scene.Background._x - 3000;
}
if (CenterPoint.x > (Scene.Background._x + 2900)) {
Scene.Background._x = Scene.Background._x + 3000;
}
}
Dt = new Date();
Time = Dt.getTime();
if ((Time - LastLampsTime) >= 500) {
if (LampsOn) {
TurnLamps(false);
} else {
TurnLamps(true);
}
LastLampsTime = LastLampsTime + 500;
}
if ((Frame - LastFrame) == 10) {
if (Frame > 20) {
Lasted = Time - LastTime;
if (Lasted > 700) {
if (Scene._quality == "HIGH") {
Scene._quality = "MEDIUM";
}
if (Scene._quality == "MEDIUM") {
Scene._quality = "LOW";
}
}
if (Lasted < 500) {
if (Scene._quality == "LOW") {
Scene._quality = "MEDIUM";
}
if (Scene._quality == "MEDIUM") {
Scene._quality = "HIGH";
}
}
}
LastFrame = Frame;
LastTime = Time;
}
Frame++;
RA = (LA = (UA = (DA = false)));
if (Key.isDown(37)) {
LA = true;
}
if (Key.isDown(39)) {
RA = true;
}
if (Key.isDown(38)) {
UA = true;
}
if (Key.isDown(40)) {
DA = true;
}
if (Key.isDown(80)) {
Pause(true);
}
if (Key.isDown(32) and SpaceReleased) {
if (GiftInHands > 0) {
DroppedGift = DropGift(CenterPoint.x, CenterPoint.y + 15, GiftInHands, XFly, YFly);
Gifts[DroppedGift].NoCatch = 24;
GiftInHands = 0;
}
SpaceReleased = false;
}
if (!Key.isDown(32)) {
SpaceReleased = true;
}
if (RA) {
Direction = 3;
}
if (LA) {
Direction = 7;
}
if (UA) {
Direction = 1;
}
if (DA) {
Direction = 5;
}
if (RA and UA) {
Direction = 2;
}
if (RA and DA) {
Direction = 4;
}
if (LA and DA) {
Direction = 6;
}
if (LA and UA) {
Direction = 8;
}
if (GiftInHands > 0) {
Scene.Hero.gotoAndStop(6);
Scene.Hero.Gift.gotoAndStop(GiftInHands);
} else {
if (Direction > 5) {
Scene.Hero._xscale = -100;
Scene.Hero.gotoAndStop(10 - Direction);
}
if (Direction <= 5) {
Scene.Hero._xscale = 100;
Scene.Hero.gotoAndStop(Direction);
}
}
if (((RA or LA) or UA) or DA) {
Acc = 2;
} else {
Acc = 0;
}
if (Math.abs(XFly) > 0.1) {
XFly = XFly * 0.9;
} else {
XFly = 0;
}
if (Math.abs(YFly) > 0.1) {
YFly = YFly * 0.9;
} else {
YFly = 0;
}
XFly = XFly + (Acc * DirectionCo[Direction].x);
YFly = YFly + (Acc * DirectionCo[Direction].y);
GlobalHero = {x:CenterPoint.x, y:CenterPoint.y};
Scene.localToGlobal(GlobalHero);
Co = (372 - GlobalHero.x) / 10;
Scene._x = Scene._x + Co;
if (Scene._x > (-LeftBound)) {
Scene._x = -LeftBound;
}
if (Scene._x < (744 - RightBound)) {
Scene._x = 744 - RightBound;
}
if ((CenterPoint.y + YFly) > 350) {
CenterPoint.y = 350;
YFly = 0;
}
if ((CenterPoint.y + YFly) < 30) {
CenterPoint.y = 30;
YFly = 0;
}
if ((CenterPoint.x + XFly) > (RightBound - 20)) {
CenterPoint.x = RightBound - 20;
if (XFly > 0) {
XFly = 0;
}
}
if ((CenterPoint.x + XFly) < (LeftBound + 20)) {
CenterPoint.x = LeftBound + 20;
if (XFly < 0) {
XFly = 0;
}
}
CenterPoint.x = CenterPoint.x + XFly;
CenterPoint.y = CenterPoint.y + YFly;
Scene.Hero._x = CenterPoint.x;
Scene.Hero._y = CenterPoint.y;
if (GiftInHands > 0) {
CurrClOffset = CloakOffset[1];
} else {
CurrClOffset = CloakOffset[Direction];
}
COXStep = (CurrClOffset.x2 - CurrClOffset.x1) / (Elements - 1);
COYStep = (CurrClOffset.y2 - CurrClOffset.y1) / (Elements - 1);
GapSize = Math.sqrt(Math.pow(COXStep, 2) + Math.pow(COYStep, 2));
ln = 1;
while (ln <= Elements) {
TempLine[ln][0] = {x:(CenterPoint.x + CurrClOffset.x1) + (COXStep * (ln - 1)), y:(CenterPoint.y + CurrClOffset.y1) + (COYStep * (ln - 1)), forces:new Array()};
i = 1;
while (i <= PointsNum) {
OldPos = {x:Line[ln][i].x, y:Line[ln][i].y};
DesiredPos = {x:Line[ln][i].x, y:Line[ln][i].y};
Line[ln][i].forces[1].Pow = Line[ln][i].forces[1].Pow * 0.7;
if ((!isNaN(Line[ln][i].forces[1].Angle)) and (!isNaN(Line[ln][i].forces[1].Pow))) {
DesiredPos.x = DesiredPos.x + (Math.sin(Line[ln][i].forces[1].Angle) * Line[ln][i].forces[1].Pow);
DesiredPos.y = DesiredPos.y - (Math.cos(Line[ln][i].forces[1].Angle) * Line[ln][i].forces[1].Pow);
}
DesiredPos.x = DesiredPos.x + ((Math.random() / 2) - 0.25);
DesiredPos.y = DesiredPos.y + ((Math.random() / 2) - 0.25);
DesiredPos.y = DesiredPos.y + 2;
if (ln != MiddleElement) {
if (ln < MiddleElement) {
F3Element = ln + 1;
} else {
F3Element = ln - 1;
}
D = CalcDistance(Line[F3Element][i].x, Line[F3Element][i].y, Line[ln][i].x, Line[ln][i].y);
F3Pow = ((GapSize + ((i * GapSize) * 0.2)) - D) / 10;
F3Ang = CalcAngle(Line[F3Element][i].x, Line[F3Element][i].y, Line[ln][i].x, Line[ln][i].y);
DesiredPos.x = DesiredPos.x + (Math.sin(F3Ang) * F3Pow);
DesiredPos.y = DesiredPos.y - (Math.cos(F3Ang) * F3Pow);
}
Angle = CalcAngle(TempLine[ln][i - 1].x, TempLine[ln][i - 1].y, DesiredPos.x, DesiredPos.y);
TempLine[ln][i].x = TempLine[ln][i - 1].x + (Math.sin(Angle) * Cell);
TempLine[ln][i].y = TempLine[ln][i - 1].y - (Math.cos(Angle) * Cell);
Line[ln][i].forces[1] = {Angle:CalcAngle(OldPos.x, OldPos.y, TempLine[ln][i].x, TempLine[ln][i].y), Pow:CalcDistance(OldPos.x, OldPos.y, TempLine[ln][i].x, TempLine[ln][i].y)};
i++;
}
ln++;
}
ln = 1;
while (ln <= Elements) {
i = 0;
while (i <= PointsNum) {
Line[ln][i].x = TempLine[ln][i].x;
Line[ln][i].y = TempLine[ln][i].y;
i++;
}
ln++;
}
Scene.Draw.clear();
ln = 1;
while (ln < Elements) {
i = PointsNum;
while (i > 0) {
Scene.Draw.beginFill(16711680);
Scene.Draw.moveTo(Line[ln][i].x, Line[ln][i].y);
Scene.Draw.lineTo(Line[ln + 1][i].x, Line[ln + 1][i].y);
Scene.Draw.lineTo(Line[ln + 1][i - 1].x, Line[ln + 1][i - 1].y);
Scene.Draw.lineTo(Line[ln][i - 1].x, Line[ln][i - 1].y);
Scene.Draw.lineTo(Line[ln][i].x, Line[ln][i].y);
Scene.Draw.endFill();
i--;
}
ln++;
}
gtt = 1;
while (gtt <= KidsNum) {
if ((!GiftsToThrow[gtt].Thrown) and (GiftsToThrow[gtt].x <= ((Scene.Sleigh._x + 19) + (20 * SleighSpeed)))) {
GiftsStack.push(gtt);
GiftsToThrow[gtt].Thrown = true;
}
gtt++;
}
if (SantaPlaying and (Scene.Sleigh.Santa._currentframe == 1)) {
SantaPlaying = false;
}
if ((Scene.Sleigh.Santa._currentframe == 1) and (GiftsStack.length > 0)) {
Scene.Sleigh.Santa.play();
SantaPlaying = true;
}
if (Scene.Sleigh.Santa._currentframe == 12) {
SantaGift = Kids[GiftsStack.shift()].Type;
Scene.Sleigh.Santa.Gift.gotoAndStop(SantaGift);
}
if (Scene.Sleigh.Santa._currentframe == 20) {
DGift = DropGift(Scene.Sleigh._x + 19, Scene.Sleigh._y - 30, SantaGift, SleighSpeed, 0);
Gifts[DGift].NoCatch = 0;
}
g = 1;
while (g <= TotalGifts) {
if (Gifts[g].Active) {
if (Math.abs(Gifts[g].xSpeed) > 0.1) {
Gifts[g].xSpeed = Gifts[g].xSpeed * 0.95;
} else {
Gifts[g].xSpeed = 0;
}
Gifts[g].ySpeed = Gifts[g].ySpeed + 0.5;
Gifts[g].x = Gifts[g].x + Gifts[g].xSpeed;
Gifts[g].y = Gifts[g].y + Gifts[g].ySpeed;
eval ("Scene.Gift" + g)._x = Gifts[g].x;
eval ("Scene.Gift" + g)._y = Gifts[g].y;
if (Gifts[g].NoCatch > 0) {
Gifts[g].NoCatch--;
}
if ((((((GiftInHands == 0) and (Gifts[g].NoCatch == 0)) and (Gifts[g].x > (CenterPoint.x - 20))) and (Gifts[g].x < (CenterPoint.x + 20))) and (Gifts[g].y > (CenterPoint.y - 5))) and (Gifts[g].y < (CenterPoint.y + 50))) {
Gifts[g].Active = false;
GiftInHands = Gifts[g].Type;
eval ("Scene.Gift" + g)._visible = false;
XFly = (XFly + Gifts[g].xSpeed) / 2;
YFly = (YFly + Gifts[g].ySpeed) / 2;
Scene.Hero.gotoAndStop(6);
Scene.Hero.Gift.gotoAndStop(GiftInHands);
}
if (Gifts[g].y >= 420) {
k = 1;
while (k <= KidsNum) {
if (((Gifts[g].x > (Kids[k].x - 25)) and (Gifts[g].x < (Kids[k].x + 25))) and (!Kids[k].HasGift)) {
Gifts[g].Active = false;
eval ("Scene.Gift" + g)._visible = false;
Kids[k].HasGift = true;
if (Gifts[g].Type == Kids[k].Type) {
eval ("Scene.Kid" + k).Inside.gotoAndStop(10);
if (FX) {
eval ("Scene.Gift" + g).Snd.start();
}
Score = Score + Math.round((SleighSpeed * Accuracy) / 30);
ScoreText.Update();
} else {
eval ("Scene.Kid" + k).Inside.gotoAndStop(11);
}
GiftsResolved++;
if (Level == 4) {
CheckLevel();
}
if ((GiftsResolved >= KidsNum) and (Level < 4)) {
Level++;
Lives++;
if (Level < 4) {
gotoAndStop ("EndLevel");
} else {
gotoAndStop ("EndLevel3");
}
}
break;
}
k++;
}
if ((Gifts[g].y >= 480) and Gifts[g].Active) {
Gifts[g].Active = false;
eval ("Scene.Gift" + g)._visible = false;
PutSmoke(Gifts[g].x, 480, Gifts[g].Type);
Lives--;
LivesText.Update();
if (Lives <= 0) {
gotoAndStop ("EndGame");
}
GiftsResolved++;
if (Level == 4) {
CheckLevel();
}
if ((GiftsResolved >= KidsNum) and (Level < 4)) {
Level++;
Lives++;
if (Level < 4) {
gotoAndStop ("EndLevel");
} else {
gotoAndStop ("EndLevel3");
}
}
}
}
}
g++;
}
Scene.Sleigh._x = Scene.Sleigh._x + SleighSpeed;
MoveHead = random(100) + 1;
MoveEar = random(100) + 1;
if (MoveHead <= 6) {
eval ("Scene.Sleigh.Deer" + MoveHead).Head.play();
}
if (MoveEar <= 6) {
eval ("Scene.Sleigh.Deer" + MoveEar).Head.Ear.play();
}
if (Level == 4) {
k = 1;
while (k <= KidsNum) {
if (Kids[k].x < (LeftBound - 30)) {
PlaceKid(k, RightBound + 30, RightBound + 330);
}
k++;
}
}
}
Frame 7
gotoAndPlay ("Cycle");
Frame 8
_quality = "HIGH";
PrevLevel = Level - 1;
LevelText = "YOU HAVE PASSED LEVEL " + PrevLevel;
ScoreTxt = Score;
JB.stop();
Frame 9
_quality = "HIGH";
JB.stop();
Frame 10
_quality = "HIGH";
JB.stop();
Symbol 8 MovieClip Frame 1
stop();
Symbol 19 Button
on (press) {
getURL ("http://www.sugar-free-games.com", "_SELF");
}
Symbol 27 MovieClip Frame 74
stop();
Symbol 27 MovieClip Frame 100
_parent.gotoAndPlay(3);
Symbol 37 Button
on (press) {
gotoAndPlay ("LevelInit");
}
Symbol 38 Button
on (press) {
Instructions.Enable();
}
Symbol 40 Button
on (press) {
getURL ("http://www.sugar-free-games.com", "_blank");
}
Symbol 41 Button
on (press) {
getURL ("http://www.sugar-free-games.com/showgame.php?game=300", "_blank");
}
Symbol 45 Button
on (press) {
getURL ("http://www.sugar-free-games.com", "_blank");
}
Symbol 49 Button
on (press) {
Disable();
}
Symbol 172 MovieClip Frame 1
stop();
Symbol 176 MovieClip Frame 1
stop();
Symbol 278 MovieClip Frame 1
stop();
Symbol 296 MovieClip Frame 9
gotoAndPlay (1);
Symbol 313 MovieClip Frame 9
gotoAndPlay (1);
Symbol 340 MovieClip Frame 26
stop();
_visible = false;
Active = false;
Instance of Symbol 152 MovieClip "HeroSample" in Symbol 341 MovieClip Frame 1
onClipEvent (load) {
gotoAndStop (1);
}
Symbol 373 Button
on (press) {
Pause(true);
}
Symbol 375 Button
on (press) {
_visible = false;
_parent.Pause(false);
}
Symbol 376 Button
on (press) {
_parent.gotoAndStop("EndGame");
}
Symbol 377 Button
on (press) {
getURL ("http://www.sugar-free-games.com/showgame.php?game=300", "_blank");
}
Symbol 380 Button
on (press) {
_parent.Instructions.Enable();
}
Symbol 388 Button
on (press) {
_parent.FX = !_parent.FX;
if (_parent.FX) {
gotoAndStop (1);
} else {
gotoAndStop (2);
}
}
Symbol 391 MovieClip Frame 1
stop();
Symbol 394 Button
on (press) {
_parent.Music = !_parent.Music;
if (_parent.Music) {
_parent.JB.setVolume(100);
gotoAndStop (1);
} else {
_parent.JB.setVolume(0);
gotoAndStop (2);
}
}
Symbol 397 MovieClip Frame 1
stop();
Symbol 402 Button
on (press) {
gotoAndPlay ("InitLevel");
}
Symbol 406 Button
on (press) {
getURL ("http://www.sugar-free-games.com", "_blank");
}
Symbol 410 Button
on (press) {
gotoAndPlay ("EndGame");
}
Symbol 413 Button
on (press) {
if (UserName.length > 0) {
Masks = new Array("fgfgdfgFSDFjh", "3462IOU84hISUDAFHueuryuwre4", "FDser58487(7tgery", "EWiuhcebI(9348", "ew43(==IiJEEID223", "bEHRIIUUIDUFHuuhhewiu2341", "DgerihutHhuhoui44588SDuiheu8", "Sdsfeu38)(7456387ddyeg", "DSerefnbuUuindeune45", "uTGer49887HUIoiuh=", "SDE4e4fhsH087h4hfe", "SADerfregtythyuDdf", "gGRWed4dDCDsdwew43209");
Data = new Array();
Data[0] = random(Masks.length);
Data[1] = random(Masks[Data[0]].length);
Data[2] = UserName.length;
ScoreSt = UserScore.toString();
Data[3] = ScoreSt.length;
i = 0;
while (i < Data[2]) {
Data[5 + i] = ord(UserName.charAt(i));
i++;
}
i = 0;
while (i < Data[3]) {
Data[(5 + Data[2]) + i] = ord(ScoreSt.charAt(i));
i++;
}
CheckSum = 0;
i = 5;
while (i < Data.length) {
CheckSum = CheckSum + Data[i];
i++;
}
Data[4] = CheckSum % 100;
COS = Data[1];
i = 2;
while (i < Data.length) {
MaskCo = ord(Masks[Data[0]].charAt(COS)) % 40;
if (MaskCo == 0) {
MaskCo = 40;
}
Data[i] = Data[i] + ord(Masks[Data[0]].charAt(COS));
Data[i] = Data[i] * MaskCo;
COS++;
if (COS >= Masks[Data[0]].length) {
COS = 0;
}
i++;
}
Output = Data.join("x");
Dt.res = Output;
SendData = true;
RName = UserName;
RScore = UserScore;
gotoAndStop (2);
} else {
Nm.gotoAndPlay(2);
}
}
Symbol 417 MovieClip Frame 1
stop();
Symbol 418 Button
on (press) {
_parent.gotoAndStop("InitGame");
}
Symbol 431 Button
on (press) {
SendData = true;
}
Symbol 434 MovieClip Frame 1
if (_parent.Score == 0) {
_parent.gotoAndStop("InitGame");
}
UserScore = _parent.Score;
Selection.setFocus("UserName");
_parent.Score = 0;
stop();
Instance of Symbol 370 MovieClip "Dt" in Symbol 434 MovieClip Frame 1
onClipEvent (enterFrame) {
if (_parent.SendData) {
getURL ("http://www.sugar-free-games.com/superchristmas.php", "_blank", "POST");
_parent.SendData = false;
}
}
Symbol 434 MovieClip Frame 2
RName = "Name: " + RName;
RScore = "Score: " + RScore;
stop();