Frame 1
function drawLayer(layerName, depth, ID, threshold) {
if (_root.maxlayer == undefined) {
_root.maxlayer = 0;
}
_root.maxlayer = ((depth > _root.maxlayer) ? (depth) : (_root.maxlayer));
_root[layerName + "_test"] = new flash.display.BitmapData(b_width, b_height, transparent, fillColor);
var tester = _root[layerName + "_test"];
var _local10 = (_root[layerName + "_clothes"] = new flash.display.BitmapData(s_width, s_height, transparent, fillColor));
var _local12 = _root.attachMovie(ID, "temp" + layerName, depth - 5000, {_visible:false});
var _local8 = _root.createEmptyMovieClip(layerName, depth + 500);
_local10.draw(_local12);
_local8.attachBitmap(_local10, 1);
_local8._threshold = threshold;
_local8.testMe = function () {
tester = new flash.display.BitmapData(b_width, b_height, transparent, fillColor);
tester.draw(this, new flash.geom.Matrix(w_diff, 0, 0, h_diff, 0, 0), normal_color, "layer");
var _local8 = this.createEmptyMovieClip("clothing_test", -102);
var _local5 = 0;
var _local6 = 0;
var _local4 = b_width;
while (_local4 >= 0) {
var _local2 = b_height;
while (_local2 >= 0) {
var _local3 = (tester.getPixel32(_local4, _local2) >> 24) & 255;
_local6 = _local6 + _local3;
_local5++;
_local2--;
}
_local4--;
}
var _local7 = _local6 / _local5;
return(_local7);
};
_local8.base_clr = _local8.testMe();
_local8.getFill = function () {
return(this.testMe() / this.base_clr);
};
}
function getCurrentLayer() {
var _local2 = 0;
while (_local2 <= _root.maxlayer) {
var _local3 = _root.getInstanceAtDepth(500 + _local2);
var _local4 = _local3.getFill();
if (_local4 < _local3._threshold) {
return(_local2 - 1);
}
_local2++;
}
return(_local2 - 1);
}
function levelUp() {
play_btn._visible = true;
replay_btn._visible = true;
}
Stage.scaleMode = "noborder";
var xray_cm = new ContextMenu();
xray_cm.hideBuiltInItems();
var cmi_link_1 = new ContextMenuItem("Art and code \u00A9 2020 Underside", function () {
getURL ("https://aryion.com/g4/user/Underside");
});
xray_cm.customItems.push(cmi_link_1);
_root.menu = xray_cm;
var b_width = 25;
var b_height = 25;
var s_width = Stage.width;
var s_height = Stage.height;
var w_diff = (b_width / s_width);
var h_diff = (b_height / s_height);
var transparent = true;
var normal_color = (new flash.geom.ColorTransform(1, 1, 1, 1, 0, 0, 0, 0));
var fillColor = 0;
drawLayer("panties", 0, "underwear", 0.5);
drawLayer("outfit", 1, "clothing", 0.5);
Instance of Symbol 16 MovieClip "replay_btn" in Frame 1
onClipEvent (load) {
function init() {
this._visible = false;
this.gotoAndStop(1);
}
init();
}
on (press) {
this.gotoAndStop(2);
}
on (releaseOutside) {
this.gotoAndStop(1);
}
on (release) {
_root.gotoAndPlay(1);
init();
}
Instance of Symbol 18 MovieClip "eraser" in Frame 1
onClipEvent (load) {
_parent.erasure._visible = false;
this._xtrack = _parent._xmouse;
this._ytrack = _parent._ymouse;
this._xprev = this._xtrack;
this._yprev = this._ytrack;
this.onEnterFrame = function () {
this._xprev = this._xtrack;
this._yprev = this._ytrack;
this._xtrack = _parent._xmouse;
this._ytrack = _parent._ymouse;
};
}
onClipEvent (mouseUp) {
this.onEnterFrame = function () {
this._xprev = this._xtrack;
this._yprev = this._ytrack;
this._xtrack = _parent._xmouse;
this._ytrack = _parent._ymouse;
};
}
onClipEvent (mouseDown) {
this.onEnterFrame = function () {
var _local7 = _root.getCurrentLayer();
if (_local7 == -1) {
_root.levelUp();
}
var _local6 = _root.maxlayer;
while (_local6 >= _local7) {
garment = _root.getInstanceAtDepth(500 + _local6);
var _local4 = this._xtrack - this._xprev;
var _local5 = this._ytrack - this._yprev;
_root[garment._name + "_clothes"].draw(_parent.erasure, new flash.geom.Matrix(1, 0, 0, 1, this._xtrack, this._ytrack), _parent.normal_color, "erase");
_root[garment._name + "_clothes"].draw(_parent.erasure, new flash.geom.Matrix(1, 0, 0, 1, this._xprev + ((1 * _local4) / 3), this._yprev + ((1 * _local5) / 5)), _parent.normal_color, "erase");
_root[garment._name + "_clothes"].draw(_parent.erasure, new flash.geom.Matrix(1, 0, 0, 1, this._xprev + ((2 * _local4) / 3), this._yprev + ((2 * _local5) / 5)), _parent.normal_color, "erase");
_root[garment._name + "_clothes"].draw(_parent.erasure, new flash.geom.Matrix(1, 0, 0, 1, this._xprev + ((1 * _local4) / 3), this._yprev + ((3 * _local5) / 5)), _parent.normal_color, "erase");
_root[garment._name + "_clothes"].draw(_parent.erasure, new flash.geom.Matrix(1, 0, 0, 1, this._xprev + ((2 * _local4) / 3), this._yprev + ((4 * _local5) / 5)), _parent.normal_color, "erase");
_local6--;
}
this._xprev = this._xtrack;
this._yprev = this._ytrack;
this._xtrack = _parent._xmouse;
this._ytrack = _parent._ymouse;
};
}
Instance of Symbol 21 MovieClip "eraser_mouse" in Frame 1
onClipEvent (mouseMove) {
this._x = _parent._xmouse;
this._y = _parent._ymouse;
if (this._prevx1 == undefined) {
var i = 1;
while (i < 10) {
this["_prevx" + i] = _parent._xmouse;
this["_prevy" + i] = _parent._ymouse;
i++;
}
}
n = Math.atan2(_parent._ymouse - this._prevy9, _parent._xmouse - this._prevx9);
n = 90 + ((n / Math.PI) * 180);
this._rotation = n;
var j = 9;
while (j > 1) {
this["_prevx" + j] = this["_prevx" + (j - 1)];
this["_prevy" + j] = this["_prevy" + (j - 1)];
j--;
}
_prevx1 = _parent._xmouse;
_prevy1 = _parent._ymouse;
this.swapDepths(8000);
}
Frame 2
drawLayer("undies", 0, "undies", 0.02);
drawLayer("outfit", 1, "outfit", 0.005);
stop();
Instance of Symbol 7 MovieClip in Symbol 8 MovieClip [erasure] Frame 1
onClipEvent (mouseMove) {
if (this._prevx1 == undefined) {
var i = 1;
while (i < 10) {
this["_prevx" + i] = _parent._xmouse;
this["_prevy" + i] = _parent._ymouse;
i++;
}
}
n = Math.atan2(_parent._ymouse - this._prevy9, _parent._xmouse - this._prevx9);
n = 90 + ((n / Math.PI) * 180);
this._rotation = n;
var j = 9;
while (j > 1) {
this["_prevx" + j] = this["_prevx" + (j - 1)];
this["_prevy" + j] = this["_prevy" + (j - 1)];
j--;
}
_prevx1 = _parent._xmouse;
_prevy1 = _parent._ymouse;
}