ActionScript 3.0, Adobe Flex

The "initCompleteHandler" function is protected in the FX4 DownloadProgressBar

Great news for all of us implementing Custom Preloaders…

Instead of having a private “initCompleteHandler” function on the DownloadProgressBar, the function is now protected so we can override it in custom implementations. This means that we no longer have to implement the IPreloaderDisplay interface and hack out a lot of the intended functionality in order to have the preloader also handling the load of the application logic so that it does not change to Application View until the Application is considered to actually be ready.

This is great news… making the DownloadProgressBar a lot better… now it all seems like just need some kind of “preventDefault” behavior in order to have total control over the switch from preloader to application without having to bloat the preloader itself…

Currently I am resorting to including either classes such as the PureMVC facade, a Mate eventmap or another kind of EventAggregator into the Preloader SWF in order to be able to hook into it… this is however only possible if you also hack a bit around in order to prevent the default switch from preloader to application.

One thought on “The "initCompleteHandler" function is protected in the FX4 DownloadProgressBar

  1. How to override this function correctly for s:WindowedApplication (air). I get this error:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at spark.components::WindowedApplication/enterFrameHandler()[E:\dev\4.0.0\frameworks\projects\airspark\src\spar k\components\]

    Almost lost all of my hair because of this problem 🙂

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s