Thursday, June 28, 2012

[Action Script] Clock Countdown Function Help June,2012

Hello,

I was wondering if someone could break down the following code for me and make it a bit easier so that i can just set a start date / end date.

Thanks.
Code: function displayDifference()
{
    nowTime = new Date();
    hoursLeft = ((((16-nowTime.getDate())*24) + (20 - nowTime.getHours())));
        //hoursLeft = (4 - nowTime.getDate()) * 24 + (19 - nowTime.getHours());
    if (hoursLeft >= 0)
    {
        timeRemaining.text = hoursLeft + ":" + padString(59 - nowTime.getMinutes()) + ":" + padString(59 - nowTime.getSeconds()) + "";
    }
    else
    {
        timeRemaining.text = "0H 0M 0S";
    } // end else if
} // End of the functionWhat i want to do is have a Start date of a value such as July 1st
and end date of July 31st

i'm not sure how similar this is to javascript esentially i want it to be like this.

Code: /* Date Animation  starts here*/
                                $(function () {
                                var austDay = new Date();
                                var austDay = new Date("June 30, 2012 21:00:00");
                                $('#countdown').countdown({until: austDay, layout:
                                                                '<div id="days" class="numbers">{dnn}</div>'+
                                                                '<div class="spacer"></div>'+
                                                                '<div id="hours" class="numbers">{hnn}</div>'+
                                                                '<div class="spacer"></div>'+
                                                                '<div id="minutes" class="numbers">{mnn}</div>'+
                                                                '<div class="spacer"></div>'+
                                                                '<div id="seconds" class="numbers">{snn}</div>'+
                                                                '</div>'});
                                                                });});
Clock Countdown Function Help

Related Post



0 comments: