• Home
  • About Me
  • Contact

Better Than Flex

Category:

  • Flex Applications
  • Flex Components
  • Uncategorized

Archives:

  • October 2007
  • August 2007
  • June 2007
  • May 2007
  • April 2007

Blogroll:

  • Outsmart Labs
  • Tony Fendall
  • XSive blog

Meta:

  • RSS
  • Comments RSS
  • Valid XHTML
  • XFN

The clock is ticking

June 28th, 2007 by Alex

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

12 Responses

  1. Tony Says:
    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 :)

  2. Alex Says:
    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

  3. Fred Herrera Says:
    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

  4. David Says:
    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

  5. Santosh Says:
    August 28th, 2007 at 1:33 pm

    Hi

    Could you email me the source code for the countdown timer?

    Thanks
    - S

  6. Santiago Says:
    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

  7. Alex Says:
    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

  8. ouyang Says:
    November 9th, 2007 at 6:28 pm

    nice work&good idea.i want to ask you if you implement it via a local sharedobject.

  9. Alex Says:
    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.

  10. Niechorze Says:
    December 30th, 2007 at 11:12 am

    Shame that I live so far, but ill try it again and write you next comment.

  11. rambabu Says:
    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

  12. Nits Says:
    May 25th, 2009 at 11:01 pm

    Hey, Can you send me the source code please…!!

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

 
Wordpress Themes by and Website Templates by Blogcut