Frame 1
function getHoursAmPm(hour24) {
var _local2 = new Object();
_local2.ampm = ((hour24 < 12) ? "AM" : "PM");
var _local1 = hour24 % 12;
if (_local1 == 0) {
_local1 = 12;
}
_local2.hours = _local1;
return(_local2);
}
function myOnKeyDown() {
if (Key.getCode() == 32) {
stopAllSounds();
_root.alarmstatus = "off";
_root.alarmstatusbox.text = "Alarm: OFF";
_root.turnoffalarm._visible = false;
_root.alarmtxtbg._visible = true;
_root.ringing._visible = false;
_root.slidesetting.gotoAndPlay(7);
_root.stoptestbutton._visible = false;
_root.testbutton._visible = true;
}
}
_global.resetHelpTxt = function () {
_root.helptxt.text = "This is the Help Text area. Move your mouse over various controls of the alarm clock to view helpful information.";
};
var myListener = new Object();
myListener.onKeyDown = myOnKeyDown;
Key.addListener(myListener);
_root.turnoffalarm._visible = false;
_root.alarmsoundid = "";
_root.stoptestbutton._visible = false;
_root.slidesetting._visible = false;
_root.ringing._visible = false;
_root.designpage._visible = false;
_root.onEnterFrame = function () {
var _local3 = new Date();
var _local4 = getHoursAmPm(_local3.getHours());
_root.curhr.text = _local4.hours;
_root.curmn.text = _local3.getMinutes();
_root.cursc.text = _local3.getSeconds();
_root.curampm.text = _local4.ampm;
if (_root.hrdrag) {
if ((_root._xmouse > _root.oldx) or (_root._ymouse < _root.oldy)) {
newvalue = Number(_root.almhr.text) + 1;
if (newvalue > 12) {
newvalue = 1;
}
_root.almhr.text = newvalue;
}
if ((_root._xmouse < _root.oldx) or (_root._ymouse > _root.oldy)) {
newvalue = Number(_root.almhr.text) - 1;
if (newvalue < 1) {
newvalue = 12;
}
_root.almhr.text = newvalue;
}
_root.oldx = _root._xmouse;
}
if (_root.mndrag) {
if ((_root._xmouse > _root.oldx) or (_root._ymouse < _root.oldy)) {
newvalue = Number(_root.almmn.text) + 1;
if (newvalue > 59) {
newvalue = 0;
}
_root.almmn.text = newvalue;
}
if ((_root._xmouse < _root.oldx) or (_root._ymouse > _root.oldy)) {
newvalue = Number(_root.almmn.text) - 1;
if (newvalue < 0) {
newvalue = 59;
}
_root.almmn.text = newvalue;
}
_root.oldx = _root._xmouse;
}
if (_root.scdrag) {
if ((_root._xmouse > _root.oldx) or (_root._ymouse < _root.oldy)) {
newvalue = Number(_root.almsc.text) + 1;
if (newvalue > 59) {
newvalue = 0;
}
_root.almsc.text = newvalue;
}
if ((_root._xmouse < _root.oldx) or (_root._ymouse > _root.oldy)) {
newvalue = Number(_root.almsc.text) - 1;
if (newvalue < 0) {
newvalue = 59;
}
_root.almsc.text = newvalue;
}
_root.oldx = _root._xmouse;
}
if (_root.alarmstatus == "on") {
if ((((_root.curhr.text == _root.basealmhr) && (_root.curmn.text == _root.basealmmn)) && (_root.cursc.text == _root.basealmsc)) && (_root.curampm.text == _root.basealmampm)) {
var _local2 = new Sound();
if (_root.alarmsoundid == "") {
_root.alarmsoundid = "alarmsound1";
}
_local2.attachSound(alarmsoundid);
_local2.setVolume(500);
_local2.onSoundComplete = function () {
stopAllSounds();
_root.alarmstatus = "off";
_root.alarmstatusbox.text = "Alarm: OFF";
_root.turnoffalarm._visible = false;
_root.alarmtxtbg._visible = true;
_root.slidesetting.gotoAndPlay(7);
_root.ringing._visible = false;
_root.stoptestbutton._visible = false;
_root.testbutton._visible = true;
};
_local2.start(0, 30);
_root.alarmstatus = "off";
_root.ringing._visible = true;
}
}
};
_root.designpage._visible = false;
Instance of Symbol 38 MovieClip "slidesetting" in Frame 1
on (rollOver) {
_root.helptxt.text = "This area shows when the alarm will be triggered.";
}
on (rollOut) {
resetHelpTxt();
}
Symbol 11 Button
on (press) {
if ((Number(_root.curmn.text) + 15) > 59) {
newhr = true;
} else {
newhr = false;
}
if ((_root.curhr.text == "11") && (newhr)) {
if (_root.curampm.text == "AM") {
_root.almampm.text = "PM";
} else {
_root.almampm.text = "AM";
}
} else {
_root.almampm.text = _root.curampm.text;
}
if ((_root.curhr.text == "12") && (newhr)) {
_root.almhr.text = "1";
} else if (newhr) {
_root.almhr.text = Number(_root.curhr.text) + 1;
} else {
_root.almhr.text = _root.curhr.text;
}
_root.almsc.text = _root.cursc.text;
if (newhr) {
_root.almmn.text = (Number(_root.curmn.text) + 15) - 60;
} else {
_root.almmn.text = Number(_root.curmn.text) + 15;
}
}
on (rollOver) {
_root.helptxt.text = "This quickly adjusts alarm time to 15 minutes from the current time. Remember, you still must press the Set Alarm button.";
}
on (rollOut) {
resetHelpTxt();
}
Symbol 13 Button
on (press) {
if ((Number(_root.curmn.text) + 30) > 59) {
newhr = true;
} else {
newhr = false;
}
if ((_root.curhr.text == "11") && (newhr)) {
if (_root.curampm.text == "AM") {
_root.almampm.text = "PM";
} else {
_root.almampm.text = "AM";
}
} else {
_root.almampm.text = _root.curampm.text;
}
if ((_root.curhr.text == "12") && (newhr)) {
_root.almhr.text = "1";
} else if (newhr) {
_root.almhr.text = Number(_root.curhr.text) + 1;
} else {
_root.almhr.text = _root.curhr.text;
}
_root.almsc.text = _root.cursc.text;
if (newhr) {
_root.almmn.text = (Number(_root.curmn.text) + 30) - 60;
} else {
_root.almmn.text = Number(_root.curmn.text) + 30;
}
}
on (rollOver) {
_root.helptxt.text = "This quickly adjusts alarm time to 30 minutes from the current time. Remember, you still must press the Set Alarm button.";
}
on (rollOut) {
resetHelpTxt();
}
Symbol 15 Button
on (press) {
if ((Number(_root.curmn.text) + 45) > 59) {
newhr = true;
} else {
newhr = false;
}
if ((_root.curhr.text == "11") && (newhr)) {
if (_root.curampm.text == "AM") {
_root.almampm.text = "PM";
} else {
_root.almampm.text = "AM";
}
} else {
_root.almampm.text = _root.curampm.text;
}
if ((_root.curhr.text == "12") && (newhr)) {
_root.almhr.text = "1";
} else if (newhr) {
_root.almhr.text = Number(_root.curhr.text) + 1;
} else {
_root.almhr.text = _root.curhr.text;
}
_root.almsc.text = _root.cursc.text;
if (newhr) {
_root.almmn.text = (Number(_root.curmn.text) + 45) - 60;
} else {
_root.almmn.text = Number(_root.curmn.text) + 45;
}
}
on (rollOver) {
_root.helptxt.text = "This quickly adjusts alarm time to 45 minutes from the current time. Remember, you still must press the Set Alarm button.";
}
on (rollOut) {
resetHelpTxt();
}
Symbol 17 Button
on (press) {
if (_root.curhr.text == "11") {
if (_root.almampm.text == "AM") {
_root.almampm.text = "PM";
} else {
_root.almampm.text = "AM";
}
} else {
_root.almampm.text = _root.curampm.text;
}
if (_root.curhr.text == 12) {
_root.almhr.text = "1";
} else {
_root.almhr.text = Number(_root.curhr.text) + 1;
}
_root.almmn.text = _root.curmn.text;
_root.almsc.text = _root.cursc.text;
}
on (rollOver) {
_root.helptxt.text = "This quickly adjusts alarm time to 60 minutes from the current time. Remember, you still must press the Set Alarm button.";
}
on (rollOut) {
resetHelpTxt();
}
Symbol 24 Button
on (release) {
_root.almhr.text = _root.curhr.text;
_root.almsc.text = _root.cursc.text;
_root.almmn.text = _root.curmn.text;
_root.almampm.text = _root.curampm.text;
}
on (rollOver) {
_root.helptxt.text = "This quickly adjusts alarm time to the current time. This is simply to aid in setting the alarm.";
}
on (rollOut) {
resetHelpTxt();
}
Symbol 38 MovieClip Frame 1
stop();
Symbol 38 MovieClip Frame 6
stop();
Symbol 38 MovieClip Frame 11
_root.slidesetting._visible = false;
stop();
Symbol 49 Button
on (press) {
_root.hrdrag = true;
newvalue = Number(_root.almhr.text) + 1;
if (newvalue > 12) {
newvalue = 1;
}
_root.almhr.text = newvalue;
_root.oldx = _root._xmouse;
_root.oldy = _root._ymouse;
}
on (release) {
_root.hrdrag = false;
}
on (releaseOutside) {
_root.hrdrag = false;
}
on (rollOver) {
_root.helptxt.text = "Click this to increment the hour by 1 (one). Click and drag to quickly roll through hours.";
}
on (rollOut) {
resetHelpTxt();
}
Symbol 54 Button
on (press) {
_root.hrdrag = true;
newvalue = Number(_root.almhr.text) - 1;
if (newvalue < 1) {
newvalue = 12;
}
_root.almhr.text = newvalue;
_root.oldx = _root._xmouse;
_root.oldy = _root._ymouse;
}
on (release) {
_root.hrdrag = false;
}
on (releaseOutside) {
_root.hrdrag = false;
}
on (rollOver) {
_root.helptxt.text = "Click this to decrement the hour by 1 (one). Click and drag to quickly roll through hours.";
}
on (rollOut) {
resetHelpTxt();
}
Symbol 55 Button
on (press) {
_root.mndrag = true;
newvalue = Number(_root.almmn.text) + 1;
if (newvalue > 59) {
newvalue = 0;
}
_root.almmn.text = newvalue;
_root.oldx = _root._xmouse;
_root.oldy = _root._ymouse;
}
on (release) {
_root.mndrag = false;
}
on (releaseOutside) {
_root.mndrag = false;
}
on (rollOver) {
_root.helptxt.text = "Click this to increment minutes by 1 (one). Click and drag to quickly roll through minutes.";
}
on (rollOut) {
resetHelpTxt();
}
Symbol 56 Button
on (press) {
_root.mndrag = true;
newvalue = Number(_root.almmn.text) - 1;
if (newvalue < 0) {
newvalue = 59;
}
_root.almmn.text = newvalue;
_root.oldx = _root._xmouse;
_root.oldy = _root._ymouse;
}
on (release) {
_root.mndrag = false;
}
on (releaseOutside) {
_root.mndrag = false;
}
on (rollOver) {
_root.helptxt.text = "Click this to decrement minutes by 1 (one). Click and drag to quickly roll through minutes.";
}
on (rollOut) {
resetHelpTxt();
}
Symbol 57 Button
on (press) {
_root.scdrag = true;
newvalue = Number(_root.almsc.text) + 1;
if (newvalue > 59) {
newvalue = 0;
}
_root.almsc.text = newvalue;
_root.oldx = _root._xmouse;
_root.oldy = _root._ymouse;
}
on (release) {
_root.scdrag = false;
}
on (releaseOutside) {
_root.scdrag = false;
}
on (rollOver) {
_root.helptxt.text = "Click this to increment seconds by 1 (one). Click and drag to quickly roll through seconds.";
}
on (rollOut) {
resetHelpTxt();
}
Symbol 58 Button
on (press) {
_root.scdrag = true;
newvalue = Number(_root.almsc.text) - 1;
if (newvalue < 0) {
newvalue = 59;
}
_root.almsc.text = newvalue;
_root.oldx = _root._xmouse;
_root.oldy = _root._ymouse;
}
on (release) {
_root.scdrag = false;
}
on (releaseOutside) {
_root.scdrag = false;
}
on (rollOver) {
_root.helptxt.text = "Click this to decrement seconds by 1 (one). Click and drag to quickly roll through seconds.";
}
on (rollOut) {
resetHelpTxt();
}
Symbol 59 Button
on (press) {
if (_root.almampm.text == "AM") {
_root.almampm.text = "PM";
} else {
_root.almampm.text = "AM";
}
}
on (rollOver) {
_root.helptxt.text = "Click this to toggle between AM and PM.";
}
on (rollOut) {
resetHelpTxt();
}
Symbol 60 Button
on (press) {
if (_root.almampm.text == "AM") {
_root.almampm.text = "PM";
} else {
_root.almampm.text = "AM";
}
}
on (rollOver) {
_root.helptxt.text = "Click this to toggle between AM and PM.";
}
on (rollOut) {
resetHelpTxt();
}
Symbol 65 Button
on (release) {
_root.basealmhr = _root.almhr.text;
_root.basealmmn = _root.almmn.text;
_root.basealmsc = _root.almsc.text;
_root.basealmampm = _root.almampm.text;
if (_root.basealmhr.length == 1) {
hrset = "0" + _root.basealmhr;
} else {
hrset = _root.basealmhr;
}
if (_root.basealmmn.length == 1) {
mnset = "0" + _root.basealmmn;
} else {
mnset = _root.basealmmn;
}
if (_root.basealmsc.length == 1) {
scset = "0" + _root.basealmsc;
} else {
scset = _root.basealmsc;
}
_root.alarmstatus = "on";
_root.alarmstatusbox.text = "Alarm: ON";
_root.turnoffalarm._visible = true;
_root.alarmtxtbg._visible = false;
_root.slidesetting.slidetext.text = (((((("Set for: " + hrset) + ":") + mnset) + ":") + scset) + " ") + _root.basealmampm;
_root.slidesetting._visible = true;
var my_fmt = new TextFormat();
my_fmt.bold = true;
_root.slidesetting.slidetext.setTextFormat(my_fmt);
_root.slidesetting.gotoAndPlay(2);
}
on (rollOver) {
_root.helptxt.text = "This sets and turns ON the alarm. The alarm will trigger when the Current Time matches the Alarm Time.";
}
on (rollOut) {
resetHelpTxt();
}
Symbol 72 Button
on (release) {
if (_root.almmn.text == "15") {
_root.almmn.text = "0";
} else {
_root.almmn.text = "15";
}
}
on (rollOver) {
_root.helptxt.text = "Click this to toggle minutes between 15 (fifteen) and 0 (zero).";
}
on (rollOut) {
resetHelpTxt();
}
Symbol 77 Button
on (release) {
if (_root.almmn.text != "30") {
_root.almmn.text = "30";
} else {
_root.almmn.text = "0";
}
}
on (rollOver) {
_root.helptxt.text = "Click this to toggle minutes between 30 (thirty) and 0 (zero).";
}
on (rollOut) {
resetHelpTxt();
}
Symbol 82 Button
on (release) {
if (_root.almmn.text == "45") {
_root.almmn.text = "0";
} else {
_root.almmn.text = "45";
}
}
on (rollOver) {
_root.helptxt.text = "Click this to toggle minutes between 45 (forty-five) and 0 (zero).";
}
on (rollOut) {
resetHelpTxt();
}
Symbol 87 Button
on (release) {
getURL ("http://www.nakedalarmclock.com", "_blank");
}
Symbol 94 Button
on (release) {
stopAllSounds();
_root.alarmstatus = "off";
_root.alarmstatusbox.text = "Alarm: OFF";
_root.turnoffalarm._visible = false;
_root.alarmtxtbg._visible = true;
_root.ringing._visible = false;
_root.slidesetting.gotoAndPlay(7);
_root.stoptestbutton._visible = false;
_root.testbutton._visible = true;
}
on (rollOver) {
_root.helptxt.text = "Press this button to turn off the alarm. Or HIT the Spacebar.";
}
on (rollOut) {
resetHelpTxt();
}
on (keyPress "<Space>") {
stopAllSounds();
_root.alarmstatus = "off";
_root.alarmstatusbox.text = "Alarm: OFF";
_root.turnoffalarm._visible = false;
_root.alarmtxtbg._visible = true;
_root.ringing._visible = false;
_root.slidesetting.gotoAndPlay(7);
_root.stoptestbutton._visible = false;
_root.testbutton._visible = true;
}
Symbol 100 Button
on (release) {
_root.stoptestbutton._visible = true;
_root.testbutton._visible = false;
var my_Testsound = new Sound();
if (_root.alarmsoundid == "") {
_root.alarmsoundid = "alarmsound1";
}
my_Testsound.attachSound(alarmsoundid);
my_Testsound.setVolume(500);
my_Testsound.onSoundComplete = function () {
_root.stoptestbutton._visible = false;
_root.testbutton._visible = true;
};
my_Testsound.start(0, 30);
}
on (rollOver) {
_root.helptxt.text = "Click this to test the sound, volume and length of the alarm.";
}
on (rollOut) {
resetHelpTxt();
}
Symbol 104 Button
on (release) {
if (_root.ringing._visible != true) {
_root.my_Testsound.stop();
}
_root.stoptestbutton._visible = false;
_root.testbutton._visible = true;
}
on (rollOver) {
_root.helptxt.text = "Press this to abort the audio test.";
}
on (rollOut) {
resetHelpTxt();
}
Symbol 114 Button
on (release) {
_root.soundnametxt.text = "Alarm Clock Bell";
_root.alarmsoundid = "alarmsound1";
}
on (rollOver) {
_root.helptxt.text = "Click this to change the alarm sound to Alarm Clock Bell. Use the Test Audio button to sample.";
}
on (rollOut) {
resetHelpTxt();
}
Symbol 118 Button
on (release) {
_root.soundnametxt.text = "Alien Alarm";
_root.alarmsoundid = "alienalarm";
}
on (rollOver) {
_root.helptxt.text = "Click this to change the alarm sound to Alien Alarm. Use the Test Audio button to sample.";
}
on (rollOut) {
resetHelpTxt();
}
Symbol 121 Button
on (release) {
_root.soundnametxt.text = "Digital Alarm";
_root.alarmsoundid = "digitalalarm1";
}
on (rollOver) {
_root.helptxt.text = "Click this to change the alarm sound to Digital Alarm. Use the Test Audio button to sample.";
}
on (rollOut) {
resetHelpTxt();
}
Symbol 124 Button
on (release) {
_root.soundnametxt.text = "Bugle Reveille";
_root.alarmsoundid = "buglereveille";
}
on (rollOver) {
_root.helptxt.text = "Click this to change the alarm sound to Bugle Reveille. Use the Test Audio button to sample.";
}
on (rollOut) {
resetHelpTxt();
}
Symbol 125 Button
on (release) {
if (_root.almsc.text != "30") {
_root.almsc.text = "30";
} else {
_root.almsc.text = "0";
}
}
on (rollOver) {
_root.helptxt.text = "Click this to toggle seconds between 30 (thirty) and 0 (zero).";
}
on (rollOut) {
resetHelpTxt();
}
Symbol 131 Button
on (press) {
_root.designpage._visible = true;
}
Symbol 135 Button
on (press) {
_root.designpage._visible = false;
}
Symbol 143 Button
on (press) {
getURL ("http://www.extremesportclips.com", "_blank");
}