![]() ![]() ![]() | |
![]() | |
![]() | |
![]() |
You'll create an existing class using visual tools (the TextField class) and code (using the Date class).
var myDate:Date=new Date();
currentMonth
equal to the getMonth()
method:
var currentMonth:Number = myDate.getMonth();
currentMonth
:
trace (currentMonth);
You should see a number in the Output panel that represents the month.
The getMonth()
method displays the current month. The getMonth()
method is zero-indexed, meaning the numbering begins at zero rather than one, so the number displayed is one less than what you would expect.
![]() | |
![]() | |
![]() | |
![]() ![]() ![]() |