I would like to have my flash movie load specific images from external swf files based on the time of day like morning, afternoon, evening, and late night. I can do this in Javascript as such

script language="JavaScript"
function writeImageTag() {
var today = new Date();
var day = today.getDay();
var hours = today.getHours();
if (((day > 0) && (day < 6)) && ((hours > 21))) {
document.myPicture.src = "media/images/wdlate.jpg"

and so on. How can this be done in flash?