The clock is ticking
This little application was born out of the desire to see how long it was going to be until my big overseas trip in September. We’ve all seen countdown timers which tell us the number of minutes until the next MAX conference or the next release of flex builder, but I wanted something bigger… something better…
I know, I know, online countdown timers are a dime a dozen. So this is certainly nothing new or ground breaking. But I think it offers an improvement over most of the ones out there. For a start, there’s no server-side code, and no needing to embed a tag in your website. This isn’t for website publishers to tell you what they are holding out for, this is for you. Dates are stored as a local shared object (flash cookie) so when you go back to the site, your times are simply there.
Secondly, it goes full screen, so you feel like a badass movie villain when you break out your laptop on the plane with your full screen red letter countdown. Until you get arrested.
Even if you don’t enjoy it, maybe your kids will have fun seeing how long it is until their birthday.
Check it out here
Posted in Flex Applications | 12 Comments
June 30th, 2007 at 10:06 pm
That’s pretty cool.
Any chance you could make the souce available? I’m really curious to know how you make a flex app go full screen
June 30th, 2007 at 10:51 pm
Hi Tony,
The fullscreen code is pretty simple. It’s actually just the line:
stage.displayState = StageDisplayState.FULL_SCREEN;
There are a few caveats though, the function setting the display to full screen can only be in response to a user mouse or keyboard event. All text input fields are disabled in full screen mode, and you need to give the swf permission to go full screen from within the HTML page it’s loaded from. In flex that usually means adding the pair
‘allowFullScreen’,'true’,
to the parameters of the AC_FL_RunContent function in your page. Note that this function is called twice in the standard generated HTML that Flex builder spits out, you want to add it to the call after:
else if (hasRequestedVersion) {
There is an article in livedocs about this I think
July 7th, 2007 at 12:16 am
Hi Alex,
Let me know when in Dublin and we can meet to discuss and get multimedia programmers to meet you.
Thanks, Fred
July 13th, 2007 at 10:35 pm
hey fella,
any chance of this app being made available offline, using AIR or whatever? Also, when you get a chance I need to pick your brains regarding a sweet GUI for 4th year project if that’s cool…chat soon.
Dave
August 28th, 2007 at 1:33 pm
Hi
Could you email me the source code for the countdown timer?
Thanks
- S
September 6th, 2007 at 5:40 am
Hi,
Im interested in the source too, Id like to know how you managed to keep the countdown timer processing in the background while the pop-up was up. Ive been trying to figure out how to put up a please-wait message while some client-side processing is going on….
Thanks
Santiago
September 6th, 2007 at 8:25 pm
The way flash player works (to my knowledge) is that each frame gets to execute all the code that is scheduled to execute on that frame, before a frame timeout occurs.. The countdown timer processing is done with an instance of the Timer class. This fires every 100th of a second or so with code something like
var timer:Timer = new Timer(10,0);
timer.addEventListener(TimerEvent.TIMER,onTimerTick);
timer.start();
The popup is a UIComponent that is popped up via PopupManager.createPopup(), which creates an instance of the control box, but the onTimerTick() method continues to b called every 10ms, regardless of what else is happening in the app. In essence, Flash player is a multi-threaded runtime that presents a single thread of execution, so multithreaded-type stuff like this is possible, but you really don’t have to worry about it.
-Alex
November 9th, 2007 at 6:28 pm
nice work&good idea.i want to ask you if you implement it via a local sharedobject.
November 9th, 2007 at 8:23 pm
Yeah, everything is stored in local shared objects for simplicity’s sake. Of course this means you can’t get your times on another computer.
December 30th, 2007 at 11:12 am
Shame that I live so far, but ill try it again and write you next comment.
July 8th, 2008 at 11:43 pm
Hi, Cool App, Can I get the source code please…Would be really interested to see the code behing it…
Thanks
May 25th, 2009 at 11:01 pm
Hey, Can you send me the source code please…!!