Frame 1
function restart() {
this.gotoAndPlay(1);
}
function init() {
this.movement = false;
this.threed = false;
this.state = "stopped";
drawframe._x = frame._x + (frame._width / 2);
drawframe._y = frame._y + (frame._height / 2);
flake._x = frame._x + (frame._width / 2);
flake._y = frame._y + (frame._height / 2);
}
function deleteFlake() {
this.flake.removeMovieClip();
}
function reArray() {
farray.removeMovieClip();
this.createEmptyMovieClip("farray", 1);
farray.flakeArray = new Array();
}
function submitMessage(message) {
this.all_vars.retrievableData = this.all_vars.retrievableData + "m,";
this.all_vars.retrievableData = this.all_vars.retrievableData + message;
this.all_vars.play();
}
function submit() {
this.all_vars.retrievableData = "s,";
reArray();
z = 1;
while (z <= this.drawframe.i) {
xscale = Math.round(this.drawframe[z]._xscale);
this.farray.flakeArray[z - 1] = new Array(Math.round(this.drawframe[z]._x), Math.round(this.drawframe[z]._y), this.drawframe[z]._rotation, xscale);
y = 0;
while (y < 4) {
this.all_vars.retrievableData = this.all_vars.retrievableData + this.farray.flakeArray[z - 1][y];
this.all_vars.retrievableData = this.all_vars.retrievableData + ",";
y++;
}
z++;
}
}
function makeFlake() {
var objnew = ("bottledraw" + drawob);
this.attachMovie("bottledraw", objnew, 10000 + drawob);
drawob++;
this[objnew].i = this.drawframe.i;
this[objnew].s = 0;
this[objnew].scale = 1;
this.mask.undo.show = true;
this.mask.undo.play();
if (this.drawframe.i >= 1) {
this.mask.undo._alpha = 100;
} else {
this.mask.undo._alpha = 0;
}
}
function undo() {
if (this.drawframe.i >= 1) {
this.flake[this.drawframe.i].removeMovieClip();
this.drawframe[this.drawframe.i].removeMovieClip();
this.drawframe.i = this.drawframe.i - 1;
}
if (this.drawframe.i == 0) {
this.mask.undo._alpha = 0;
}
}
function checkframe() {
g = 1;
while (g <= this.drawframe.i) {
h = 0;
while (h < 12) {
if (this.threed) {
this.flake[g]["clip" + h].bot.bottle.gotoAndStop(1);
} else {
this.flake[g]["clip" + h].bot.bottle.gotoAndStop(2);
}
h++;
}
g++;
}
}
function soundOff() {
this.snd.setVolume(0);
}
function soundOn() {
this.snd.setVolume(100);
}
Math.easeOutQuad = function (t, b, c, d) {
if (((t = t / (d / 2))) < 1) {
return((((c / 2) * t) * t) + b);
}
return((((-c) / 2) * (((--t) * (t - 2)) - 1)) + b);
};
this.onEnterFrame = function () {
if (this.movement) {
scaler = scaler + 0.05;
slidingscale = Math.sin(scaler);
flake._rotation++;
drawframe._rotation = flake._rotation;
drawframe._xscale = flake._xscale;
drawframe._yscale = flake._yscale;
g = 1;
while (g <= drawframe.i) {
if (threed) {
if (this.flake[g].build) {
flake._alpha = 50;
this.flake[g]._yscale = this.flake[g]._yscale + (((Math.sin(this.scaler + ((g * Math.PI) / this.drawframe.i)) * 100) - this.flake[g]._yscale) / 8);
if (flake._xscale > 71) {
flake._xscale = flake._xscale + ((70 - flake._xscale) / 10);
flake._yscale = flake._xscale;
}
h = 0;
while (h < 12) {
this.flake[g]["clip" + h].bot._rotation = this.flake[g]["clip" + h].bot._rotation + 0.5;
h++;
}
}
} else {
flake._alpha = 60 + (slidingscale * 20);
h = 0;
while (h < 12) {
this.flake[g]["clip" + h].bot.bottle.gotoAndStop(1);
h++;
}
this.flake[g]._yscale = this.flake[g]._yscale + ((100 - this.flake[g]._yscale) / 4);
if (flake._xscale < 98) {
flake._xscale = flake._xscale + ((100 - flake._xscale) / 10);
flake._yscale = flake._xscale;
}
if (this.flake[g].build) {
h = 0;
while (h < 12) {
this.flake[g]["clip" + h].bot._rotation = this.flake[g]["clip" + h].bot._rotation + 1.5;
h++;
}
}
}
g++;
}
} else {
var g = 1;
while (g <= drawframe.i) {
if (this.threed) {
if (this.flake[g].build) {
flake._alpha = 50;
this.flake[g]._yscale = this.flake[g]._yscale + (((Math.sin(this.scaler + ((g * Math.PI) / this.drawframe.i)) * 100) - this.flake[g]._yscale) / 8);
if (flake._xscale > 71) {
flake._xscale = flake._xscale + ((70 - flake._xscale) / 10);
flake._yscale = flake._xscale;
}
}
} else {
flake._alpha = 60 + (slidingscale * 20);
this.flake[g]._yscale = this.flake[g]._yscale + ((100 - this.flake[g]._yscale) / 4);
if (flake._xscale < 98) {
flake._xscale = flake._xscale + ((100 - flake._xscale) / 10);
flake._yscale = flake._xscale;
}
}
g++;
}
drawframe._xscale = flake._xscale;
drawframe._yscale = flake._yscale;
}
};
reArray();
init();
stop();
Symbol 7 MovieClip [flake1] Frame 1
this.onEnterFrame = function () {
this._y = this._y + speed;
this._xscale = scaler * Math.sin(thet);
thet = thet + thetadd;
this._rotation = this._rotation + (thetadd * 10);
this._x = this._x + Math.sin(driftthet);
driftthet = driftthet + 0.01;
if (!_parent._parent.eraseflake) {
if (this._y > 400) {
_parent.makeOne();
this.removeMovieClip();
}
} else {
_parent._alpha--;
}
};
gotoAndStop(random(this._totalframes) + 1);
Symbol 10 MovieClip [bottle] Frame 1
this.onEnterFrame = function () {
restraintangle = 15;
if (current) {
xdis = _parent._xmouse - this._x;
ydis = _parent._ymouse - this._y;
hypo = Math.sqrt((xdis * xdis) + (ydis * ydis));
this._xscale = hypo;
this._yscale = hypo;
angle = Math.asin(ydis / hypo);
angle = Math.abs((angle * 180) / Math.PI);
bot = Math.floor(angle / restraintangle) * restraintangle;
top = Math.ceil(angle / restraintangle) * restraintangle;
if (Math.abs(angle - bot) > Math.abs(angle - top)) {
angle = top;
} else {
angle = bot;
}
if ((xdis >= 0) && (ydis >= 0)) {
this._rotation = angle + 90;
} else if ((xdis >= 0) && (ydis < 0)) {
this._rotation = 90 - angle;
} else if ((xdis < 0) && (ydis >= 0)) {
this._rotation = (-angle) - 90;
} else {
this._rotation = angle - 90;
}
}
};
Symbol 11 MovieClip [bottledraw] Frame 1
this.onEnterFrame = function () {
robj = this.i;
if (s == 0) {
_root.flake.attachMovie("shell", robj, i + 50);
}
sobj = "clip" + s;
_root.flake[robj].attachMovie("shell", sobj, s);
_root.flake[robj][sobj]._rotation = s * 30;
_root.flake[robj][sobj]._yscale = 100 * scale;
scale = scale * -1;
_root.flake[robj][sobj].attachMovie("bottle", "bot", s);
_root.flake[robj][sobj].bot._x = _root.drawframe[i]._x;
_root.flake[robj][sobj].bot._y = _root.drawframe[i]._y;
_root.flake[robj][sobj].bot._rotation = _root.drawframe[i]._rotation;
_root.flake[robj][sobj].bot._xscale = _root.drawframe[i]._xscale;
_root.flake[robj][sobj].bot._yscale = _root.drawframe[i]._yscale;
if (s < 11) {
s++;
} else {
_root.flake[robj].build = true;
this.removeMovieClip();
}
};
Symbol 12 MovieClip [fallingflake] Frame 1
this.onEnterFrame = function () {
if (init != 2) {
init = 2;
starter = getTimer();
}
this._xscale = this._xscale + ((100 - this._xscale) / 5);
this._yscale = this._xscale;
this._rotation = this._rotation + 1;
if ((getTimer() - starter) > 6000) {
_parent._parent.makeFallingFlake();
this.removeMovieClip();
}
};
Symbol 14 Button
on (press) {
if (_parent._parent.movement) {
_parent._parent.state = "stopped";
_parent._parent.movement = false;
_parent._parent.threed = false;
gotoAndStop (1);
}
}
Symbol 15 Button
on (press) {
if (_root.threed || (!_root.movement)) {
_parent._parent.state = "2D";
_root.movement = true;
_root.threed = false;
gotoAndStop (2);
}
}
Symbol 16 Button
on (press) {
if (!_root.threed) {
_parent._parent.state = "3D";
_root.threed = true;
_root.movement = true;
gotoAndStop (3);
}
}
Symbol 24 MovieClip Frame 1
stop();
Symbol 28 Button
on (press) {
_parent._parent.undo();
}
Symbol 31 MovieClip [mask] Frame 1
stop();
_parent.nextFrame();
this.eraseflake = true;
Symbol 33 MovieClip [drawframe] Frame 1
function endDraw() {
if (this[obj].current == true) {
if (_root.state != "stopped") {
_root.movement = true;
}
if (this[obj]._xscale > 5) {
this[obj].current = false;
this[obj]._alpha = 0;
_root.makeFlake();
} else {
this[obj]._xscale = 8;
this[obj]._yscale = 8;
this[obj].current = false;
this[obj]._alpha = 0;
_root.makeFlake();
}
}
}
this.onMouseDown = function () {
if (_root.erase != true) {
if (_root.frame.hitTest(_root._xmouse, _root._ymouse, true)) {
_root.movement = false;
this._alpha = 100;
i++;
this.obj = i;
this.attachMovie("bottle", obj, i + 100);
this[obj]._x = this._xmouse;
this[obj]._y = this._ymouse;
this[obj].current = true;
}
}
};
this.onMouseUp = function () {
if (_root.frame.hitTest(_root._xmouse, _root._ymouse, true)) {
endDraw();
}
};
this.onEnterFrame = function () {
if (!_root.frame.hitTest(_root._xmouse, _root._ymouse, true)) {
endDraw();
}
};
Symbol 36 MovieClip Frame 1
stop();
Symbol 36 MovieClip Frame 2
sendString = "http://www.pointroll.com/content/absolut/wonder.asp?";
sendString = sendString + "templatePath=special/wonder&";
sendString = sendString + (("retrievableData=" + this.retrievableData) + "&");
sendString = sendString + (("toName=" + this.toName) + "&");
sendString = sendString + (("fromName=" + this.fromName) + "&");
sendString = sendString + (("toEmail=" + this.toEmail) + "&");
sendString = sendString + (("fromEmail=" + this.fromEmail) + "&");
loadVariables (sendString, this);
Symbol 42 Button
on (press) {
getURL ("http://www.zefrank.com");
}