Help on moving frames with new Date()
i'm beginer , need help. trying move frames accordind hour, example: @ 7 @ frame 1 , @ 8 @ frame 10. have code moves frames every 1 hour need move half hour. instance: @ 7 frame 1, @ 7:30 frame 5, , @ 8 frame 10. code have far moves ever hour:
// new date object
mydate = new date();
myhour = mydate.gethours();
_root.onload = function() {
switch (myhour) {
//this start @ 7 , end @ 6 am
case 7 :
trace("it's 7:00 am");
switcher_mc.gotoandstop(1);
break;
case 8 :
trace("it's 8:00 am");
switcher_mc.gotoandstop(3);
break;
case 9 :
trace("it's 9:00 am");
switcher_mc.gotoandstop(5);
break;
case 10 :
trace("it's 10:00 am");
switcher_mc.gotoandstop(7);
break;
and on till 6 am. see need half hours frames.
i appreciate help.
thanks in advance
pao pao
you'll need check date instance's getminutes() property , navigate frame want based on both gethours() , getmintutes() properties.
More discussions in ActionScript 1 and 2
adobe
Comments
Post a Comment