![]() ![]() ![]() | |
![]() | |
![]() | |
![]() |
You'll modify your script to compensate for the zero indexing.
currentMonth,
and test your document to be sure the expected month number appears. That line of script should read as follows:
var currentMonth:Number = myDate.getMonth()+1;
//trace (currentMonth);
autoSize
property of your text box to true
:
currentDate_txt.autoSize = true;
currentMonth
variable you have already created, plus the getDate()
and getFullYear()
methods of the Date object:
currentDate_txt.text="Today is "+currentMonth+"/"+ myDate.getDate() + "/"+myDate.getFullYear();
var myDate:Date=new Date(); var currentMonth:Number = myDate.getMonth()+1; //trace (currentMonth); currentDate_txt.autoSize = true; currentDate_txt.text="Today is "+currentMonth+"/"+ myDate.getDate() + "/"+myDate.getFullYear();
Note: An example finished file of the document you just created, named handson1.fla, is located in your finished files folder. For the path, see Set up your workspace.
![]() | |
![]() | |
![]() | |
![]() ![]() ![]() |