Frame 1
fscommand ("allowscale", false);
onEnterFrame = function () {
var _local3 = Math.round(getBytesLoaded());
var _local2 = Math.round(getBytesTotal());
percentage = ((!isNaN(_local3 / _local2)) ? (Math.ceil((_local3 * 100) / _local2)) : 0);
MatchBox.gotoAndStop(percentage + 1);
if (percentage >= 99) {
delete this.onEnterFrame;
MatchBox.gotoAndPlay(100);
}
};
Frame 4
stop();
Frame 5
function SetMatchOnFire() {
Sparks.isSparking = false;
if (isMouseDown) {
var _local2 = {x:0, y:0};
Match.Top.localToGlobal(_local2);
if (ScratchSurface.hitTest(_local2.x, _local2.y, true)) {
ScratchInfo.onEnterFrame = function () {
this._alpha = this._alpha - 2;
if (this._alpha <= 0) {
delete this.onEnterFrame;
this._x = -1000;
}
};
var _local5 = _xmouse - lastMousePos.x;
var _local4 = _ymouse - lastMousePos.y;
var _local3 = Math.sqrt((_local5 * _local5) + (_local4 * _local4));
if (_local3 > 5) {
Sparks.isSparking = true;
}
if (_local3 > 35) {
Flame.isBurning = true;
delete onMouseDown;
delete onMouseUp;
onMouseMove = SetHeadOnFire;
Sparks.isSparking = false;
Match.gotoAndStop(2);
this.gotoAndPlay("hide_matchbox");
}
}
}
lastMousePos.x = _xmouse;
lastMousePos.y = _ymouse;
}
function SetHeadOnFire() {
var _local1 = {x:0, y:0};
Match.Top.localToGlobal(_local1);
if (Head.hitTest(_local1.x, _local1.y, true)) {
delete onMouseMove;
gotoAndPlay ("fire_face");
}
lastMousePos.x = _xmouse;
lastMousePos.y = _ymouse;
}
play();
var isMouseDown = false;
var lastMousePos = {x:_xmouse, y:_ymouse};
onMouseDown = function () {
isMouseDown = true;
};
onMouseMove = SetMatchOnFire;
onMouseUp = function () {
isMouseDown = false;
};
Match.onPress = function () {
startDrag (this);
this._x = _root._xmouse;
this._y = _root._ymouse;
ScratchInfo.onEnterFrame = function () {
this._alpha = this._alpha + 2;
if (this._alpha >= 100) {
delete this.onEnterFrame;
}
};
this.onEnterFrame = function () {
this._rotation = this._rotation + ((45 - this._rotation) / 3);
if (this._rotation >= 44) {
delete this.onEnterFrame;
}
};
};
Frame 10
stop();
Frame 15
MatchBox.gotoAndPlay("close");
Frame 25
delete Head.onEnterFrame;
Head.EyeLeft.gotoAndStop("blink");
Head.EyeRight.gotoAndStop("blink");
stop();
Frame 30
Match.stopDrag();
delete Match.onPress;
Match.onEnterFrame = function () {
var _local3 = {x:0, y:0};
this.Top.localToGlobal(_local3);
this._alpha = this._alpha - 2;
var _local5 = _root.Head._x - _local3.x;
var _local4 = (_root.Head._y - _local3.y) + 15;
this._x = this._x + (_local5 / 3);
this._y = this._y + (_local4 / 3);
if (this._alpha <= 0) {
delete this.onEnterFrame;
this._parent.gotoAndPlay("start");
}
};
Frame 40
stop();
Instance of Symbol 26 MovieClip in Frame 40
onClipEvent (enterFrame) {
this._alpha = Math.floor(Math.random() * 10);
}
Frame 45
Head.EyeLeft.play();
Head.EyeRight.play();
Frame 76
function genStar() {
var _local1 = (ty = (tz = 0));
_local1 = (pStarCenter.x * ((Math.random() * 2) - 1)) << 2;
ty = (pStarCenter.y * ((Math.random() * 2) - 1)) << 2;
tz = (-Math.random()) * star_depth;
return(new Object({x:_local1, y:ty, z:tz}));
}
function genStarArray(aStars) {
i = 0;
while (i < num_stars) {
aStars.push(genStar());
aStars[i].z = aStars[i].z + star_depth;
i++;
}
}
function genFlyingBits() {
var _local3 = 0;
while (_local3 < no_flame_tails) {
var _local2 = "fly" + _local3;
Hair.attachMovie("mc:Link", _local2, ++d);
var _local1 = Hair[_local2];
_local1.vx = (Math.random() * 6) - 3;
_local1.vy = (Math.random() * 6) - 3;
_local1.damp = 0.9;
_local1.vr = (Math.random() * 90) - 45;
_local1._xscale = (Hair[_local2]._yscale = 50);
_local3++;
}
}
function genFlameHair() {
var _local4 = 0;
var _local5 = 360 / no_flame_tails;
var _local3 = 0;
while (_local3 < no_flame_tails) {
var _local1 = 0;
while (_local1 < flame_bits) {
var _local2 = (("link" + _local3) + "_") + _local1;
Hair.attachMovie("mc:Link", _local2, ++d);
Hair[_local2].rot = _local4;
_local1++;
}
_local4 = _local4 + _local5;
_local3++;
}
}
function genInfoText() {
var fmt = new TextFormat();
with (fmt) {
color = 16777215 /* 0xFFFFFF */;
size = 14;
font = "Comic Sans MS";
bold = true;
}
this.createEmptyMovieClip("Info", this.getNextHighestDepth());
Info._x = (Info._y = 10);
Info.createTextField("txt", Info.getNextHighestDepth(), 0, 0, 1, 40);
with (Info.txt) {
autoSize = true;
text = "Controls: [UP],[DOWN] and numbers [1],[2],[3],[4],[5]";
selectable = false;
}
Info.txt.setTextFormat(fmt);
Info.i = 0;
Info.onEnterFrame = function () {
i++;
if (i > 400) {
this._y = this._y - 2;
if (this._y <= -40) {
this._x = -1000;
delete this.onEnterFrame;
}
}
};
this.createTextField("ArtBITtxt", this.getNextHighestDepth(), 0, 0, 1, 40);
with (ArtBITtxt) {
autoSize = true;
text = "[ ArtBITs FDTC entry ] - ArtBIT.deviantArt.com";
selectable = false;
html = true;
_x = 190;
_y = 370;
}
with (fmt) {
url = "http://artbit.deviantart.com";
target = "_blank";
align = "center";
}
ArtBITtxt.setTextFormat(fmt);
}
var doAccelerate = false;
var doDecelerate = false;
var ptShaker = {x:0, y:0};
var shaker_rad = 2;
var shaker_ang = 0;
var shaker_ang_inc = 0.02;
var hands_dist = 10;
var flame_bits = 8;
var no_flame_tails = 8;
var d = 0;
var hair_size = 0.7;
var hair_ext = 0.05;
var rad2deg = 57.2957795130823;
var middle_rot = 0;
var num_stars = 150;
var pStarCenter = new Object({x:275, y:200, z:0});
var pStageCenter = new Object({x:275, y:200, z:0});
var star_depth = 1000;
var star_dist = 100;
var star_speed = 1;
var max_star_speed = 100;
var star_speed_factor = 0.001;
var star_accel = 0.2;
var star_trail = 1;
this.createEmptyMovieClip("Stars", this.getNextHighestDepth());
this.createEmptyMovieClip("Hair", this.getNextHighestDepth());
this.attachMovie("mc:Link", "head", this.getNextHighestDepth());
this.attachMovie("mc:Hands", "Hands", this.getNextHighestDepth(), {_xscale:40, _yscale:40});
this.attachMovie("mc:Head", "FireFace", this.getNextHighestDepth(), {_xscale:40, _yscale:40});
var aStars = new Array();
genStarArray(aStars);
genFlyingBits();
genFlameHair();
genInfoText();
var mblur = (new flash.filters.BlurFilter());
mblur.blurX = 8;
mblur.blurY = 8;
Hair.filters = new Array(mblur);
Instance of Symbol 43 MovieClip in Frame 76
onClipEvent (enterFrame) {
this._alpha = this._alpha - 2;
if (this._alpha <= 0) {
delete this.onEnterFrame;
this._x = -1000;
}
}
Frame 77
function rotate(a, b) {
a._rotation = rad2deg * Math.atan2(b._y - a._y, b._x - a._x);
}
function easePolar(src_angle, dest_angle, step) {
src_angle = src_angle % 360;
dest_angle = dest_angle % 360;
var _local3 = dest_angle - src_angle;
if (Math.abs(_local3) > 180) {
if (src_angle < 0) {
src_angle = src_angle + 360;
}
if (dest_angle < 0) {
dest_angle = dest_angle + 360;
}
_local3 = dest_angle - src_angle;
}
return(_local3 / step);
}
function processStars() {
var _local3 = (ty = (tz = 0));
Stars.clear();
var _local2 = -1;
while (_local2++ , _local2 < num_stars) {
_local3 = (nx1 = (nx2 = aStars[_local2].x));
ty = (ny1 = (ny2 = aStars[_local2].y));
tz = (nz1 = (nz2 = aStars[_local2].z));
var _local1 = star_dist / tz;
nx1 = (nx1 * _local1) + pStarCenter.x;
ny1 = (ny1 * _local1) + pStarCenter.y;
_local1 = star_dist / (tz + (star_trail * star_speed));
nx2 = (nx2 * _local1) + pStarCenter.x;
ny2 = (ny2 * _local1) + pStarCenter.y;
if (tz > 0) {
Stars.lineStyle((_local1 * 5) + 1, 16776960, _local1 * 100);
Stars.moveTo(nx1, ny1);
Stars.lineTo(nx2, ny2);
}
if (aStars[_local2].z > star_depth) {
aStars[_local2] = genStar();
} else {
aStars[_local2].z = aStars[_local2].z + star_speed;
}
}
}
function processHairBits() {
pt = new Object({x:0, y:0});
head.end.localToGlobal(pt);
var speed_koef = (star_speed / max_star_speed);
hair_ext = speed_koef / 5;
var size_koef = (((1 - speed_koef) * 0.3) + 0.1);
speed_koef = speed_koef / 10;
var star_rot = head._rotation;
var hair_factor = (hair_size + hair_ext);
var i = ((j = 0));
while (i < flame_bits) {
if (j == no_flame_tails) {
j = 0;
i++;
}
var thisLink = Hair[(("link" + j) + "_") + i];
var lastLink = Hair[(("link" + j) + "_") + (i - 1)];
var rot_reduce = (i / flame_bits);
if (i == 0) {
thisLink._x = pt.x;
thisLink._y = pt.y;
thisLink._xscale = (thisLink._yscale = (size_koef * 100) + 50);
thisLink._rotation = (star_rot + thisLink.rot) + (8 * random(20));
var k = j;
var bit = Hair["fly" + k];
with (bit) {
vx = vx * damp;
vy = vy * damp;
vr = vr * damp;
_alpha = _alpha * damp;
_xscale = _xscale * damp;
_yscale = _yscale * damp;
if (vr < 0.05) {
vr = (Math.random() * 90) - 45;
var tail_end = Hair[(("link" + k) + "_") + (flame_bits - 1)];
_x = tail_end._x;
_y = tail_end._y;
vx = (pStarCenter.x - _x) * speed_koef;
vy = (pStarCenter.y - _y) * speed_koef;
_alpha = 100;
_xscale = (_yscale = 60);
}
_x = _x + vx;
_y = _y + vy;
_rotation = _rotation + vr;
}
} else {
rotate(thisLink, lastLink);
thisLink._xscale = lastLink._xscale * hair_factor;
thisLink._yscale = lastLink._yscale * hair_factor;
point = new Object({x:0, y:0});
lastLink.end.localToGlobal(point);
thisLink._x = point.x;
thisLink._y = point.y;
}
j++;
}
}
function processAcceleration() {
if (doAccelerate) {
if (star_speed < max_star_speed) {
star_speed = star_speed + star_accel;
shaker_ang_inc = shaker_ang_inc + 0.002;
hands_dist = hands_dist - 0.02;
}
} else if (doDecelerate) {
if (star_speed > 1) {
star_speed = star_speed - (star_accel * 5);
if (star_speed < 1) {
star_speed = 1;
}
shaker_ang_inc = shaker_ang_inc - 0.01;
hands_dist = hands_dist + 0.1;
}
}
}
function processPositions() {
var _local5 = star_speed / max_star_speed;
shaker_ang = shaker_ang + shaker_ang_inc;
ptShaker.x = Math.sin(2 * shaker_ang) * shaker_rad;
ptShaker.y = Math.cos(3 * shaker_ang) * shaker_rad;
var _local7 = _xmouse - head._x;
var _local6 = _ymouse - head._y;
var _local1 = (_local5 * 40) + 10;
head._x = head._x + ((_local7 / _local1) + ptShaker.x);
head._y = head._y + ((_local6 / _local1) + ptShaker.y);
BG._x = (pStarCenter.x = ((pStageCenter.x - head._x) / 2) + pStageCenter.x);
BG._y = (pStarCenter.y = ((pStageCenter.y - head._y) / 2) + pStageCenter.y);
var _local3 = pStarCenter.x - head._x;
var _local2 = pStarCenter.y - head._y;
FireFace.follow(head, 1, 1);
Hands.follow(FireFace, 3, 2);
var _local4 = _local5 * 0.03;
Hands._x = Hands._x + (_local3 * _local4);
Hands._y = Hands._y + ((_local2 * _local4) + hands_dist);
head._rotation = Math.atan2(-_local2, -_local3) * rad2deg;
}
MovieClip.prototype.follow = function (mc, xstep, ystep) {
this._x = this._x + ((mc._x - this._x) / xstep);
this._y = this._y + ((mc._y - this._y) / ystep);
};
var listenKeys = new Object();
listenKeys.onKeyDown = function () {
switch (Key.getAscii()) {
case 38 :
doAccelerate = true;
break;
case 40 :
doDecelerate = true;
break;
case 48 :
case 49 :
case 50 :
case 51 :
case 52 :
case 53 :
case 54 :
case 55 :
case 56 :
case 57 :
var _local1 = Key.getAscii() - 48;
Hands.playAction(_local1);
}
doAccelerate = Key.isDown(38);
doDecelerate = (!doAccelerate) && (Key.isDown(40));
};
listenKeys.onKeyUp = function () {
doAccelerate = Key.isDown(38);
doDecelerate = Key.isDown(40);
};
Key.addListener(listenKeys);
Frame 78
onEnterFrame = function () {
processStars();
processAcceleration();
processPositions();
processHairBits();
};
stop();
Symbol 7 MovieClip Frame 1
stop();
Symbol 7 MovieClip Frame 2
stop();
Symbol 15 MovieClip Frame 129
_parent.nextFrame();
Symbol 15 MovieClip Frame 130
stop();
BoxText.gotoAndStop(2);
Symbol 15 MovieClip Frame 161
stop();
Symbol 24 MovieClip Frame 1
stop();
Symbol 27 MovieClip Frame 35
stop();
Symbol 28 MovieClip Frame 1
f0._x = -500;
var isBurning = false;
Symbol 28 MovieClip Frame 2
var bits = 30;
var i = 1;
while (i <= bits) {
f0.duplicateMovieClip("f" + i, this.getNextHighestDepth());
var f = this["f" + i];
var p = {x:0, y:0};
_parent.Match.Top.localToGlobal(p);
f._x = p.x;
f._y = p.y;
if (!isBurning) {
f._y = -1000;
}
f.gotoAndPlay((bits - i) + 1);
i++;
}
Symbol 28 MovieClip Frame 3
var i = bits;
while (i > 1) {
var f = this["f" + i];
f._y = f._y - 4;
if (f._currentframe >= 30) {
var p = {x:(Math.random() * 4) - 2, y:0};
_parent.Match.Top.localToGlobal(p);
f._x = p.x;
f._y = p.y;
f.gotoAndPlay(1);
}
if (!isBurning) {
f._y = -1000;
}
i--;
}
Symbol 28 MovieClip Frame 4
gotoAndPlay (3);
Symbol 29 MovieClip Frame 16
stop();
Symbol 30 MovieClip Frame 1
f0._x = -500;
var isSparking = false;
Symbol 30 MovieClip Frame 2
var bits = 50;
var i = 1;
while (i <= bits) {
f0.duplicateMovieClip("f" + i, this.getNextHighestDepth());
var f = this["f" + i];
var p = {x:0, y:0};
_parent.Match.Top.localToGlobal(p);
f._x = p.x;
f._y = p.y;
f._rotation = Math.random() * 360;
if (!isSparking) {
f._y = -500;
}
var frm = Math.floor((Math.random() * 5) + 1);
f.gotoAndPlay(frm);
i++;
}
Symbol 30 MovieClip Frame 3
var i = bits;
while (i > 1) {
var f = this["f" + i];
if ((f._currentframe >= 15) && (isSparking)) {
var p = {x:0, y:0};
_parent.Match.Top.localToGlobal(p);
f._x = p.x;
f._y = p.y;
f._rotation = Math.random() * 360;
var frm = Math.floor((Math.random() * 10) + 1);
f.gotoAndPlay(frm);
}
i--;
}
Symbol 30 MovieClip Frame 4
gotoAndPlay (3);
Symbol 34 MovieClip [mc:Hands] Frame 1
function playAction(num) {
if (!idle) {
return(undefined);
}
switch (num) {
case 1 :
gotoAndPlay ("wave");
break;
case 2 :
gotoAndPlay ("no_hands");
break;
case 3 :
gotoAndPlay ("spin");
break;
case 4 :
gotoAndPlay ("fly");
break;
case 5 :
gotoAndPlay ("swim");
break;
default :
playAction(Math.floor((Math.random() * no_actions) + 1));
}
}
var idle = true;
var no_actions = 5;
stop();
Symbol 34 MovieClip [mc:Hands] Frame 6
idle = false;
Symbol 34 MovieClip [mc:Hands] Frame 51
gotoAndPlay (1);
Symbol 34 MovieClip [mc:Hands] Frame 52
idle = false;
_root.doDecelerate = true;
Symbol 34 MovieClip [mc:Hands] Frame 101
_root.doDecelerate = false;
gotoAndPlay (1);
Symbol 34 MovieClip [mc:Hands] Frame 102
idle = false;
Symbol 34 MovieClip [mc:Hands] Frame 135
var repeats = 6;
Symbol 34 MovieClip [mc:Hands] Frame 136
repeats--;
_root.doAccelerate = true;
Symbol 34 MovieClip [mc:Hands] Frame 171
if (repeats) {
gotoAndPlay ("rpt_fly");
}
Symbol 34 MovieClip [mc:Hands] Frame 201
_root.doAccelerate = false;
gotoAndPlay (1);
Symbol 34 MovieClip [mc:Hands] Frame 202
idle = false;
Symbol 34 MovieClip [mc:Hands] Frame 241
_root.doDecelerate = true;
Symbol 34 MovieClip [mc:Hands] Frame 320
_root.doDecelerate = false;
gotoAndPlay (1);
Symbol 34 MovieClip [mc:Hands] Frame 321
idle = false;
Symbol 34 MovieClip [mc:Hands] Frame 329
repeats = 10;
Symbol 34 MovieClip [mc:Hands] Frame 330
repeats--;
_root.doAccelerate = true;
Symbol 34 MovieClip [mc:Hands] Frame 363
_root.doAccelerate = false;
Symbol 34 MovieClip [mc:Hands] Frame 372
if (repeats) {
gotoAndPlay ("rpt_swim");
}
Symbol 34 MovieClip [mc:Hands] Frame 379
gotoAndPlay (1);
Symbol 38 MovieClip Frame 1
stop();
Symbol 39 MovieClip [mc:Head] Frame 1
var i = 0;
onEnterFrame = function () {
i++;
if (i == 100) {
EyeLeft.gotoAndPlay("blink");
EyeRight.gotoAndPlay("blink");
i = 0;
}
};