Adobe Solution Partner

January 17, 2008

Flex Not-So Custom Preloader

Filed under: Flex & Flash — Tags: — Shannon Hicks @ 12:11 pm

Today I got a request to change the “Loading” text in the preloader of a Flex app. To my surprise, I didn’t see any examples on how to do this, so I thought I’d share my results.

When you like the existing preloader, but want to just make little tiny changes to it, here’s what you do. You’ll first need to go ahead and create a custom preloader class that extends DownloadProgressBar (the default preloader). In this new class, you’ll see the spot where you can just make tweaks to the preloader’s values:

package org.iotashan.components
{
    import mx.preloaders.DownloadProgressBar;

    public class CustomPreloader extends DownloadProgressBar
    {
        public function CustomPreloader()
        {
            super();
            // set your properties here
            this.downloadingLabel = "Getting the hampster to run on the wheel";
        }
       
    }
}

Once you’ve created this custom preloader, you just have to assign it to your application:

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" preloader="org.iotashan.components.CustomPreloader">

That’s it. Check out the live example here.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • StumbleUpon
  • Technorati
  • TwitThis

4 Comments »

  1. Here you have an old example:

    http://www.madeinflex.com/2007/05/14/como-construir-un-preloader-propio/

    Cheers

    Comment by Raul Diaz — January 17, 2008 @ 12:00 am

  2. Here’s another one that I’ve used to make some nice non-flex looking preloaders.

    http://www.onflex.org/ted/2006/07/flex-2-preloaders-swf-png-gif-examples.php

    Comment by Paul Rangel — January 17, 2008 @ 12:00 am

  3. thank u very much i was looking for the same

    Comment by raghavendra — September 12, 2008 @ 12:00 am

  4. I created my custom preloader using code from this article. Was pretty easy :
    http://askmeflash.com/article_m.php?p=article&id=7

    Comment by Alex — April 22, 2009 @ 2:45 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

 

Server Down?

Maximize Web application uptime by drawing upon Webapper's years of experience tuning and stabilizing many of the world's largest ColdFusion Web applications. Contact us today!