Hi im using a coundown from server to flash but if i test the countdown using 2 laptops there is always a time difference between the two laptops, i need to get the same time, here is my code can anyone see the problem.
i have rattled my head with this for seven days and still can’t find the answer please someone help me here.
here is my php code with the embeded flash
<? $server_secs = time(); ?>
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="preloader.swf" width="101%" height="100%">
<param name="movie" value="preloader.swf" />
<param name="quality" value="high" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="bgcolor" value="#000000" />
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="menu" value="true" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="sameDomain" /> <param name="FlashVars" value="starttime=<?=$server_secs?>" id="flash" /> <!--<![endif]-->
<a href="http://www.adobe.com/go/getflash"> <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /> </a> <!--[if !IE]>--> </object> <!--<![endif]--> </object>
and here is my as3 countdown code
[COLOR=#F000F0]*////////////////countdown timer ///////////////////////////////////////////*[/COLOR] [COLOR=#993300]var[/COLOR] int_secs; [COLOR=#993300]var[/COLOR] int_milli; [COLOR=#993300]var[/COLOR] paramSecs = [COLOR=#000000]0[/COLOR]; [COLOR=#993300]
function[/COLOR] GetFlashVars[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#993300]var[/COLOR] paramObj:[COLOR=#993300]Object[/COLOR] = [COLOR=#993300]this[/COLOR].[COLOR=#000000]root[/COLOR].[COLOR=#000000]loaderInfo[/COLOR].[COLOR=#000000]parameters[/COLOR];
[COLOR=#993300]var[/COLOR] valueStr:[COLOR=#993300]String[/COLOR]; [COLOR=#993300]
for[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#993300]var[/COLOR] keyStr [COLOR=#993300]in[/COLOR] paramObj[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#993300]switch[/COLOR] [COLOR=#000000]([/COLOR]keyStr[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#993300]case[/COLOR] [COLOR=#0000FF]"starttime"[/COLOR]:
valueStr = [COLOR=#993300]String[/COLOR][COLOR=#000000]([/COLOR]paramObj[COLOR=#000000][[/COLOR]keyStr[COLOR=#000000]][/COLOR][COLOR=#000000])[/COLOR];
paramSecs = [COLOR=#993300]parseInt[/COLOR][COLOR=#000000]([/COLOR]valueStr[COLOR=#000000])[/COLOR];
[COLOR=#993300]break[/COLOR]; [COLOR=#000000]}[/COLOR] [COLOR=#000000]}[/COLOR] [COLOR=#000000]}[/COLOR]
[COLOR=#993300]function[/COLOR] recieveTextFromHtml[COLOR=#000000]([/COLOR]secs[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
int_milli = secs * [COLOR=#000000]1000[/COLOR];
[COLOR=#993300]var[/COLOR] christmas:[COLOR=#993300]Date[/COLOR] = [COLOR=#993300]new[/COLOR] [COLOR=#993300]Date[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]2060[/COLOR], [COLOR=#000000]11[/COLOR], [COLOR=#000000]25[/COLOR], [COLOR=#000000]0[/COLOR], [COLOR=#000000]0[/COLOR], [COLOR=#000000]0[/COLOR], [COLOR=#000000]0[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#993300]var[/COLOR] now:[COLOR=#993300]Date[/COLOR] = [COLOR=#993300]new[/COLOR] [COLOR=#993300]Date[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
now.[COLOR=#993300]setTime[/COLOR][COLOR=#000000]([/COLOR]int_milli[COLOR=#000000])[/COLOR];
[COLOR=#993300]function[/COLOR] incrementDate[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR]:[COLOR=#993300]void[/COLOR] [COLOR=#000000]{[/COLOR]
now = [COLOR=#993300]new[/COLOR] [COLOR=#993300]Date[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
now.[COLOR=#993300]setTime[/COLOR][COLOR=#000000]([/COLOR]int_milli[COLOR=#000000])[/COLOR];
[COLOR=#F000F0]*date and times in milliseconds*[/COLOR]
[COLOR=#993300]var[/COLOR] timeDiff:[COLOR=#993300]Number[/COLOR] = christmas.[COLOR=#993300]getTime[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] - now.[COLOR=#993300]getTime[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR]; [COLOR=#993300]var[/COLOR] seconds:[COLOR=#993300]Number[/COLOR] = [COLOR=#993300]Math[/COLOR].[COLOR=#993300]floor[/COLOR][COLOR=#000000]([/COLOR]timeDiff / [COLOR=#000000]1000[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#993300]var[/COLOR] minutes:[COLOR=#993300]Number[/COLOR] = [COLOR=#993300]Math[/COLOR].[COLOR=#993300]floor[/COLOR][COLOR=#000000]([/COLOR]seconds / [COLOR=#000000]60[/COLOR][COLOR=#000000])[/COLOR];
minutes %= [COLOR=#000000]3[/COLOR];
seconds %= [COLOR=#000000]60[/COLOR];
[COLOR=#993300]var[/COLOR] timeRemaining:[COLOR=#993300]String[/COLOR] = minutes + [COLOR=#0000FF]" : "[/COLOR] + seconds;
timeString.[COLOR=#993300]text[/COLOR] = timeRemaining;
now_txt.[COLOR=#993300]text[/COLOR] = [COLOR=#993300]String[/COLOR][COLOR=#000000]([/COLOR]now[COLOR=#000000])[/COLOR];
xmas_txt.[COLOR=#993300]text[/COLOR] = [COLOR=#993300]String[/COLOR][COLOR=#000000]([/COLOR]christmas[COLOR=#000000])[/COLOR];
int_milli = int_milli + [COLOR=#000000]1000[/COLOR]; [COLOR=#000000]}[/COLOR]
[COLOR=#993300]var[/COLOR] gamestarter:Timer = [COLOR=#993300]new[/COLOR] Timer[COLOR=#000000]([/COLOR][COLOR=#000000]1000[/COLOR][COLOR=#000000])[/COLOR]; gamestarter.[COLOR=#000000]addEventListener[/COLOR][COLOR=#000000]([/COLOR]TimerEvent.[COLOR=#000000]TIMER[/COLOR], incrementDate[COLOR=#000000])[/COLOR]; gamestarter.[COLOR=#993300]start[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR]; [COLOR=#000000]}[/COLOR]
GetFlashVars[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#993300]if[/COLOR] [COLOR=#000000]([/COLOR]paramSecs != [COLOR=#000000]0[/COLOR][COLOR=#000000])[/COLOR]
recieveTextFromHtml[COLOR=#000000]([/COLOR]paramSecs[COLOR=#000000])[/COLOR];