# The clock man needs a hand

**URL:** <https://forum.kirupa.com/t/the-clock-man-needs-a-hand/2784>\
**Category:** Uncategorized\
**Created:** [April 10, 2002, 5:56pm UTC](https://forum.kirupa.com/t/the-clock-man-needs-a-hand/2784 "2002-04-10T17:56:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 10, 2002, 5:56pm UTC](https://forum.kirupa.com/t/the-clock-man-needs-a-hand/2784/1 "2002-04-10T17:56:19Z")

</div>

I have this code on my MC. I just want to know if what i’m getting is correct. I have this to get the date, day, month, year…you know the drill, but i can only get the complete date to display if I use onClipEvent(load)…(enterFrame) won’t work, and i just wanted to make sure there was a reason behind it. Is it because I’m using arrays? check out the code. I do not want to majorly change the code if it can be avoided…\r\ronClipEvent (load){\rmon = [“Jan”,“Feb”,“Mar”,“Apr”,“May”,“Jun”,“Jul”,“Aug”,“Oct”,“Nov”,“Dec”];\rweekdays = [“Sunday”,“Monday”,“Tuesday”,“Wednesday”,“Thursday”,“Friday”,“Saturday”];\rnow = new Date()\rday = weekdays[now.getDay()]\rmonth = mon[now.getMonth()]\rdate = now.getDate()\ryear = now.getFullYear()\rdisplayDate = month+" “+date+”, "+year\rdisplayDay = day\r}

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 10, 2002, 6:40pm UTC](https://forum.kirupa.com/t/the-clock-man-needs-a-hand/2784/2 "2002-04-10T18:40:59Z")

</div>

No idea. I don’t understand, here it says ’ ’ ’ ’ after the time.\rpom 0]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 10, 2002, 6:52pm UTC](https://forum.kirupa.com/t/the-clock-man-needs-a-hand/2784/3 "2002-04-10T18:52:45Z")

</div>

well this code works for me. But if I put enterFrame it doens’t work…i was just wondering.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 11, 2002, 6:49pm UTC](https://forum.kirupa.com/t/the-clock-man-needs-a-hand/2784/4 "2002-04-11T18:49:34Z")

</div>

I tried to do it on press, it works the same. Strange strange. Maybe a little bug ??\r\rpom 0]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 11, 2002, 11:53pm UTC](https://forum.kirupa.com/t/the-clock-man-needs-a-hand/2784/5 "2002-04-11T23:53:02Z")

</div>

when you say:\r\rdate = now.getDate()\r\ryou’re overwriting the Date Object. then then next time you go\r\rnow = new Date();\r\rit doesn’t work.\r\rit’s not that it won’t work in an onClipEvent(enterFrame), it’s that it won’t work more than once.\r\ryou should really use two events here. use the load event for things that only need happen once:

```auto
 \r\ronClipEvent(load){\r\r mon = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Oct","Nov","Dec"];\r\r weekdays = ["Sun","Mon","Tues","Wed","Thu","Fri","Sat"];\r\r now = new Date();\r\r}

```

\rand an enterFrame event for the stuff that needs to be continously updated:

```auto
 \r\ronClipEvent(enterFrame){\r\r day = weekdays[now.getDay()];\r\r month = mon[now.getMonth()];\r\r mdate = now.getDate();\r\r year = now.getFullYear();\r\r displayDate = month+" "+mdate+", "+year;\r\r displayDay = day;\r\r}

```

\rnote that i’ve changed the variable date to mdate.\r\rmind you, this info only needs to update every 24 hours so your probably safe just putting the whole thing in a load event. ; )

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 12, 2002, 3:46pm UTC](https://forum.kirupa.com/t/the-clock-man-needs-a-hand/2784/6 "2002-04-12T15:46:12Z")

</div>

yeah i was thinking about that, because no one is really going to be looking at the site for a whole day, or at least while it is switching over, but I don’t want the code to be wrong. Thanks for spotting the variable. I knew it was something minor.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 13, 2002, 12:35pm UTC](https://forum.kirupa.com/t/the-clock-man-needs-a-hand/2784/7 "2002-04-13T12:35:08Z")

</div>

Supra, good to see you.\rI was wondering : What do you mean by overwriting the Date Object ??\r\rpom 0]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 13, 2002, 3:10pm UTC](https://forum.kirupa.com/t/the-clock-man-needs-a-hand/2784/8 "2002-04-13T15:10:30Z")

</div>

where it says \r\rnow = new Date()\r\rthen i used \r\rdate = now.getDate()\r\ri’m pretty sure that it just causes a conflict within the code.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 13, 2002, 4:01pm UTC](https://forum.kirupa.com/t/the-clock-man-needs-a-hand/2784/9 "2002-04-13T16:01:49Z")

</div>

Oh, I see. Thanks.\rpom 0]
