PDA

View Full Version : Getting the date?


Freddy
06-07-2005, 06:08 PM
I need to know how to get the date of whatever day the user in playing on.
how would I do this.

I need month/day/year. I though something like:
var date = _root.getDate();
but I just get 'undefined'

any one know what I need to do?

Blixinator
06-07-2005, 06:18 PM
would this happen to be for the ultimate sig?

Freddy
06-07-2005, 06:19 PM
would this happen to be for the ultimate sig?
nope.

dude.

Bodadem
06-07-2005, 06:25 PM
From actionscript.org;
http://www.actionscript.org/tutorials/beginner/A_clock/index.shtml

Freddy
06-07-2005, 06:45 PM
ok.
but with that I get
"undefined07.undefined06.05"

I cant figure out where the two 'undefined's came from. This uses a bunch of stuff I dont understand.

Bodadem
06-07-2005, 06:46 PM
Yeah, go to the revised link.. I found a better one.

Freddy
06-07-2005, 06:53 PM
oh ok. the link is a lot better. and it gives a freakin explination.
thanx.

Bodadem
06-07-2005, 06:59 PM
Heh.. No prob.. http://www.actionscript.org is a good resource.

Freddy
06-07-2005, 07:04 PM
woohoo!
worx like a charm.

I'd show you what I have, but its right on the link.

Bodadem
06-07-2005, 08:49 PM
So, you gunna tell us what it's for?.. Or you just felt like doing it for fun?

Freddy
06-08-2005, 11:06 AM
more importantly than what, is when.

which is...as soon as I can figure out how to do this other thing. :rolleyes:

ChronicLord
06-08-2005, 11:07 AM
Hey, Shadow. Try this code:

date = new Date();
date_str = ((date.getMonth() + 1) + "/" + date.getDate() + "/" + date.getFullYear());

That should work. Ive not tested it though. Good Luck!;)

ChronicLord
06-09-2005, 10:10 AM
Create three hands (hour/minute/second) all pointing upwards
Make them MCs
Give the hour hand the Instance Name 'hhand'
Give the minute hand the Instance Name 'mhand'
Select the second hand, and add these actions:

onClipEvent(enterFrame){
MyDate = new Date();
hour = MyDate.getHours();
minute = MyDate.getMinutes();
second = MyDate.getSeconds();
this._rotation=6*second;
_parent.mhand._rotation=6*minute
if(hour>12){hour=hour-12;}
_parent.hhand._rotation=(30*hour)+(0.5*minute)
}

The hands will have to have their rotation point at the bottom to work correctly

Clock.fla (http://planetbob.net/pics/Clock.fla)

Thank you Denvish!

Swas
06-09-2005, 10:14 AM
Chronic Firstly he said it worked, secondly thats not what he was looking for, thirdly there was a topic with pretty much that exact code so that was pointless.