Ali, 

currTime = new Date(currTime.getTime() + 1000);

or

currTime.setTime(currTime.getTime() + 1000);

Regards, 

-Keith 
http://keithreinfeld.home.comcast.net
 

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:flashcoders-
> [EMAIL PROTECTED] On Behalf Of Ali Drongo
> Sent: Friday, August 22, 2008 10:05 AM
> To: Flash Coders List
> Subject: [Flashcoders] Quick Date question, how to add 1 second to Date?
> 
> Hiya, I can't see the wood for the trees with this one. I;m getting an
> error message of type mismatch when I try and add 1000 onto the date
> to increase it by 1 second for a timer.
> 
> I'm sure I am doing something wrong that is patently obvious but I'm
> not sure what and this is driving me mad!
> 
> Any help really appreciated, i have to get this working today :)
> 
> here's my code:
> 
> 
> public function update():Void
> {
>       currTime +=1000;// gives Type mismatch in assignment statement:
> found
> Number where Date is required.
> }
> 
> 
> public function phpLoaded():Void
> {
>       //receives time since jan 1970 from php
>       var str:String = arguments.caller.lv.toString();
>       var myA:Array = new Array();
>       myA = str.split("=")
>       //get computer time
>       trace("servertime:"+myA[0]);
>       connectedTime = new Date();
>       connectedTime += myA[0];
>       currTime = new Date();
>       currTime = connectedTime;
>       trace("====="+currTime.toString());
>       clearInterval(secondInterval);
>       update();
>       secondInterval = setInterval(this, "update", 1000);
> }
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to