# Flash MX Question

**URL:** <https://forum.kirupa.com/t/flash-mx-question/12474>\
**Category:** flash\
**Created:** [January 31, 2003, 6:22pm UTC](https://forum.kirupa.com/t/flash-mx-question/12474 "2003-01-31T18:22:21Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjULTRA](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@mjULTRA](https://forum.kirupa.com/u/mjULTRA)\
**Post date:** [January 31, 2003, 6:22pm UTC](https://forum.kirupa.com/t/flash-mx-question/12474/1 "2003-01-31T18:22:21Z")

</div>

I am attempting to create a Flash Applet that checks for the day, and then loads a dynamic swf depending on the return date. First of all, what AS could i use to get this accomplished?

I’ve considered using the getDate function, and then simple if/then statements to determine where to go from there. Basically, it would determine whether or not it is sunday, and then send the user to either one of one two places, depending on the day. Im no actionscripting guru, but i think it would be something like: getDate: if Sunday then go to 1.swf, and if Monday-Saturday, go to 2.swf.

What would the AS code for this look like? :bounce:

Thanks in advance, the Microwave Burrito

---

<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:** [January 31, 2003, 7:57pm UTC](https://forum.kirupa.com/t/flash-mx-question/12474/2 "2003-01-31T19:57:24Z")

</div>

BUmp…

Im trying to think of something now.

---

<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:** [January 31, 2003, 8:00pm UTC](https://forum.kirupa.com/t/flash-mx-question/12474/3 "2003-01-31T20:00:01Z")

</div>

Here is a basic FLA that gets the date, and displays the day of the week. How can i add code to make the movie go to different places depending on the day? Any help would be appreciated…

:crazy:

---

<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:** [January 31, 2003, 8:02pm UTC](https://forum.kirupa.com/t/flash-mx-question/12474/4 "2003-01-31T20:02:44Z")

</div>

Alright, I came up with this, it should work…

```php
dayArray = ["sun.swf", "mon.swf", "tue.swf", "wed.swf", "thur.swf", "fri.swf", "sat.swf"];
newDate = new Date();
day = newDate.getDay();
_root.container.loadMovie(dayArray[day]);

```

[edit]oh, and you posted… lol, let me check that out[/edit]

---

<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:** [January 31, 2003, 8:04pm UTC](https://forum.kirupa.com/t/flash-mx-question/12474/5 "2003-01-31T20:04:43Z")

</div>

Yeah, try what I did above.

---

<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:** [January 31, 2003, 9:38pm UTC](https://forum.kirupa.com/t/flash-mx-question/12474/6 "2003-01-31T21:38:43Z")

</div>

Thanks a lot Shane, this is exactly what i need. Once i get the whole thing worked out, i will share with the board my final result.

Help like this is invaluable, and is always found at [KirupaForum.com](http://KirupaForum.com).

Thanks again! 🙂

---

<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:** [January 31, 2003, 9:58pm UTC](https://forum.kirupa.com/t/flash-mx-question/12474/7 "2003-01-31T21:58:12Z")

</div>

No problem Majeye, I am glad I could help 🙂

---

<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:** [January 31, 2003, 10:23pm UTC](https://forum.kirupa.com/t/flash-mx-question/12474/8 "2003-01-31T22:23:50Z")

</div>

This applet could not have been created without LostInBeta’s help.

Once it is completed and implemented, i will come back here and add a link to it…

As of now its pretty basic, but i will be adding more animation, and more options as this project begins to take full shape.

If it is not sunday, and you would like to see what would happen if it was, you can (in Windows) right-click on the clock in the taskbar, and choose, ‘Adjust Date/Time.’ Click on any sunday on the calender, and then choose the apply button. Reload the flash, and marvel at the results… Be sure to change back to your original date before closing the Date/Time Properties box.

which brings me to my next question…

considering the fact that anyone with computer knowledge can accomplish this little bypass, is there a way to get the time and date without using the local system time on the client side? The idea is to allow only Sunday visitors of the page to order the specials…

Kirupa Rocks! :ub:

---

<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:** [January 31, 2003, 10:27pm UTC](https://forum.kirupa.com/t/flash-mx-question/12474/9 "2003-01-31T22:27:50Z")

</div>

Pretty cool Maj.

You use UTC time (Universal) like this…

```php
dayArray = ["sun.swf", "mon.swf", "tue.swf", "wed.swf", "thur.swf", "fri.swf", "sat.swf"];
newDate = new Date();
day = newDate.getUTCDay();
_root.container.loadMovie(dayArray[day]);

```

It checks the universal day instead of the users day.

---

<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:** [January 31, 2003, 10:31pm UTC](https://forum.kirupa.com/t/flash-mx-question/12474/10 "2003-01-31T22:31:57Z")

</div>

■■■■ your quick…

again thanks.

:hair: \<—Lost kicks AS! (actionscripting of course…)

---

<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:** [January 31, 2003, 10:34pm UTC](https://forum.kirupa.com/t/flash-mx-question/12474/11 "2003-01-31T22:34:30Z")

</div>

LOL, no problem man.

My very first thing in Flash was a clock. My first post at this forum was when I posted a clock tutorial that I wrote the day after I started AS…lol. Dates were real easy to learn because it is like exactly the same in Javascript (which I knew before AS).
