Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

Script for a date on my flash

HI,

I want to have the date on my flash site to be showing like, ex: january 2, 2003

I want it to update itselfs with what ever the date is that day.


Can somebody help me please.

Thanks,

Ryan
0
daddydesign
Asked:
daddydesign
  • 6
  • 6
1 Solution
 
ocgstylesCommented:
This may not be the best answer, as there is supposed to be a way to spell out the month name use one of the date objects methods, but it will work.


//setup an month array
months = new Array("January", "February", "March", etc...);

//create date object
today = new Date();
thisMonth = today.getMonth();
thisDate = today.getDate();
thisYear = today.getFullYear();

fullDate = months[thisMonth] + " " + thisDate + ", " + thisYear;


The method that returns the month spelled out looks like:
thisMonth.toString();

But like I said, since that didn't work, I just spelled out the names of the months manually in the months array.

Good luck

-styles

0
 
daddydesignAuthor Commented:
How do I put it in the flash.  I'm sorry I'm just learning flash.

Thanks.

P.s. The whole month desnt have to be spelled out.
0
 
ocgstylesCommented:
I made a quick FLA for you.

http://www.elementfixe.net/ee/date.fla

Take a look at the actions in the first frame.  They are pretty similar to what is above, except that I added a short format too.

In the "var" field (in properties window) you can type the name of the variable you want to get the value from.  You will see that I created two textboxes, with "var" named shortDate and longDate.  the values for these textboxes are taken from the variables in the first frame.

-styles
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
daddydesignAuthor Commented:
I cant open that file for some reason!  Thank You for your help
0
 
ocgstylesCommented:
what version of flash are you using?  that was saved in MX version....

-styles
0
 
ocgstylesCommented:
here is one saved in flash 5 format:

http://www.elementfixe.net/ee/date5.fla

-styles
0
 
daddydesignAuthor Commented:
I cant open that file for some reason!  Thank You for your help
0
 
daddydesignAuthor Commented:
I got it opened! Thank you so much.  I'm starting to understand how you did it.  

1 more stupid question.  How do I take away that border adn make the background go away or change the color of the background.

thanks
0
 
daddydesignAuthor Commented:
Can you tell me how to get rid of the border and how to change the background color of it

thank you so much for your help[

ryan
0
 
ocgstylesCommented:
i don't remember where exactly to make the adjustment in flash 5.  i uploaded a pic of the textbox properties from MX, maybe the buttons look the same...

http://www.elementfixe.net/ee/border.jpg

when you deselect this, the background color becomes transparent.  unfortunatly, you can't change the background color of the textbox, unless you have Flash MX.

-styles
0
 
daddydesignAuthor Commented:
Once again... thank you.

Let me know what you think of the site I'm creating !

http://www.iipga.com

Thank you again for all your help!



ryan
0
 
ocgstylesCommented:
looks good!
0
 
henrywwCommented:
wow ... big O ... that's fast ...
very quick response.

hmmm now u are getting ahead of me answering all the questions b4 i wake up...  LOL ...


cheers O
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 6
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now