Frame 1
function calcTime() {
if (isNaN(Number(classes_txt.text))) {
classes_txt.text = "0";
}
if (isNaN(Number(studying_txt.text))) {
studying_txt.text = "0";
}
if (isNaN(Number(sleep_txt.text))) {
sleep_txt.text = "0";
}
if (isNaN(Number(exercise_txt.text))) {
exercise_txt.text = "0";
}
if (isNaN(Number(work_txt.text))) {
work_txt.text = "0";
}
if (isNaN(Number(family_txt.text))) {
family_txt.text = "0";
}
if (isNaN(Number(personal_txt.text))) {
personal_txt.text = "0";
}
if (isNaN(Number(meal_txt.text))) {
meal_txt.text = "0";
}
if (isNaN(Number(trans_txt.text))) {
trans_txt.text = "0";
}
if (isNaN(Number(relaxing_txt.text))) {
relaxing_txt.text = "0";
}
if (isNaN(Number(social_txt.text))) {
social_txt.text = "0";
}
if (isNaN(Number(other_txt.text))) {
other_txt.text = "0";
}
allTime = ((((((((((Number(classes_txt.text) + Number(studying_txt.text)) + Number(sleep_txt.text)) + Number(exercise_txt.text)) + Number(work_txt.text)) + Number(family_txt.text)) + Number(personal_txt.text)) + Number(meal_txt.text)) + Number(trans_txt.text)) + Number(relaxing_txt.text)) + Number(social_txt.text)) + Number(other_txt.text);
if (allTime == 0) {
_root.chart_mc.gotoAndStop(Number(allTime + 1));
} else {
tempTime = Math.round(Number(allTime));
_root.chart_mc.gotoAndStop(tempTime);
}
time_txt.text = 24 - Number(allTime);
txtClockText.text = "Hours Remaining";
}
stop();
var KeyListener = new Object();
KeyListener.onKeyDown = function () {
if (Key.isDown(9)) {
trace("The tab key was pressed.");
calcTime();
}
};
Key.addListener(KeyListener);
var MouseListener = new Object();
MouseListener.onMouseUp = function () {
trace("The mouse was clicked.");
calcTime();
};
Mouse.addListener(MouseListener);
classes_txt.onChanged = function () {
classes_txt.maxChars = 6;
if ((Key.getAscii() == 46) && (this.text.length <= 1)) {
this.text = ".";
} else if (isNaN(classes_txt.text)) {
classes_txt.text = eval("NULL");
} else {
calcTime();
}
};
studying_txt.onChanged = function () {
studying_txt.maxChars = 6;
if ((Key.getAscii() == 46) && (this.text.length <= 1)) {
this.text = ".";
} else if (isNaN(studying_txt.text)) {
studying_txt.text = eval("NULL");
} else {
calcTime();
}
};
sleep_txt.onChanged = function () {
sleep_txt.maxChars = 6;
if ((Key.getAscii() == 46) && (this.text.length <= 1)) {
this.text = ".";
} else if (isNaN(sleep_txt.text)) {
sleep_txt.text = eval("NULL");
} else {
calcTime();
}
};
exercise_txt.onChanged = function () {
exercise_txt.maxChars = 6;
if ((Key.getAscii() == 46) && (this.text.length <= 1)) {
this.text = ".";
} else if (isNaN(exercise_txt.text)) {
exercise_txt.text = eval("NULL");
} else {
calcTime();
}
};
work_txt.onChanged = function () {
work_txt.maxChars = 6;
if ((Key.getAscii() == 46) && (this.text.length <= 1)) {
this.text = ".";
} else if (isNaN(work_txt.text)) {
work_txt.text = eval("NULL");
} else {
calcTime();
}
};
family_txt.onChanged = function () {
family_txt.maxChars = 6;
if ((Key.getAscii() == 46) && (this.text.length <= 1)) {
this.text = ".";
} else if (isNaN(family_txt.text)) {
family_txt.text = eval("NULL");
} else {
calcTime();
}
};
personal_txt.onChanged = function () {
personal_txt.maxChars = 6;
if ((Key.getAscii() == 46) && (this.text.length <= 1)) {
this.text = ".";
} else if (isNaN(personal_txt.text)) {
personal_txt.text = eval("NULL");
} else {
calcTime();
}
};
meal_txt.onChanged = function () {
meal_txt.maxChars = 6;
if ((Key.getAscii() == 46) && (this.text.length <= 1)) {
this.text = ".";
} else if (isNaN(meal_txt.text)) {
meal_txt.text = eval("NULL");
} else {
calcTime();
}
};
trans_txt.onChanged = function () {
trans_txt.maxChars = 6;
if ((Key.getAscii() == 46) && (this.text.length <= 1)) {
this.text = ".";
} else if (isNaN(trans_txt.text)) {
trans_txt.text = eval("NULL");
} else {
calcTime();
}
};
relaxing_txt.onChanged = function () {
relaxing_txt.maxChars = 6;
if ((Key.getAscii() == 46) && (this.text.length <= 1)) {
this.text = ".";
} else if (isNaN(relaxing_txt.text)) {
relaxing_txt.text = eval("NULL");
} else {
calcTime();
}
};
social_txt.onChanged = function () {
social_txt.maxChars = 6;
if ((Key.getAscii() == 46) && (this.text.length <= 1)) {
this.text = ".";
} else if (isNaN(social_txt.text)) {
social_txt.text = eval("NULL");
} else {
calcTime();
}
};
other_txt.onChanged = function () {
other_txt.maxChars = 6;
if ((Key.getAscii() == 46) && (this.text.length <= 1)) {
this.text = ".";
} else if (isNaN(other_txt.text)) {
other_txt.text = eval("NULL");
} else {
calcTime();
}
};
Symbol 46 MovieClip Frame 1
stop();