logo

A Simple Flex Loading/Mask Component

For ages I searched for a Flex class that would let me blur the screen and show the user a modal message telling them to wait while something happened. In the end I gave up looking and wrote a little ActionScript class that's much like the Alert class. Here's a demo:

To use it is as simple as this:

Mask.show("Please wait...");

When you're done you do this:

Mask.close();

Nice and simple. Here's the code. You can see it in use in the Workspace demo too.

Comments

  1. Nice - I will be using this.

    Thanks

    • avatar
    • Finn Knudsen
    • Wed 28 Apr 2010 05:27 AM

    Nice, thanks for sharing

  2. Do you have a timeframe as to when you will share the 'Workspace' app?

      • avatar
      • Jake Howlett
      • Wed 28 Apr 2010 07:42 AM

      Some time between now and never. Who knows. Three kids don't leave me much time for stuff like that.

      Show the rest of this thread

  3. Slick. Going straight into the toolbox!

  4. Hi Jake,

    Good code!

    And as always, thanks for sharing !

    ;)

    • avatar
    • Xander
    • Thu 29 Apr 2010 06:49 AM

    Hi Jake,

    Being a bit new to flex, can you use your loading mask when an app first loads itself in a web page?

    If so, would you put the Mask.Show("Please wait...") code in the pre-initialiser and the Mask.close() in the creationcompleted events?

      • avatar
      • Jake Howlett
      • Thu 29 Apr 2010 07:16 AM

      Hi Xander,

      Do you mean you want to replace the standard Flex "loading" interface? You can do that but I'm not sure how.

      Show the rest of this thread

    • avatar
    • vijesh
    • Wed 4 Aug 2010 09:26 PM

    thanks for your code,nice work

    • avatar
    • bigt
    • Tue 9 Nov 2010 01:52 AM

    tiny and very useful, thanks a lot

  5. Just the trick, cheers!

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:


About This Page

Written by Jake Howlett on Wed 28 Apr 2010

Share This Page

# ( ) '

Comments

The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

More Content