Guest User

Untitled

a guest
Jul 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. public function startTimer(evt:MouseEvent=null):void {
  2.  
  3. hours = parseInt(timer_hours.text);
  4. minutes = parseInt(timer_minutes.text);
  5. seconds = parseInt(timer_seconds.text);
  6.  
  7. gateway = new Gateway("getProjectPrefs", this, this, "select * from ProjectPrefs where Project_projectID="+timerObj.projectID);
  8.  
  9. if (!t) {
  10. t = new Timer(1000);
  11. startDt = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), new Date().getHours(), new Date().getMinutes(), new Date().getSeconds());
  12. customDateField.timerStartDateFormatter();
  13. t.addEventListener(TimerEvent.TIMER, timePlayHandler);
  14.  
  15. t.start();
  16. //startBtn.label = "Pause";
  17. startBtn.selected = true;
  18.  
  19.  
  20.  
  21. // gateway = new Gateway("toggleTimers", Application.application.holder.navDisplay.vs.getChildByName("timerUI"), this, this);
  22. } else if (!startBtn.selected) {
  23. // take hours, minutes, seconds variables and convert them to seconds
  24. // this allows for editing the time in the text inputs
  25. elapsedSeconds = (hours * 3600) + (minutes * 60) + (seconds%60);
  26.  
  27. t.start();
  28. // startBtn.label = "Pause";
  29. startBtn.selected = true;
  30. // gateway = new Gateway("toggleTimers", Application.application.holder.navDisplay.vs.getChildByName("timerUI"), this, this);
  31. } else {
  32. t.stop();
  33. // startBtn.label = "Start";
  34. startBtn.selected = false;
  35. }
  36.  
  37. }
  38.  
  39. public function pauseTimer(): void {
  40. gateway = new Gateway("getProjectPrefs", this, this, "select * from ProjectPrefs where Project_projectID="+projectID);
  41. t.stop();
  42. //startBtn.label = "Start";
  43. startBtn.selected = false;
  44. }
  45.  
  46. public function resetTimer(): void {
  47. t.reset();
  48. t.stop();
  49.  
  50. currTimeInHours = "00";
  51. currTimeInMinutes = "00";
  52. currTimeInSeconds = "00";
  53.  
  54. //startBtn.label = "Start";
  55. startBtn.selected = false;
  56. elapsedSeconds = 0;
  57. }
Add Comment
Please, Sign In to add comment