A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Good Morning, Changing text on time of day

  1. #1
    _
    Join Date
    Jun 2002
    Posts
    1,101

    Good Morning, Changing text on time of day

    Hi all,

    I cant figure out how to make text come up saying "good morning" or "good afternnon" depnding on the time of day.. any help on this would be greatly apreaciated

    -thanks

  2. #2
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    Hi,

    myDate = new Date();
    hours = myDate.getHours();
    if (hours < 12) {
    out = "good morning!";
    } else {
    out = "good afternoon!";
    }

    I guess you could add other conditions for stuff like good evening etc

  3. #3
    _
    Join Date
    Jun 2002
    Posts
    1,101
    how do i get it to send "good morning" ect.. to a dynamic text box?

  4. #4
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    Make a dynamic textbox and give it the variable name out (assuming the textbox is in the same timeline as the code)

  5. #5
    _
    Join Date
    Jun 2002
    Posts
    1,101
    lol, i did that.. but i see what i did.. stupid mistake, i got it now

    thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center