# Using DateField to load images by date selected

**URL:** <https://forum.kirupa.com/t/using-datefield-to-load-images-by-date-selected/227033>\
**Category:** flash\
**Created:** [May 26, 2007, 3:53am UTC](https://forum.kirupa.com/t/using-datefield-to-load-images-by-date-selected/227033 "2007-05-26T03:53:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![luisito](https://avatars.discourse-cdn.com/v4/letter/l/9fc29f/32.png) [@luisito](https://forum.kirupa.com/u/luisito)\
**Post date:** [May 26, 2007, 3:53am UTC](https://forum.kirupa.com/t/using-datefield-to-load-images-by-date-selected/227033/1 "2007-05-26T03:53:00Z")

</div>

Hello!  
I need to know how can I use the DateField Component in a way that when I choose a date it loads an image from a directory into a MovieClip using the loadMovie command.

For Example: In the scene I have a MovieClip that initially loads the “Picture of the Day”, there also I have the DateField component to show today’s date, but I also want to use the DateField for the visitors to choose any other date back from today to see the previous “Picture of the Day” for each past day.

I have tried to load a picture but only when DateField detects a date change but not with specific dates, that is:

In the First Frame I have:  
[COLOR=“blue”]mcPicture.loadMovie(“picture1.gif”);[/COLOR]

To the DateField instance set this code:  
[COLOR=“Blue”]on (change) {  
\_root.mcPicture.loadMovie(“picture2.gif”);  
}[/COLOR]  
This way it works but with any date I choose,

Then I try this way for the DateField component:  
[COLOR=“Blue”]on (change) {  
var date:Date = new Date(2007,4,23);  
if (date == selectedDate){  
\_root.mcPicture.loadMovie(“picture2.gif”);  
}[/COLOR]

but it doesn’t work.

Please help me if you can, I need that in this week.
