2 Replies Latest reply on Oct 17, 2013 4:42 PM by Distoviolin

    Transfer Action Script/Flash animation to DVD question

    Distoviolin

      I have created a countdown clock using ActionScript/Flash that counts down to a specific date when the .swf runs.

       

      My client has asked  if we can take  the Flash/Action Script clock and transfer it to a traditional DVD and have it work the same as if it were still flash on the desktop.

       

      Is this possible?

        • 1. Re: Transfer Action Script/Flash animation to DVD question
          Ron Colmen Level 2

          Does your countdwon clock require a serverside script to work? (i.e. php)

          • 2. Re: Transfer Action Script/Flash animation to DVD question
            Distoviolin Level 1

            No serverside script needed.

             

            If it helps (and you have the patience) here is the code:

             

            //onEnterFrame allows for a function to be called every tick this.onEnterFrame = function() { //Stores the current date var today:Date = new Date(); //Stores the Current Year var currentYear = today.getFullYear(); //Stores the Current Time var currentTime = today.getTime(); //Creates and stores the target date var targetDate:Date = new Date(currentYear,10,13); var targetTime = targetDate.getTime(); //Determines how much time is left.  Note: Leaves time in milliseconds var timeLeft = targetTime - currentTime; var sec = Math.floor(timeLeft/1000); var min = Math.floor(sec/60); var hours = Math.floor(min/60); var days = Math.floor(hours/24); //Takes results of var remaining value.  Also converts "sec" into a string sec = String(sec % 60); //Once a string, you can check the values length and see whether it has been reduced below 2. //If so, add a "0" for visual purposes. if(sec.length < 2){ sec = "0" + sec; } min = String(min % 60); if(min.length < 2){ min = "0" + min; } hours = String(hours % 24); if(hours.length < 2){ hours = "0" + hours; } days = String(days);  if(timeLeft > 0 ){ //Joins all values into one string value var counter:String = days + ":" + hours + ":" + min + ":" + sec; time_txt.text = counter; }else{ trace("TIME'S UP"); var newTime:String = "00:00:00:00"; time_txt.text = newTime; delete (this.onEnterFrame); } }

             

            It works by syncing the clock animation to the clock/time on the local computer and then beginning a countdown.

             

            Not sure why the clients want to have it work on a DVD but I am tasked with finding out if it's possible.

             

            Many thanks