Wednesday, November 28, 2007

Day of the Week Flash & how to do it.



Something's been going on with my computer the last week or two, possibly a virus, mainly just in Flash, but then I remembered about restoration points. In Windows, and probably Mac too, you can revert to an earlier time with your computer which seemed to solve all the goofiness Flash was testing me with.

Let me know if you're not seeing the current day of the week. This was based on a tea towel set I saw on the Internet. Better than a day of the week panties set, right?

Here's all the code you need for this, if the movie clip has an instance name of chick, and there are seven images in the movie clip. (Flash starts counting the day of the week from 0, so you have to add one on.)

var my_date:Date = new Date();
var ournow:Number=my_date.getDay();
ournow+=1;
chick.gotoAndStop(ournow)

If you were going to do this for a blogger header, you might want to work with loadMovie instead. I'll try to get that working next week. I'll be seeing my chickens again on Monday.

1 comment:

Linda said...

Wonderful!
Perfect!