1 Reply Latest reply on Sep 9, 2013 7:53 PM by Ned Murphy

    Help modifying a clock code in flash CS6.

    AGThorne

      I have a flash file that has a built in clock.  I would like the clock to function on a 12 hour schedule instead of a 24 hour or military one. 


      Any help would be greatly appreciated! 

       

      Here is the code:

       

      onClipEvent (enterFrame) {

                       now = new Date();

      switch (now.getMonth()) {

                      case 0:

                      month = "January";

          break;

        case 1:

          month = "February";

          break;

        case 2:

          month = "March";

          break;

        case 3:

          month = "April";

          break;

        case 4:

          month = "May";

          break;

        case 5:

          month = "June";

          break;

        case 6:

          month = "July";

          break;

        case 7:

          month = "August";

          break;

        case 8:

          month = "September";

          break;

        case 9:

          month = "October";

          break;

        case 10:

          month = "November";

          break;

        case 11:

          month = "December";

          break;

        default:

          trace ("")

      }

       

      switch (now.getDay()) {

                      case 0:

                      day = "Sunday";

          break;

        case 1:

          day = "Monday";

          break;

        case 2:

          day = "Tuesday";

          break;

        case 3:

          day = "Wednesday";

          break;

        case 4:

          day = "Thursday";

          break;

        case 5:

          day = "Friday";

          break;

        case 6:

          day = "Saturday";

          break;

        default:

          trace ("")

      }

      minutes = now.getMinutes();

      if (minutes <=9 && minutes >=0)

      {

                      minutes = "0"+now.getMinutes();

      }

      seconds = now.getSeconds();

      if (seconds <=9 && seconds >=0)

      {

                      seconds = "0"+now.getSeconds();

      }

      date1 =day  +","+ month +","+ now.getDate();

      date2 =now.getHours() + ":" + minutes;

      }

       

       

       

      Thanks!