Today I've came up with such a problem. How to center default preloader in Adobe AIR app (assuming that app starting size is not default).
After digging through Flex SDK, I've found a solution:
After digging through Flex SDK, I've found a solution:
// handler for preinitialize event in s:windowedApplication tag
public function preinitializeHandler(event:Event):void
{
centerPreloader();
}
// set nativeWindow.width & height in your app descriptor file
private function centerPreloader():void
{
var preloader:Preloader =
systemManager.mx_internal::preloader as Preloader;
if(preloader)
{
var preloaderDisplay:IPreloaderDisplay
= preloader.getChildAt(0) as IPreloaderDisplay;
preloaderDisplay.stageWidth = nativeWindow.width;
preloaderDisplay.stageHeight = nativeWindow.height;
}
}