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.

Help make me popular:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • Pownce
  • Slashdot
  • StumbleUpon

This entry was posted on Thursday, January 17th, 2008 at 1:11 pm and is filed under Syndicated. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply