Flex Not-So Custom Preloader

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:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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:

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

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

Welcome to my new site!

I’ve finally given in and started my own blog. Nobody’s going to read it, but I needed somewhere to post stuff not appropriate for the Webapper blog. I’m not entirely sure what all I’m going to do here, but I guess I can do anything I like since nobody’s reading 🙂

I also re-designed my site. Since I’ve been doing nearly 100% Flex development for over a year now, I figured that I should eat my own dog food. Yes, this blog isn’t in Flex, but I’d rather that search engines pick it up.

I’ll be adding to and refining the site over time. I’ll probably start with re-skinning the blog from the default blogCFC colors.