Flex Preloaders with Potomac
Just like any Flex application, a Potomac application may have a custom preloader. But Potomac does its own initialization after the standard Flex preloading phases are complete. Therefore, Potomac provides an enhanced preloading capability that extends existing preloaders and keeps them visible until all Potomac initialization is complete.
To participate in Potomac’s enhanced preloading, a Flex preloader should implement IPotomacPreloader. This interface has no methods and is only used to mark your preloader so Potomac knows to perform it’s extended processing. Potomac does two things to an IPotomacPreloader. First, after the standard preloading phases are complete, Potomac will grab a reference to the preloader, allow Flex to remove it from the Flash stage, then Potomac will add the preloader back to the display as a child of the Flex application. This happens seamlessly and to the user the preloader is always visible. At this point, Potomac will begin its initialization code and will dispatch new BundleEvents on the preloader as it occurs. The preloader will receive all bundle events including BundleEvent.BUNDLES_INSTALLING, BundleEvent.BUNDLE_PROGRESS, BundleEvent.BUNDLES_PRELOADING, and more. The preloader should use these events to display bundle progress information. When all Potomac initialization is complete, a StartupEvent.PRELOADER_CLOSE_START event will be dispatched on the preloader. This notifies the preloader that it may begin any final animation or effect. When the preloader is ready to be disposed, it must dispatch a StartupEvent.PRELOADER_CLOSE_COMPLETE event on itself.
Please see the PotomacAdvancedExample application for an example of this feature.

