# getDate and setProperty

**URL:** <https://forum.kirupa.com/t/getdate-and-setproperty/27271>\
**Category:** flash\
**Created:** [July 31, 2003, 6:48pm UTC](https://forum.kirupa.com/t/getdate-and-setproperty/27271 "2003-07-31T18:48:16Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![oldgreymare](https://avatars.discourse-cdn.com/v4/letter/o/838e76/32.png) [@oldgreymare](https://forum.kirupa.com/u/oldgreymare)\
**Post date:** [July 31, 2003, 6:48pm UTC](https://forum.kirupa.com/t/getdate-and-setproperty/27271/1 "2003-07-31T18:48:16Z")

</div>

Hi there

I am trying to make an interactive calendar. I would like the day to be highlighted when it opens. The highlight is a movie clip with a number for the instance name.

onClipEvent (data) {  
todaysDate = new Date();  
if (todaysDate.getDate() == 01) {  
setProperty(“this”, \_visible, “1”);  
} else {  
setProperty(“this”, \_visible, “0”);  
}  
}

It’s not working and I’m not sure why. I could easily be going about it ALL wrong. I suspect that it being an onClipEvent is an error. Can’t I just getDate and setProperty?

I have attached the file. Once I understand how this works I can duplicate it for loading the correct month and year.

Any help or direction would be really appreciated.  
thanks  
ogm

---

<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:** [July 31, 2003, 7:49pm UTC](https://forum.kirupa.com/t/getdate-and-setproperty/27271/2 "2003-07-31T19:49:17Z")

</div>

I got It!!!

onClipEvent (load) {  
myDate = new Date();  
today = myDate.GetDate();  
if (today==02) {  
setProperty("", \_visible, “1”);  
} else {  
setProperty("", \_visible, “0”);  
}  
}

I put this code on each highlight instance with the correct number for today.

---

<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:** [July 31, 2003, 8:09pm UTC](https://forum.kirupa.com/t/getdate-and-setproperty/27271/3 "2003-07-31T20:09:02Z")

</div>

I’ve almost got it…

I don’t know why but, highlights 08 and 09 are behaving badly. They have the same code but with the appropriate:  
if (today==08)

It works for all of the others, so I really don’t have a clue.

onClipEvent (load) {  
myDate = new Date();  
today = myDate.GetDate();  
if (today==08) {  
setProperty("", \_visible, “1”);  
} else {  
setProperty("", \_visible, “0”);  
}  
}

Any ideas would be great.  
Thanks  
OGM

---

<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:** [August 1, 2003, 9:44am UTC](https://forum.kirupa.com/t/getdate-and-setproperty/27271/4 "2003-08-01T09:44:12Z")

</div>

Here

---

<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:** [August 1, 2003, 2:00pm UTC](https://forum.kirupa.com/t/getdate-and-setproperty/27271/5 "2003-08-01T14:00:12Z")

</div>

Thanks Claudio  
I knew that could be a solution to the problem, which is why I gave them the number names in the first place, but I couldn’t figure out how to write it! (the details). Thanks very very much.  
OGM

---

<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:** [August 1, 2003, 2:02pm UTC](https://forum.kirupa.com/t/getdate-and-setproperty/27271/6 "2003-08-01T14:02:44Z")

</div>

welcome :thumb:  
you could also use a loop if you want the button to perform some action (like display some info)

---

<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:** [August 1, 2003, 2:14pm UTC](https://forum.kirupa.com/t/getdate-and-setproperty/27271/7 "2003-08-01T14:14:30Z")

</div>

Hi

That is what I want to do and I just did a search for ‘loop’ and I’m not sure what you mean. I understand a loop as in to make something happen over and over again for a certain amount of time. I made the numbers, buttons, so that when clicked a notifier mc with information from a .txt doc. would show. The number buttons would have instance names that include the year. It’s probably the long way to go about it because I’m afraid of variables.

Thanks for your help. I’m going to look into some more.  
OGM

---

<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:** [August 1, 2003, 2:31pm UTC](https://forum.kirupa.com/t/getdate-and-setproperty/27271/8 "2003-08-01T14:31:10Z")

</div>

I don’t understand. After looking in the dict. it means that if ‘m’ is 1 or ‘less than or equal to’ 31, it won’t show. That’s sensible. The m++ is tricky though…it means that m+1 also =m? That’s what makes it a loop? Becaue the m++ makes it evaluate itself over and over? Isn’t it in conflict with the number you get for ‘today’?

(var m = 1; m\<=31; m++) {  
this[m].\_visible = false;  
this[today].\_visible = true;  
}

OGM

---

<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:** [August 1, 2003, 4:24pm UTC](https://forum.kirupa.com/t/getdate-and-setproperty/27271/9 "2003-08-01T16:24:30Z")

</div>

i++ increments the value of i by 1.  
About the conflict you get on today: [AS]this[today].\_visible = true; //this line will overwrite the previous line[/AS]i.e:  
If i have the following code:[AS]myVar = 15;  
myVar=30;  
trace(myVar);[/AS] The output will be 30.

Ive corrected your file, when the movie loads, it displays the current day message.

---

<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:** [August 1, 2003, 4:51pm UTC](https://forum.kirupa.com/t/getdate-and-setproperty/27271/10 "2003-08-01T16:51:36Z")

</div>

Hi there

You are kind to do this. Thank you.

I understand now: m=1 or \<=31 and everything in between because it adds 1 until it hits 31. "today’ wins because of the heirarchy.

Thanks again!:beam:  
OGM

---

<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:** [August 1, 2003, 4:52pm UTC](https://forum.kirupa.com/t/getdate-and-setproperty/27271/11 "2003-08-01T16:52:59Z")

</div>

You’re welcome =)
