Question

I have developed an app in AS3 and Starling to be ported to IOS. I have updated the Default.png image and this works great however my app takes a while to load and a black screen is shown for about 3-4 seconds.

I have looked everywhere for a solution but couldn't find any that work. Does someone have a working solution?

Many thanks

Was it helpful?

Solution

I'm not sure if there is a neater solution at the moment but what I do is add a bitmap of the default screen to the native flash stage. Then when Starling is ready I remove the bitmap.

So before you instantiate Starling, add the bitmap image to the stage (this will be the Flash stage)

public static var _splash:Bitmap;
//load or embed your bitmap//
addChild(_splash);

Then instantiate and start Starling. e.g.

myStarling = new Starling(Main, stage, null, null, Context3DRenderMode.AUTO, Context3DProfile.BASELINE);
myStarling.stage3D.addEventListener(starling.events.Event.CONTEXT3D_CREATE, function(e:flash.events.Event):void {
// Starling is ready!
myStarling.start();
});

In your root Starling class (in this example it's Main), use an ADDED_TO_STAGE listener and when this is triggered, remove the bitmap.

public function Main() {    
addEventListener(starling.events.Event.ADDED_TO_STAGE, onAdded);
}

private function onAdded ( e:starling.events.Event ):void {
StartUp._splash.parent.removeChild(StartUp._splash);
StartUp._splash = null;
}

In the example above the root document class is called 'StartUp'.

OTHER TIPS

As described by docs there is Default.png used as splash screen in iOS.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top