2012-11-22 73 views
3

我已经开发了一个应用程序在AS3和Starling被移植到IOS。我已经更新了Default.png图片,这个工程很棒,但是我的应用程序需要一段时间才能加载,并且显示一个黑屏约3-4秒。Starling AS3 IOS启动画面

我已到处寻找解决方案,但无法找到任何工作。有人有一个工作解决方案吗?

非常感谢

回答

5

我不确定目前是否有更好的解决方案,但我所做的是将默认屏幕的位图添加到本机Flash阶段。然后,当Starling准备就绪时,我将删除位图。

所以你实例八哥之前,位图图像添加到舞台(这将是闪存阶段)

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

然后实例,并开始椋鸟。例如

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(); 
}); 

在你的根八哥类(在本例中是主),使用ADDED_TO_STAGE监听器,这被触发时,删除该位图。

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; 
} 

在上面的例子中,根文档类被称为'启动'。

+1

很棒!谢谢 – puks1978

1

如上所述通过docs有为Default.png用作在IOS初始屏幕。

+0

我已经更新了Default.png,但启动过程中仍然有3-4秒的黑屏。我正在使用Starling Framework和Air 3.2 – puks1978