Frame 1
var sound_obj_pohi = new Sound();
sound_obj_pohi.attachSound("pohi");
var sound_obj_an = new Sound();
sound_obj_an.attachSound("an");
var sound_obj_boyo_0 = new Sound();
sound_obj_boyo_0.attachSound("boyo_0");
var sound_obj_boyo_1 = new Sound();
sound_obj_boyo_1.attachSound("boyo_1");
var sound_obj_boyo_2 = new Sound();
sound_obj_boyo_2.attachSound("boyo_2");
function matrix_mc() {
if (mouseCheck == 0) {
bound_d = Mathfloor(bound_d * restitution_d);
bound_c = Mathfloor(bound_c * restitution_c);
Mathfloor(bound_c);
changeValue = changeValue + boundSpeed;
matrix.d = Mathfloor(1 + (bound_d * Math.cos(changeValue)));
matrix.c = Mathfloor(bound_c * Math.cos(changeValue));
bound_within();
matrix.a = 1 / matrix.d;
}
test_mc.transform.matrix = matrix;
}
function bound_within() {
if (matrix.d < bound_d_min) {
matrix.d = bound_d_min;
} else if (matrix.d > bound_d_max) {
matrix.d = bound_d_max;
}
if (matrix.c < (-bound_c_within)) {
matrix.c = -bound_c_within;
} else if (matrix.c < (-bound_c_within)) {
matrix.c = bound_c_within;
}
}
function mouseUPsound() {
if (mouseMoveFlag != 0) {
if (count >= 100) {
sound_obj_an.start();
count = 0;
} else {
var _local1 = boundSpeed * 10;
if (_local1 <= 3) {
sound_obj_boyo_0.start();
} else if (_local1 <= 6) {
sound_obj_boyo_1.start();
} else {
sound_obj_boyo_2.start();
}
}
}
}
function mouseDOWNsound() {
count++;
sound_obj_pohi.start();
}
function Mathfloor(num) {
return(Math.floor(num * 100000) / 100000);
}
var bound_d = 1;
var bound_c = 0;
var bound_d_min = 0.45;
var bound_d_max = 2;
var bound_c_within = 2.5;
var correction_d = 3;
var correction_c = 2;
var boundSpeed = 0.5;
var restitution_d = 0.92;
var restitution_c = 0.94;
var mc_width = test_mc._width;
var mc_height = test_mc._height;
var pressXmouse;
var pressYmouse;
var mouseCheck = 0;
var changeValue = 0;
var count = 0;
var mouseMoveFlag = 0;
var matrix = test_mc.transform.matrix;
test_mc.onPress = function () {
mouseDOWNsound();
pressXmouse = _xmouse;
pressYmouse = _ymouse;
mouseCheck = 1;
bound_c = matrix.c;
bound_d = matrix.d;
changeValue = 0;
};
test_mc.onMouseUp = function () {
if (mouseCheck == 1) {
mouseUPsound();
bound_d = Mathfloor(matrix.d - 1);
bound_c = Mathfloor(matrix.c);
}
mouseCheck = 0;
onEnterFrame = function () {
if ((Math.abs(bound_d) > 0.001) || (Math.abs(bound_c) > 0.005)) {
matrix_mc();
} else {
matrix.d = 1;
matrix.a = 1;
matrix.c = 0;
test_mc.transform.matrix = matrix;
delete this.onEnterFrame;
trace("owata");
}
};
mouseMoveFlag = 0;
};
test_mc.onMouseMove = function () {
if (mouseCheck == 1) {
var _local5 = _ymouse;
var _local2 = pressYmouse - _local5;
var _local3 = _local2 / mc_height;
matrix.d = bound_d + (_local3 / correction_d);
var _local4 = _xmouse;
var _local1 = pressXmouse - _local4;
var _local6 = _local1 / mc_width;
matrix.c = bound_c + (_local6 / correction_c);
bound_within();
matrix.a = 1 / matrix.d;
matrix_mc();
mouseMoveFlag = _local1 + _local2;
}
};
function value_change(henka) {
if (value_gauge == 1) {
boundSpeed = henka / 10;
} else if (value_gauge == 2) {
restitution_d = 0.9 + (henka / 100);
} else if (value_gauge == 3) {
restitution_c = 0.9 + (henka / 100);
}
}
function button_y(i) {
var _local1;
if (i == 1) {
_local1 = boundSpeed * 100;
} else if (i == 2) {
_local1 = (restitution_d - 0.9) * 1000;
} else {
_local1 = (restitution_c - 0.9) * 1000;
}
return(_local1);
}
var value_gauge = 0;
i = 1;
while (i < 4) {
var gauge_mc_name = (("gauge" + i) + "_mc");
var mc = _root.gauge_mc[gauge_mc_name];
mc.attachMovie("button", "button", 1);
mc.button._y = -button_y(i);
mc.button.value_gauge = i;
mc.button.onPress = function () {
value_gauge = this.value_gauge;
startDrag (this, false, 0, 0, 0, -99);
};
_root.gauge_mc.onMouseUp = function () {
if (value_gauge != 0) {
var _local2 = this[("gauge" + value_gauge) + "_mc"].button._y;
var _local3 = Math.floor(((-_local2) * 0.9) / 10) + 1;
value_change(_local3);
stopDrag();
}
value_gauge = 0;
};
i++;
}