Hi there. I'm trying to do something that seems simple enough, but I'm a bit stuck. I'd like to run a function that is simply calling a gotoAndStop command within a movieclip when it reaches a certain time of day in EST. So for example, the movieclip would be on frame 1 until 2:30pm EST and then it would gotoAndStop frame 2 within movieclip, let's call the instance name of movieclip "matchup_mc" - I've tried a few things and no luck. Anyone wanna bail me out here?
Here is the code I have so far - isn't quite working
Code:var eventDate:Date = new Date(); eventDate.setHours( 14, 30 ); var now:Date = new Date(); var delay:Number = eventDate.time - now.time; if( delay > 0 )//if we haven't yet passed 14:30 { var timer:Timer = new Timer( delay , 1 ); timer.addEventListener( TimerEvent.TIMER , changeTime ); timer.start(); } function changeTime():void{ matchup_mc.gotoAndStop("change"); }




Reply With Quote