PDA

View Full Version : Countdown Timer - Help, Not reacting how i want!


8dayssooner
04-18-2007, 06:29 PM
php:<?php
$x = "testing";
$hour="10";
$mins="30";
$secs="00";

echo "countdown=$x&h1=$hour&m1=$mins&s1=$secs";
?>
countdown = test box i have set up to check the variables i am loading
h1 = hours
m1 = mins
s1 = secs

actionscript:loadVariables("http://localhost/site/servercountdown/countdown4/test.php", this, "GET");

v1 = h1;
v2 = m1;
v3 = s1;

d = new Date();

hour = v1-d.getHours();
if (length(hour) < 2) {
hour = "0" - hour;
}
minute = v2-d.getMinutes();
if (length(minute) < 2) {
minute = "0" - minute;
}
sec = v3-d.getSeconds();
if (length(sec) < 2) {
sec = "0" - sec;
}
//s = d.getUTCDate();

Hi, i am using the above codes to create a countdown timer.
The timer is going to be used to countdown to an event that happens every so often at a time set by another script which a mate is coding, but im having trouble getting my test script to count down to time i am specifying in the php.
at the moment, the counter seems to be counting up instead of down. if i set the variables to 24, 60, 60 (respectively), then they count down fine, but they count down to midnight, and not the time i am specifying in the PHP.

If anyone could help me, i would be very much grateful!

thanks in advance, and hope to see some replies soon.

Mike

spriggan
05-01-2007, 07:47 PM
have you tried doing a search of the forum or tutorials for timer or countdown? since you're allready got the PHP variables loaded in (and I assume you've verified you're getting all three correctly) you should be able to find use in one of the actionscript forums instead of the serverside forum.

I would offer more help but time is something I've never bothered to learn in Flash.

8dayssooner
05-08-2007, 07:03 AM
have you tried doing a search of the forum or tutorials for timer or countdown? since you're allready got the PHP variables loaded in (and I assume you've verified you're getting all three correctly) you should be able to find use in one of the actionscript forums instead of the serverside forum.

I would offer more help but time is something I've never bothered to learn in Flash.
Ok cheers, i'll have a look now!

thanks for taking the time to reply :)