Display Date with Adobe Flash 8 and ActionScript |
| Written by AnaS | |
|
The Date will be shown in the format Tuesday, January 23 2007.
var date=new Date(); /* for a nice display I'll use days_str variable for adding a 0 before the days between 1 and 9*/
if (days<10){
/*ActionScript sees months like numbers between 0 and 11, in order to display months name I'll use a swich-case block
switch (month){ /*ActionScript sees days of the week like numbers between 0 and 6, beggining with Sunday. This problem will be solved in the same manner.*/
switch (dayweek){ /*now let's display the date in the desired way*/ date_txt.text=dayweek_str+", "+month_str+" "+days_str+" "+year; Great job! Now test the movie Control >> Test Movie (or CTRL+Enter) and see the result:You need to Register in order to download the FLA file.
written by kyutkb , July 07, 2007
hey.. thanks a lot! great help
written by jay , July 10, 2007
how do I add it to my presentation?
written by AnaS , July 20, 2007
You can add this code to a movie clip of your flash presentation. Then put the movie clip wherever you wish in your presentation. Another possibility is to create a .swf file following the steps described in this tutorial. Then use the loadMovie(url, [method]) method of the MovieClip in Flash. Hope it was useful!
written by Star , September 14, 2007
Hi. This is great but how can I insert it into a movie without the "background" of the dynamic text. I want a blank text box so that my current background shows through with just text the text over it. Thank you SO much!!! I learned alot.
written by Star , September 14, 2007
Oh nevermind! I removed the border and now it's transparent. Thanks again for this great tutorial! Star
written by Scott , October 10, 2007
awesome, simple, tutorial - and it works well. Thanks!
written by Stephane , October 24, 2007
WOW! I wasn't able to find clear tutorials on internet... but this one is absolutely great! Thanks a lot!
written by Greg Kozma , October 27, 2007
I am having problems with this everyone else says it is great.Could you send me the fla, so I can see what i am doing wrong much appreciated
written by Ben McLennan , October 30, 2007
I'm in the same boat as Greg Kozma I'm in my CS3 but the file is set to action script 2 so I shouldn't be having this problem should I? my problem is it just wont display when I test movie...
written by swearingen , November 03, 2007
slick! do you have a version for AS3?
written by Karan Sawnani , March 28, 2008
Thanks for the tutorial. It works great. There was no problem on Flash CS3 when I used Actionscript 2.0 . Do you need more help? Ask now!
|
|
| Last Updated ( Saturday, 22 March 2008 ) |