Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function startTimer(evt:MouseEvent=null):void {
- hours = parseInt(timer_hours.text);
- minutes = parseInt(timer_minutes.text);
- seconds = parseInt(timer_seconds.text);
- gateway = new Gateway("getProjectPrefs", this, this, "select * from ProjectPrefs where Project_projectID="+timerObj.projectID);
- if (!t) {
- t = new Timer(1000);
- startDt = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), new Date().getHours(), new Date().getMinutes(), new Date().getSeconds());
- customDateField.timerStartDateFormatter();
- t.addEventListener(TimerEvent.TIMER, timePlayHandler);
- t.start();
- //startBtn.label = "Pause";
- startBtn.selected = true;
- // gateway = new Gateway("toggleTimers", Application.application.holder.navDisplay.vs.getChildByName("timerUI"), this, this);
- } else if (!startBtn.selected) {
- // take hours, minutes, seconds variables and convert them to seconds
- // this allows for editing the time in the text inputs
- elapsedSeconds = (hours * 3600) + (minutes * 60) + (seconds%60);
- t.start();
- // startBtn.label = "Pause";
- startBtn.selected = true;
- // gateway = new Gateway("toggleTimers", Application.application.holder.navDisplay.vs.getChildByName("timerUI"), this, this);
- } else {
- t.stop();
- // startBtn.label = "Start";
- startBtn.selected = false;
- }
- }
- public function pauseTimer(): void {
- gateway = new Gateway("getProjectPrefs", this, this, "select * from ProjectPrefs where Project_projectID="+projectID);
- t.stop();
- //startBtn.label = "Start";
- startBtn.selected = false;
- }
- public function resetTimer(): void {
- t.reset();
- t.stop();
- currTimeInHours = "00";
- currTimeInMinutes = "00";
- currTimeInSeconds = "00";
- //startBtn.label = "Start";
- startBtn.selected = false;
- elapsedSeconds = 0;
- }
Add Comment
Please, Sign In to add comment