# Loading different pictures based on time of day

**URL:** <https://forum.kirupa.com/t/loading-different-pictures-based-on-time-of-day/107622>\
**Category:** Uncategorized\
**Created:** [April 17, 2004, 4:13am UTC](https://forum.kirupa.com/t/loading-different-pictures-based-on-time-of-day/107622 "2004-04-17T04:13:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pneumonic](https://avatars.discourse-cdn.com/v4/letter/p/aeb1de/32.png) [@Pneumonic](https://forum.kirupa.com/u/Pneumonic)\
**Post date:** [April 17, 2004, 4:13am UTC](https://forum.kirupa.com/t/loading-different-pictures-based-on-time-of-day/107622/1 "2004-04-17T04:13:09Z")

</div>

Hello again everyone. Here’s the sit. I’m trying to load a different .gif file based upon the time of day. I figured what I wrote would work, but alas, I was wrong. Here’s what I got:

```auto

files=["sunrise.gif", "morning.gif", "midday.gif",
	   "afternoon.gif", "twilight.gif", "night.gif"]

var currentHour:Number = myDate.getHours();
var currentMin:Number = myDate.getMinutes();
var currentSec:Number = myDate.getSeconds();
function pictureRotate(){
	if ((currentHour>21)&(currentHour<6)){
		loadMovie("night.gif", "_root.main");
	}else if ((currentHour>6)&(currentHour<9)){
		loadmovie("sunrise.gif", "_root.main");
	}else if ((currentHour>9)&(currentHour<12)){
		loadmovie("morning.gif", "_root.main");
	}else if ((currentHour>12)&(currentHour<15)){
		loadmovie("midday.gif", "_root.main");
	}else if ((currentHour>15)&(currentHour<18)){
		loadmovie("afternoon.gif", "_root.main");
	}else{
		loadmovie("twilight.gif", "_root.main");
	}
}

```

I know I can take out that first array, and I do believe I can take out the minutes and seconds, but I left the code as is, in case I screwed it all up. Oh and the pictures have no paths because I imported them into the actual .fla. Thanks for the help ahead of time!
