# Play effect on particular day

**URL:** <https://forum.kirupa.com/t/play-effect-on-particular-day/65904>\
**Category:** Uncategorized\
**Created:** [September 30, 2004, 2:37pm UTC](https://forum.kirupa.com/t/play-effect-on-particular-day/65904 "2004-09-30T14:37:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![as\_clark20](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@as\_clark20](https://forum.kirupa.com/u/as_clark20)\
**Post date:** [September 30, 2004, 2:37pm UTC](https://forum.kirupa.com/t/play-effect-on-particular-day/65904/1 "2004-09-30T14:37:52Z")

</div>

I want to put a twist on Kirupas excellent snow fall tutorial…

Say I design multiple movieclips (snow for Christmas, pumpkins for halloween, fireworks for bonfire night etc) can I use AS to detect the users local date and call the relevant symbol to rain down?

This would also save me having to design and post a different SWF every occasion! I could design for lots of occasions.

Any ideas?

Ads.

---

<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:** [September 30, 2004, 8:48pm UTC](https://forum.kirupa.com/t/play-effect-on-particular-day/65904/2 "2004-09-30T20:48:03Z")

</div>

Something like this should work

[AS]  
var d=new Date(2004,10,31);  
var d2=new Date(2004,10,31);  
if(d.toString()==d2.toString())  
trace(“it’s holloween!”);  
[/AS]

---

<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:** [September 30, 2004, 9:23pm UTC](https://forum.kirupa.com/t/play-effect-on-particular-day/65904/3 "2004-09-30T21:23:12Z")

</div>

Wouldn’t that make every day “holloween”?

---

<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:** [October 1, 2004, 8:15am UTC](https://forum.kirupa.com/t/play-effect-on-particular-day/65904/4 "2004-10-01T08:15:15Z")

</div>

Just tried a few variations myself, there must be something we’re missing somewhere along the line I mean its not a hard thing to do when you think about it.

If Halloween (2004, 10, 31) is the same as Todays date then move “MonthClip” to a specific frame. I hate when seemling simple things end up complex!!

me.

---

<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:** [October 1, 2004, 7:46pm UTC](https://forum.kirupa.com/t/play-effect-on-particular-day/65904/5 "2004-10-01T19:46:32Z")

</div>

Huzzah, here it works 🙂

[AS]  
var now = new Date();  
var release = new Date(2004, 10, 31);  
if (now.getTime() \<= release.getTime()) {  
trace(“its Halloween!”);  
}  
[/AS]

**edit:** I just re-tested it, and it didn’t work ☹ I’ll keep working on it; this seems so easy, it’s annoying, lol.

---

<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:** [October 1, 2004, 8:11pm UTC](https://forum.kirupa.com/t/play-effect-on-particular-day/65904/6 "2004-10-01T20:11:43Z")

</div>

Alright, here it is for the last time…this definetley works

[AS]  
onClipEvent (load) {  
var myDate = new Date();  
var myMonth = myDate.getMonth();  
var myDay = myDate.getDate();  
var myYear = myDate.getFullYear();  
if (myDay == 31 && myMonth == 9 && myYear == 2004) {  
trace(“it’s Halloween!”);  
}  
}  
[/AS]

:hugegrin:

**edit:** used virus’ suggestion and edited 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:** [October 2, 2004, 12:49am UTC](https://forum.kirupa.com/t/play-effect-on-particular-day/65904/7 "2004-10-02T00:49:54Z")

</div>

it works… but it’s not a good ideea tu put this on an enterFrame event. onClipEvent(load)… should do the trick

> If Halloween (2004, 10, 31) is the same as Todays date then move “MonthClip”[color=red](do you mean the one with the snow?)[/color] to a specific frame. I hate when seemling simple things end up complex!!

This is a good solution… Have you implemented it ? We (as in me) wanna to see 😃

---

<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:** [October 2, 2004, 2:21am UTC](https://forum.kirupa.com/t/play-effect-on-particular-day/65904/8 "2004-10-02T02:21:49Z")

</div>

ah, your’e right, virusescu 🙂

and i would also love to see it in action 🙂
