Symbol 21 MovieClip Frame 1
_parent.hitArea = this;
this._visible = false;
Symbol 24 MovieClip Frame 1
stop();
Symbol 25 MovieClip [frt_carriage] Frame 1
#initclip 11
function frt_carriageClass() {
super();
if (this.lname != "") {
this.addListener(this.lname);
}
this.act_offset = 0;
this.delta = 25;
this.btn_l.onRelease = this.sendStartLMessage;
this.btn_r.onRelease = this.sendStartRMessage;
this.klick = new Sound();
this.klick.attachSound("inputClick");
}
frt_carriageClass.prototype = new FISBaseClass();
frt_carriageClass.prototype.sendStartLMessage = function () {
this._parent.notifyListeners(this._parent.emsg, "btn_L");
};
frt_carriageClass.prototype.sendStartRMessage = function () {
this._parent.notifyListeners(this._parent.emsg, "btn_R");
};
frt_carriageClass.prototype.move_up = function (up) {
if (up) {
this._y = this._y - this.move_y;
} else {
this._y = this._y + this.move_y;
this.klick.start();
}
};
frt_carriageClass.prototype.show_buttons = function (vis) {
if (vis) {
this.btn_l._visible = this.act_offset != 0;
this.btn_r._visible = this.act_offset != 5;
} else {
this.btn_l._visible = false;
this.btn_r._visible = false;
}
};
frt_carriageClass.prototype.moveOneStep = function (dir, Steps) {
this.act_offset = this.act_offset + dir;
var startX = 0;
this.act_step = 0;
this.end_step = steps;
this.stepX = this.delta / Steps;
this.onEnterframe = function () {
this.act_step++;
this.digits_mc._x = (this.act_step * this.stepX) * dir;
if (this.act_step == this.end_step) {
this.digits_mc._x = 0;
this.notifyListeners(this.emsg, "atEnd");
this.onEnterframe = undefined;
var n = 0;
while (n < 10) {
this.digits_mc["d" + n].text = this.act_offset + n;
n++;
}
}
};
};
Object.registerClass("frt_carriage", frt_carriageClass);
#endinitclip
Symbol 29 MovieClip [FISBase] Frame 1
#initclip 1
function FISBaseClass() {
this.lnames = new Object();
this.timeline = this._parent;
this.tile._visible = false;
}
FISBaseClass.prototype = new MovieClip();
FISBaseClass.prototype.addListener = function (nm) {
if (typeof(nm) == "string") {
this.lnames[nm] = nm;
} else {
if (this.lobj == undefined) {
this.lobj = new Array();
}
this.lobj.push(nm);
}
};
FISBaseClass.prototype.removeListener = function (nm) {
if (typeof(nm) == "string") {
if (this.lnames[nm] == nm) {
delete this.lnames[nm];
}
} else {
var i = 0;
while (i < this.lobj.length) {
if (this.lobj[i] == nm) {
this.lobj.splice(i, 1);
return;
}
i++;
}
}
};
FISBaseClass.prototype.notifyListeners = function (msg, val) {
var p = this.timeline;
var i;
var len;
for (i in this.lnames) {
p[this.lnames[i]].ieh(msg, val, this);
}
if (this.lobj != undefined) {
len = this.lobj.length;
i = 0;
while (i < len) {
this.lobj[i].ieh(msg, val, this);
i++;
}
}
};
Object.registerClass("FISBase", FISBaseClass);
#endinitclip
Symbol 36 MovieClip [frt_reset] Frame 1
#initclip 2
function frt_resetClass() {
super();
if (this.lname != "") {
this.addListener(this.lname);
}
this.act_angle = 0;
this.moveAngleBy(-130, 1);
}
frt_resetClass.prototype = new FISBaseClass();
frt_resetClass.prototype.moveToAngle = function (w) {
var ringmax = 116;
this.BasisB_mc._visible = w < 180;
this.BasisF_mc._visible = w >= 180;
this.Steg_mc._xscale = Math.cos(0.0175 * w) * 100;
this.Ring_mc._x = Math.cos(0.0175 * w) * ringmax;
};
frt_resetClass.prototype.move_up = function (up) {
if (up) {
this._y = this._y - this.move_y;
} else {
this._y = this._y + this.move_y;
}
};
frt_resetClass.prototype.moveAngleBy = function (delta, steps) {
if (delta > 0) {
this.act_step = 0;
this.end_step = steps;
this.direction = 1;
} else {
this.act_step = steps + 1;
this.end_step = 1;
this.direction = -1;
}
this.step_angle = delta / steps;
this.onEnterframe = function () {
this.act_step = this.act_step + this.direction;
this.act_angle = ((this.act_angle + this.step_angle) + 360) % 360;
this.moveToAngle(this.act_angle);
if (this.act_step == this.end_step) {
this.onEnterframe = undefined;
}
};
};
Object.registerClass("frt_reset", frt_resetClass);
#endinitclip
Symbol 44 MovieClip Frame 1
stop();
Symbol 45 MovieClip [frt_crank] Frame 1
#initclip 3
function frt_crankClass() {
super();
if (this.lname != "") {
this.addListener(this.lname);
}
this.act_angle = 0;
this.StatePlus = true;
this.btn_up.onRelease = this.sendBtnUpMessage;
this.btn_down.onRelease = this.sendBtnDownMessage;
this.klick = new Sound();
this.klick.attachSound("crankcklick");
}
frt_crankClass.prototype = new FISBaseClass();
frt_crankClass.prototype.sendBtnUpMessage = function () {
this._parent.notifyListeners(this._parent.emsg, "btn_up");
};
frt_crankClass.prototype.sendBtnDownMessage = function () {
this._parent.notifyListeners(this._parent.emsg, "btn_down");
};
frt_crankClass.prototype.moveToAngle = function (w) {
var knobmax = 65;
this.BasisB_mc._visible = w >= 180;
this.BasisF_mc._visible = w < 180;
this.Steg_mc._xscale = Math.cos(0.0175 * w) * 100;
this.knob_mc._x = Math.cos(0.0175 * w) * knobmax;
};
frt_crankClass.prototype.moveAngleBy = function (Delta, Steps) {
if (tar > 0) {
this.act_step = 0;
this.end_step = steps;
this.direction = 1;
} else {
this.act_step = steps + 1;
this.end_step = 1;
this.direction = -1;
}
this.step_angle = Delta / Steps;
this.onEnterframe = function () {
this.act_step = this.act_step + this.direction;
this.act_angle = ((this.act_angle + (this.step_angle * this.direction)) + 360) % 360;
this.moveToAngle(this.act_angle);
if (this.act_step == this.end_step) {
this.onEnterframe = undefined;
}
};
};
frt_crankClass.prototype.show_buttons = function (vis) {
if (vis) {
this.btn_down._visible = !this.StatePlus;
this.btn_up._visible = this.StatePlus;
} else {
this.btn_down._visible = false;
this.btn_up._visible = false;
}
};
frt_crankClass.prototype.move_up = function (up) {
if (up) {
this._y = this._y - this.move_y;
this.StatePlus = false;
} else {
this._y = this._y + this.move_y;
this.StatePlus = true;
}
this.klick.start();
};
Object.registerClass("frt_crank", frt_crankClass);
#endinitclip
Symbol 53 MovieClip [bak_slider] Frame 1
#initclip 4
function bak_SliderClass() {
super();
if (this.lname != "") {
this.addListener(this.lname);
}
this.gut.onPress = this.gutPress;
this.gut.useHandCursor = false;
this.resetBounds();
this.setVal(this.val, true);
this.ind.onPress = this.handleDrag;
this.ind.onRelease = this.handleStopDrag;
this.ind.onReleaseOutside = this.handleStopDrag;
this.ind.gotoAndStop(this.btnNr);
this.useHandCursor = this.showHand;
this.klick = new Sound();
this.klick.attachSound("inputClick");
}
bak_SliderClass.prototype = new FISBaseClass();
bak_SliderClass.prototype.gutPress = function () {
this._parent.sliderClickHandle(this._parent._ymouse);
};
bak_SliderClass.prototype.mouseDrag = function () {
this._parent.sliderClickHandle(this._parent._ymouse + this.indOffset);
updateAfterEvent();
};
bak_SliderClass.prototype.handleDrag = function () {
this.indOffset = this._parent.ind._y - this._parent._ymouse;
this.onMouseMove = this._parent.mouseDrag;
};
bak_SliderClass.prototype.handleStopDrag = function () {
this.onMouseMove = undefined;
};
bak_SliderClass.prototype.sliderClickHandle = function (m) {
var click;
var sRange;
click = m - this.topPos;
sRange = this.botPos - this.topPos;
if (click < 0) {
click = 0;
} else if (click > sRange) {
click = sRange;
}
this.setVal(this.minVal + (this.valRange * (click / sRange)));
};
bak_SliderClass.prototype.setVal = function (v, quiet) {
var ov = this.val;
if (v < this.minVal) {
v = this.minVal;
} else if (v > this.maxVal) {
v = this.maxVal;
}
if (this.discreteSteps) {
var divSize = ((this.maxVal - this.minVal) / this.numDivs);
v = this.minVal + (divSize * Math.round((v - this.minVal) / divSize));
}
var new_y = (this.topPos + (((this.botPos - this.topPos) * (v - this.minVal)) / this.valRange));
this.ind._y = new_y;
this.noind._y = new_y;
this.val = v;
this.digit.digit_txt.text = v;
if (v != ov) {
this.klick.start();
if (quiet != true) {
this.notifyListeners(this.emsg, v == 0);
}
}
};
bak_SliderClass.prototype.getVal = function () {
return(this.val);
};
bak_SliderClass.prototype.setNumDivs = function (nd) {
this.numDivs = nd;
this.resetBounds();
};
bak_SliderClass.prototype.setMinMaxVals = function (mn, mx) {
this.minVal = mn;
this.maxVal = mx;
this.resetBounds();
};
bak_SliderClass.prototype.resetBounds = function () {
this.topPos = this.gut._y - ((this.gut._height / 2) - (this.ind._height / 2));
this.botPos = this.gut._y + ((this.gut._height / 2) - (this.ind._height / 2));
this.valRange = this.maxVal - this.minVal;
};
bak_SliderClass.prototype.show_buttons = function (vis) {
this.ind._visible = vis;
this.noind._visible = !vis;
};
Object.registerClass("bak_Slider", bak_SliderClass);
#endinitclip
Symbol 60 MovieClip Frame 1
stop();
Symbol 61 MovieClip [top_crank] Frame 1
#initclip 5
function Top_CrankClass() {
super();
if (this.lname != "") {
this.addListener(this.lname);
}
this.btn.onRelease = this.sendBtnMessage;
}
Top_CrankClass.prototype = new FISBaseClass();
Top_CrankClass.prototype.sendBtnMessage = function () {
this._parent.notifyListeners(this._parent.emsg, "btn_start");
};
Top_CrankClass.prototype.moveAngleBy = function (delta, steps) {
this.act_step = 0;
this.end_step = steps;
this.step_angle = delta / steps;
this.onEnterframe = function () {
this.act_step++;
this.top_crank_gr_mc._rotation = this.top_crank_gr_mc._rotation + this.step_angle;
this.notifyListeners(this.emsg, this.act_step);
if (this.act_step == this.end_step) {
this.notifyListeners(this.emsg, "atEnd");
this.onEnterframe = undefined;
}
};
};
Top_CrankClass.prototype.show_buttons = function (vis) {
this.btn._visible = vis;
};
Object.registerClass("Top_Crank", Top_CrankClass);
#endinitclip
Symbol 65 MovieClip Frame 1
stop();
Symbol 68 MovieClip [top_reset] Frame 1
#initclip 6
function top_resetClass() {
super();
if (this.lname != "") {
this.addListener(this.lname);
}
this.top_reset_gr_mc.btn_l.onRelease = this.sendBtnLMessage;
this.top_reset_gr_mc.btn_r.onRelease = this.sendBtnRMessage;
this.top_reset_gr_mc._rotation = -125;
this.ResetAtStart = false;
}
top_resetClass.prototype = new FISBaseClass();
top_resetClass.prototype.sendBtnLMessage = function () {
var resetMsg;
if (this._parent._parent.ResetAtStart) {
resetMsg = "btn_CountL";
} else {
resetMsg = "btn_ResultL";
}
this._parent._parent.notifyListeners(this._parent._parent.emsg, resetMsg);
this._parent._parent.ResetAtStart = !this._parent._parent.ResetAtStart;
};
top_resetClass.prototype.sendBtnRMessage = function () {
var resetMsg;
if (this._parent._parent.ResetAtStart) {
resetMsg = "btn_ResultR";
} else {
resetMsg = "btn_CountR";
}
this._parent._parent.notifyListeners(this._parent._parent.emsg, resetMsg);
this._parent._parent.ResetAtStart = !this._parent._parent.ResetAtStart;
};
top_resetClass.prototype.show_buttons = function (vis) {
this.top_reset_gr_mc.btn_l._visible = vis;
this.top_reset_gr_mc.btn_r._visible = vis;
};
top_resetClass.prototype.moveAngleBy = function (delta, Steps, silent) {
if (delta > 0) {
this.act_step = 0;
this.end_step = steps;
this.direction = 1;
} else {
this.act_step = steps + 1;
this.end_step = 1;
this.direction = -1;
}
this.step_angle = delta / steps;
this.onEnterframe = function () {
this.act_step = this.act_step + this.direction;
this.top_reset_gr_mc._rotation = this.top_reset_gr_mc._rotation + this.step_angle;
if (!silent) {
this.notifyListeners(this.emsg, this.act_step);
}
if (this.act_step == this.end_step) {
if (!silent) {
this.notifyListeners(this.emsg, "atEnd");
}
this.onEnterframe = undefined;
}
};
};
Object.registerClass("top_reset", top_resetClass);
#endinitclip
Symbol 73 MovieClip [top_carriage] Frame 1
#initclip 7
function Top_carriageClass() {
super();
if (this.lname != "") {
this.addListener(this.lname);
}
this.klick = new Sound();
this.klick.attachSound("numberClick");
this.resetklick = new Sound();
this.resetklick.attachSound("resetClick");
}
Top_carriageClass.prototype = new FISBaseClass();
Top_carriageClass.prototype.moveAngleBy = function (delta, steps) {
this.act_step = 0;
this.end_step = steps;
this.step_angle = delta / steps;
this.onEnterframe = function () {
this.act_step++;
this._rotation = this._rotation + this.step_angle;
if (this.act_step == this.end_step) {
this.onEnterframe = undefined;
}
};
};
Top_carriageClass.prototype.SetCountDigit = function (vec, digit, sound) {
var char = vec[digit - 1];
if (char == "-") {
char = "0";
}
if (this["c" + digit].txt.text != char) {
if (sound == "reset") {
this.resetklick.start();
} else {
this.klick.start();
}
}
this["c" + digit].txt.text = char;
};
Top_carriageClass.prototype.SetResultDigit = function (vec, digit, sound) {
var char = vec[digit - 1];
if (char == "-") {
char = "0";
}
if (this["r" + digit].txt.text != char) {
if (sound == "reset") {
this.resetklick.start();
} else {
this.klick.start();
}
}
this["r" + digit].txt.text = char;
};
Object.registerClass("Top_carriage", Top_carriageClass);
#endinitclip
Symbol 94 MovieClip [pan_input] Frame 1
#initclip 8
function Pan_inputClass() {
super();
if (this.lname != "") {
this.addListener(this.lname);
}
this.subArrows_mc._visible = false;
this.decrArrow_mc._visible = false;
}
Pan_inputClass.prototype = new FISBaseClass();
Pan_inputClass.prototype.ShowIncr = function (sh) {
this.incrArrow_mc._visible = sh;
this.decrArrow_mc._visible = !sh;
};
Pan_inputClass.prototype.ShowAdd = function (sh) {
this.addArrows_mc._visible = sh;
this.subArrows_mc._visible = !sh;
};
Pan_inputClass.prototype.ValueToDisplay = function (vec) {
var alpha;
digit = 1;
while (digit <= 8) {
var char = vec[digit - 1];
if (char == "-") {
char = "0";
alpha = 20;
} else {
alpha = 100;
}
this["d" + digit].text = char;
this["d" + digit]._alpha = alpha;
digit++;
}
};
Object.registerClass("Pan_input", Pan_inputClass);
#endinitclip
Symbol 115 MovieClip [pan_carriage] Frame 1
#initclip 9
function pan_carriageClass() {
super();
if (this.lname != "") {
this.addListener(this.lname);
}
this.act_offset = 0;
this.delta = 15;
this.btn_l.onRelease = this.sendStartLMessage;
this.btn_r.onRelease = this.sendStartRMessage;
}
pan_carriageClass.prototype = new FISBaseClass();
pan_carriageClass.prototype.moveOneStep = function (dir, Steps) {
this.act_offset = this.act_offset + dir;
this.act_step = 0;
this.end_step = steps;
this.stepX = this.delta / Steps;
this.onEnterframe = function () {
this.act_step++;
this._x = this._x + (this.stepX * dir);
if (this.act_step == this.end_step) {
this.onEnterframe = undefined;
}
};
};
pan_carriageClass.prototype.SetCountDigit = function (vec, digit) {
var alpha;
var char = vec[digit - 1];
if (char == "-") {
char = "0";
alpha = 20;
} else {
alpha = 100;
}
this["c" + digit].text = char;
this["c" + digit]._alpha = alpha;
};
pan_carriageClass.prototype.SetResultDigit = function (vec, digit) {
var alpha;
var char = vec[digit - 1];
if (char == "-") {
char = "0";
alpha = 20;
} else {
alpha = 100;
}
this["r" + digit].text = char;
this["r" + digit]._alpha = alpha;
};
Object.registerClass("pan_carriage", pan_carriageClass);
#endinitclip
Symbol 142 MovieClip Frame 1
stop();
Symbol 151 MovieClip Frame 1
stop();
Symbol 152 MovieClip [frt_slider] Frame 1
#initclip 10
function Frt_SliderClass() {
super();
if (this.lname != "") {
this.addListener(this.lname);
}
this.gut.onPress = this.gutPress;
this.gut.useHandCursor = false;
this.resetBounds();
this.setVal(this.val, true);
this.ind.onPress = this.handleDrag;
this.ind.onRelease = this.handleStopDrag;
this.ind.onReleaseOutside = this.handleStopDrag;
this.ind.gotoAndStop(this.btnNr);
this.noind.gotoAndStop(this.btnNr);
this.useHandCursor = this.showHand;
this.klick = new Sound();
this.klick.attachSound("inputClick");
}
Frt_SliderClass.prototype = new FISBaseClass();
Frt_SliderClass.prototype.gutPress = function () {
this._parent.sliderClickHandle(this._parent._ymouse);
};
Frt_SliderClass.prototype.mouseDrag = function () {
this._parent.sliderClickHandle(this._parent._ymouse + this.indOffset);
updateAfterEvent();
};
Frt_SliderClass.prototype.handleDrag = function () {
this.indOffset = this._parent.ind._y - this._parent._ymouse;
this.onMouseMove = this._parent.mouseDrag;
};
Frt_SliderClass.prototype.handleStopDrag = function () {
this.onMouseMove = undefined;
};
Frt_SliderClass.prototype.sliderClickHandle = function (m) {
var click;
var sRange;
click = m - this.topPos;
sRange = this.botPos - this.topPos;
if (click < 0) {
click = 0;
} else if (click > sRange) {
click = sRange;
}
this.setVal(this.minVal + (this.valRange * (click / sRange)));
};
Frt_SliderClass.prototype.setVal = function (v, quiet) {
var ov = this.val;
if (v < this.minVal) {
v = this.minVal;
} else if (v > this.maxVal) {
v = this.maxVal;
}
if (this.discreteSteps) {
var divSize = ((this.maxVal - this.minVal) / this.numDivs);
v = this.minVal + (divSize * Math.round((v - this.minVal) / divSize));
}
var new_y = (this.topPos + (((this.botPos - this.topPos) * (v - this.minVal)) / this.valRange));
this.ind._y = new_y;
this.noind._y = new_y;
this.val = v;
this.digit.digit_txt.text = v;
if (v != ov) {
this.klick.stop();
this.klick.start();
if (quiet != true) {
this.notifyListeners(this.emsg, v);
}
}
};
Frt_SliderClass.prototype.show_buttons = function (vis) {
this.ind._visible = vis;
this.noind._visible = !vis;
};
Frt_SliderClass.prototype.getVal = function () {
return(this.val);
};
Frt_SliderClass.prototype.setNumDivs = function (nd) {
this.numDivs = nd;
this.resetBounds();
};
Frt_SliderClass.prototype.setMinMaxVals = function (mn, mx) {
this.minVal = mn;
this.maxVal = mx;
this.resetBounds();
};
Frt_SliderClass.prototype.resetBounds = function () {
this.topPos = this.gut._y - ((this.gut._height / 2) - (this.ind._height / 2));
this.botPos = this.gut._y + ((this.gut._height / 2) - (this.ind._height / 2));
this.valRange = this.maxVal - this.minVal;
};
Object.registerClass("Frt_Slider", Frt_SliderClass);
#endinitclip
Symbol 153 MovieClip Frame 1
function handleBSliderMsg(same) {
Curta.count_same = same;
updateIncrDecr();
}
function updateIncrDecr() {
var CountIncr;
if (Curta.count_same) {
CountIncr = !Curta.Crank_up;
} else {
CountIncr = Curta.Crank_up;
}
pan_input_mc.ShowIncr(CountIncr);
if (CountIncr) {
Curta.count_step = 1;
} else {
Curta.count_step = -1;
}
}
function handleFSliderMsg() {
setInputData(get_input_value());
pan_input_mc.ValueToDisplay(curta.input_vec);
}
function handleTResetMsg(val) {
switch (val) {
case "btn_CountR" :
curta.act_reset = "counter";
setCounterData(0);
startReset(130, c_digits);
return;
case "btn_CountL" :
curta.act_reset = "counter";
setCounterData(0);
startReset(-130, c_digits);
return;
case "btn_ResultR" :
curta.act_reset = "result";
setResultData(0);
startReset(230, r_digits);
return;
case "btn_ResultL" :
curta.act_reset = "result";
setResultData(0);
startReset(-230, r_digits);
return;
case "atEnd" :
show_all_buttons();
frt_reset_mc.move_up(false);
frt_carriage_mc.move_up(false);
return;
default :
if (curta.act_reset == "result") {
pan_carriage_mc.SetResultDigit(Curta.result_vec, val);
top_carriage_mc.SetResultDigit(Curta.result_vec, val, "reset");
} else {
pan_carriage_mc.SetCountDigit(Curta.count_vec, val);
top_carriage_mc.SetCountDigit(Curta.count_vec, val, "reset");
}
}
}
function setCounterData(val) {
curta.count_num = val;
curta.count_vec = numberToInvVector(curta.count_num, c_digits);
}
function setResultData(val) {
curta.result_num = val;
curta.result_vec = numberToInvVector(curta.result_num, r_digits);
}
function setInputData(val) {
curta.input_num = val;
curta.input_vec = numberToInvVector(curta.input_num, i_digits);
}
function startReset(delta, steps) {
top_reset_mc.moveAngleBy(delta, steps, false);
frt_reset_mc.moveAngleBy(delta, steps);
hide_all_buttons();
frt_reset_mc.move_up(true);
frt_carriage_mc.move_up(true);
}
function handleTCrankMsg(val) {
switch (val) {
case "btn_start" :
top_crank_mc.moveAngleBy(360, 17);
frt_crank_mc.moveAngleBy(360, 17);
do_calculation();
hide_all_buttons();
return;
case "atEnd" :
show_all_buttons();
return;
default :
if (val <= r_digits) {
pan_carriage_mc.SetResultDigit(curta.result_vec, val);
top_carriage_mc.SetResultDigit(curta.result_vec, val);
} else {
pan_carriage_mc.SetCountDigit(curta.Count_vec, val - r_digits);
top_carriage_mc.SetCountDigit(curta.Count_vec, val - r_digits);
}
}
}
function handleFCarriageMsg(val) {
switch (val) {
case "btn_R" :
hide_all_buttons();
frt_carriage_mc.move_up(true);
frt_reset_mc.move_up(true);
frt_carriage_mc.moveOneStep(1, 10);
pan_carriage_mc.moveOneStep(1, 10);
top_carriage_mc.moveAngleBy(-20, 10);
top_reset_mc.moveAngleBy(-20, 10, true);
frt_reset_mc.moveAngleBy(-20, 10);
Curta.carr_offset++;
return;
case "btn_L" :
hide_all_buttons();
frt_carriage_mc.move_up(true);
frt_reset_mc.move_up(true);
frt_carriage_mc.moveOneStep(-1, 10);
pan_carriage_mc.moveOneStep(-1, 10);
top_carriage_mc.moveAngleBy(20, 10);
top_reset_mc.moveAngleBy(20, 10, true);
frt_reset_mc.moveAngleBy(20, 10);
Curta.carr_offset--;
return;
case "atEnd" :
frt_carriage_mc.move_up(false);
frt_reset_mc.move_up(false);
show_all_buttons();
}
}
function handleFCrankMsg(val) {
switch (val) {
case "btn_up" :
Curta.Crank_up = true;
frt_crank_mc.move_up(true);
pan_input_mc.ShowAdd(false);
set_buttons_visible(true);
break;
case "btn_down" :
Curta.Crank_up = false;
frt_crank_mc.move_up(false);
pan_input_mc.ShowAdd(true);
set_buttons_visible(true);
}
updateIncrDecr();
}
function do_calculation() {
var mul = math.pow(10, curta.carr_offset);
var resultgw = math.pow(10, r_digits);
var countgw = math.pow(10, c_digits);
if (Curta.Crank_up) {
curta.result_num = curta.result_num - (curta.input_num * mul);
} else {
curta.result_num = curta.result_num + (curta.input_num * mul);
}
curta.result_num = curta.result_num % resultgw;
if (curta.result_num < 0) {
curta.result_num = curta.result_num + resultgw;
trace("curta.result_num: " + curta.result_num);
}
setResultData(curta.result_num % resultgw);
curta.count_num = curta.count_num + (mul * Curta.count_step);
if (curta.count_num < 0) {
curta.count_num = curta.count_num + countgw;
}
setCounterData(curta.count_num % countgw);
}
function show_all_buttons() {
timer_id = setInterval(set_buttons_visible, 300, true);
}
function hide_all_buttons() {
set_buttons_visible(false);
}
function set_buttons_visible(vis) {
var n;
if (vis) {
clearInterval(timer_id);
}
top_reset_mc.show_buttons(vis);
top_crank_mc.show_buttons(vis);
frt_carriage_mc.show_buttons(vis);
frt_crank_mc.show_buttons(vis);
pan_carriage_mc.show_buttons(vis);
bak_slider_mc.show_buttons(vis);
frt_slider1_mc.show_buttons(vis);
frt_slider2_mc.show_buttons(vis);
frt_slider3_mc.show_buttons(vis);
frt_slider4_mc.show_buttons(vis);
frt_slider5_mc.show_buttons(vis);
frt_slider6_mc.show_buttons(vis);
frt_slider7_mc.show_buttons(vis);
frt_slider8_mc.show_buttons(vis);
}
function get_input_value() {
var value = 0;
n = 1;
while (n <= i_digits) {
value = value + (this[("frt_slider" + n) + "_mc"].getVal() * math.pow(10, n - 1));
n++;
}
return(value);
}
function init() {
set_buttons_visible(true);
pan_input_mc.ValueToDisplay(curta.input_vec);
n = 0;
while (n <= r_digits) {
pan_carriage_mc.SetResultDigit(Curta.result_vec, n);
top_carriage_mc.SetResultDigit(Curta.result_vec, n);
n++;
}
n = 0;
while (n <= c_digits) {
pan_carriage_mc.SetCountDigit(Curta.count_vec, n);
top_carriage_mc.SetCountDigit(Curta.count_vec, n);
n++;
}
}
function numberToInvVector(number, digits) {
var s;
var n;
var char;
var vec = new Array(digits);
s = "00000000000" + number.toString();
s = s.slice(-digits);
var trailing = true;
n = digits;
while (n > 0) {
char = s.charAt(digits - n);
if (((char == "0") && (n != 1)) && (trailing)) {
char = "-";
} else {
trailing = false;
}
vec[n - 1] = char;
n--;
}
return(vec);
}
r_digits = 11;
c_digits = 6;
i_digits = 8;
Curta = new Object();
Curta.input_num = 0;
Curta.input_vec = numberToInvVector(Curta.input_num, i_digits);
Curta.count_num = 0;
Curta.count_vec = numberToInvVector(Curta.count_num, c_digits);
Curta.Result_num = 0;
Curta.Result_vec = numberToInvVector(Curta.Result_num, r_digits);
Curta.Crank_up = false;
Curta.count_same = true;
Curta.count_step = 1;
Curta.carr_offset = 0;
Curta.act_reset = "";
init();
CurtaCntrl = new Object();
CurtaCntrl.ieh = function (msg, val, whosent) {
switch (msg) {
case "TCrankMsg" :
handleTCrankMsg(val);
return;
case "TResetMsg" :
handleTResetMsg(val);
return;
case "FCarriageMsg" :
handleFCarriageMsg(val);
return;
case "FCrankMsg" :
handleFCrankMsg(val);
return;
case "FSliderMsg" :
handleFSliderMsg();
return;
case "BSliderMsg" :
handleBSliderMsg(val);
}
};
Instance of Symbol 115 MovieClip [pan_carriage] "pan_carriage_mc" in Symbol 153 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
lname = "CurtaCntrl";
emsg = "FCarriageMsg";
}
Instance of Symbol 94 MovieClip [pan_input] "pan_input_mc" in Symbol 153 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
lname = "curtaCntrl";
}
Instance of Symbol 73 MovieClip [top_carriage] "top_carriage_mc" in Symbol 153 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
lname = "curtacntl";
}
Instance of Symbol 68 MovieClip [top_reset] "top_reset_mc" in Symbol 153 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
lname = "CurtaCntrl";
emsg = "TResetMsg";
}
Instance of Symbol 61 MovieClip [top_crank] "top_crank_mc" in Symbol 153 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
lname = "CurtaCntrl";
emsg = "TCrankMsg";
steps = 17;
}
Instance of Symbol 53 MovieClip [bak_slider] "bak_slider_mc" in Symbol 153 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
lname = "CurtaCntrl";
emsg = "BSliderMsg";
val = 0;
minVal = 0;
maxVal = 1;
discreteSteps = true;
numDivs = 1;
showHand = true;
}
Instance of Symbol 152 MovieClip [frt_slider] "frt_slider1_mc" in Symbol 153 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
lname = "CurtaCntrl";
emsg = "FSliderMsg";
val = 0;
minVal = 0;
maxVal = 9;
discreteSteps = true;
numDivs = 9;
showHand = true;
BtnNr = 1;
}
Instance of Symbol 152 MovieClip [frt_slider] "frt_slider2_mc" in Symbol 153 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
lname = "CurtaCntrl";
emsg = "FSliderMsg";
val = 0;
minVal = 0;
maxVal = 9;
discreteSteps = true;
numDivs = 9;
showHand = true;
BtnNr = 2;
}
Instance of Symbol 152 MovieClip [frt_slider] "frt_slider3_mc" in Symbol 153 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
lname = "CurtaCntrl";
emsg = "FSliderMsg";
val = 0;
minVal = 0;
maxVal = 9;
discreteSteps = true;
numDivs = 9;
showHand = true;
BtnNr = 3;
}
Instance of Symbol 152 MovieClip [frt_slider] "frt_slider4_mc" in Symbol 153 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
lname = "CurtaCntrl";
emsg = "FSliderMsg";
val = 0;
minVal = 0;
maxVal = 9;
discreteSteps = true;
numDivs = 9;
showHand = true;
BtnNr = 4;
}
Instance of Symbol 152 MovieClip [frt_slider] "frt_slider5_mc" in Symbol 153 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
lname = "CurtaCntrl";
emsg = "FSliderMsg";
val = 0;
minVal = 0;
maxVal = 9;
discreteSteps = true;
numDivs = 9;
showHand = true;
BtnNr = 5;
}
Instance of Symbol 152 MovieClip [frt_slider] "frt_slider6_mc" in Symbol 153 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
lname = "CurtaCntrl";
emsg = "FSliderMsg";
val = 0;
minVal = 0;
maxVal = 9;
discreteSteps = true;
numDivs = 9;
showHand = true;
BtnNr = 6;
}
Instance of Symbol 152 MovieClip [frt_slider] "frt_slider7_mc" in Symbol 153 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
lname = "CurtaCntrl";
emsg = "FSliderMsg";
val = 0;
minVal = 0;
maxVal = 9;
discreteSteps = true;
numDivs = 9;
showHand = true;
BtnNr = 7;
}
Instance of Symbol 152 MovieClip [frt_slider] "frt_slider8_mc" in Symbol 153 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
lname = "CurtaCntrl";
emsg = "FSliderMsg";
val = 0;
minVal = 0;
maxVal = 9;
discreteSteps = true;
numDivs = 9;
showHand = true;
BtnNr = 8;
}
Instance of Symbol 45 MovieClip [frt_crank] "frt_crank_mc" in Symbol 153 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
Lname = "CurtaCntrl";
emsg = "FCrankMsg";
move_y = 10;
}
Instance of Symbol 36 MovieClip [frt_reset] "frt_reset_mc" in Symbol 153 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
lname = "---";
move_y = 10;
}
Instance of Symbol 25 MovieClip [frt_carriage] "frt_carriage_mc" in Symbol 153 MovieClip Frame 1
//component parameters
onClipEvent (initialize) {
lname = "CurtaCntrl";
emsg = "FCarriageMsg";
move_y = 10;
}