I dont see why not.
the only thing you'd really have to do is figure out how many 'weeks' its been..and then show a 2, 6, 12, 18, 48...week image...correct?
the date class is a little lacking but you might be able to use it..
if not..maybe a custom class like xDate or something.. has a few more features/functions for you to use..
actually this should work for you
you'll obviously have to take the vars at top and grab them from an input field or drop down box or however you plan in getting the data from the 'parent'..
you'll obviously have to add in the load image portion yourself..Im not sure if you want to get url..or load the image into a specific container clip... using a movieClipLoader() instance or what..
PHP Code:
var conMonth:Number = 0; //0 = January
var conDay:Number = 1;
var conYear:Number = 2009;
var conDate = new Date(conYear, conMonth, conDay);
var currDate = new Date();
//convert difference in milliseconds to days
var inDays = Math.floor((currDate - conDate) / 86400000);
//convert difference of days to weeks
var inWeeks = inDays/7;
//output
trace("DAYS: "+inDays);
trace("WEEKS: "+inWeeks);
trace("ROUNDED: "+Math.round(inWeeks));
switch (Math.round(inWeeks)) {
case 0 :
trace("Baby @ 0 weeks");
trace("No image availabe for this time frame");
break;
case 1 :
trace("Baby @ 1 week");
break;
case 2 :
trace("Baby @ 2 weeks");
break;
case 3 :
trace("Baby @ 3 weeks");
break;
case 4 :
trace("Baby @ 4 weeks");
break;
default :
trace("No image available for this time frame..invald timeframe");
}