FlepStudio has created a new free utility, a Flash CS3 coutndown manageable by an external XML file.
The utility is supported by a server-side script (gettime.php) as to develop a good countdown is necessary to get the time from the server.
This is because if we get time by the user machine (the one that makes the class Date of Actionscript without server side scripting ) not all users would the same time remaining under Zone time of the user.
This countdown allows you to show the same time remaining for any user any area of the world he is.
That's why I get time from the server.
Let me give you an example:
If we want to show the remaining time from now till 31 December 2008.
Just open file set_up.xml..., as following:
HTML Code:
<?xml version="1.0" encoding="UTF-8"?>
<countdown>
<yearToExpire>2008</yearToExpire>
<monthToExpire>12</monthToExpire>
<dayToExpire>31</dayToExpire>
<hourToExpire>23</hourToExpire>
<minutesToExpire>59</minutesToExpire>
<secondsToExpire>59</secondsToExpire>
<timeZoneHours>+2</timeZoneHours>
<timeZoneMinutes>0</timeZoneMinutes>
<expiredText>EXPIRED !</expiredText>
<PHPurl>http://www.flepstudio.org/utilita/CountDown/gettime.php</PHPurl>
</countdown>
yearToExpire: set the year of the expiring day
monthToExpire: month of the expiring day
dayToExpire: day of the expiring day
hourToExpire: hours of the expiring day
minutesToExpire: minutes of the expiring day
secondsToExpire: seconds of the expiring day
timeZoneHours: set your timezone( in my case +2 in Italy )
timeZoneMinutes: set if necessary minutes of your time zone (some area in the world can have for example +9.30, in this case would include 30 in this field))
expiredText: the text that will be show when the CountDown expires.
PHPurl: the url of the gettime.php file ( we get the server time with it )
gettime.php:
PHP Code:
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
echo "time=" . time();
?>
Result:
At this moment users Italians, Americans, Japanese and any other part of the world sees the same time remaining because it has been calculated on the basis of time of the server where this domain is located, the time zone of the area where I am and the time zone of the user's machine.
Source files:
Bookmarks