PDA

View Full Version : Refreshing frame doesnt really refresh flash with variables?


Ignus_Fatuus
04-01-2003, 11:58 AM
Hello!

I have a problem with a flash movie that counts down to a deadline. When the movie loads it collects the current date and time from the server via a php script. The first time I load the movie it shows the correct time left to the deadline as numbers counting down, but if I "refresh" the frame that holds the movie the countdown jumps back to the numbers it had the first time I loaded the movie (for example if it said 22:10:10 when I loaded first, and was down to 22:01:10 when I refreshed, it jumps back to 22:10:10). Why doesnt the flash-movie reload when I refresh the frame and yet again collects the correct time from the server via the script, and where the heck are those variables stored so that flash can "reuse" them when I reload the frame, they should be gone!?

If anyone gest what I'm saying I would be VERY thankful for help

/Magnus

catbert303
04-01-2003, 12:01 PM
where you load the variables from the PHP script try appending a unique value to the filename (this prevents the browser going back to the cache to get the output of the script)

eg,

"filename.php?nocache=" + new Date.getTime()

Ignus_Fatuus
04-01-2003, 12:08 PM
Thanks very much for the quick answer! I'm quite a newbie though so I have a follow up question... you mean I could execute the command like this in flash? :

loadVariables ("filename.php?nocache="+new Date.getTime(), "_root", POST);

catbert303
04-01-2003, 12:35 PM
yep along those lines :)

you need " " around POST though

_root.loadVariables ("filename.php?nocache="+new Date().getTime(), "POST");
edit, sorry I missed out some brackets (they're added now)

Ignus_Fatuus
04-01-2003, 02:30 PM
Thankyou so much! This solved the problem and now the timer works lite it was intended to. I'm very grateful that you took the time to help me =)