Displaying date tut (MX)

Hey guys!

I have just successfully used Kirupa’s tut for displaying the date. However, I am always interested in how the code actually works.

This is one for a scripter eg DAVID<:}

(Below is a portion of the script)

now = new Date();
nDate =**now**.getDate();
nYear = now.getFullYear();

How does the syntax now work? Obviously it retrieves the info eg getDate, but wot is actually happening when now is executed??

Thanx!

Well look at the code…

<B>now</B> = new Date();
nDate =<B>now</B>.getDate();
nYear = now.getFullYear();

“now” is the variable that contains the new Date() object.

So you use the new Date() object to retrieve the time. That is how you are able to use the get commands like getDate, getFullYear, etc.

I hope that makes sense :slight_smile:

Hey thanx… yep, it is a bit clearer now.

The thing is I’m kumming from the design side, and trying to get more involved in the development side, so ActionScript (in fact most languages) are kina foreign to me!:frowning:

I think I need to buy a book that can give me a solid grounding on the concept of AS language - I want it to be fluent like its my second language!!!

Kirupa reviewed and rated a book a few weeks back; I mite try that unless u can recommend one…

Thanx again

I have never used a book before, but I hear Colin Moocks book, I believe it is called AS: The Definitive Guide or something along those lines, is a great start for Flash MX AS starters.

Ok… yeh I’ve heard about him before…
Thanx again

www.moock.org

He is great, so is Keith Peters at www.bit-101.com (he writes for The Friends of Ed)

The Friends of Ed are incredibly excellent… http://www.friendsofed.com/ , but their books are advanced, so you might want to look in them for later.

I am thinking about buying a book soon, hmmm, maybe I should take my own advice :slight_smile: