我有我的AIR應用程序,即MyAIRApplication準備就緒。我正在嘗試爲它啓動一個啓動畫面。 這裏是我到目前爲止的代碼..AIR應用程序
main.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="showSplash()"
visible="false"
layout="absolute"
showFlexChrome="false">
<mx:Script>
<![CDATA[
import components.Splash;
import mx.core.Window;
import mx.controls.Alert;
import mx.events.AIREvent;
private var splash:Window;
private var splashTimer:Timer;
private function showSplash():void {
splash = new Splash();
splash.systemChrome = "none";
splash.transparent = true;
splash.type = NativeWindowType.LIGHTWEIGHT;
splash.addEventListener(AIREvent.WINDOW_COMPLETE, boot);
splash.open();
}
private function boot(event:AIREvent):void {
splashTimer = new Timer(3000, 2);
splashTimer.addEventListener(TimerEvent.TIMER_COMPLETE, showApp);
splashTimer.start();
this.removeEventListener(AIREvent.WINDOW_COMPLETE, boot);
}
private function showApp(event:Event):void {
splash.close();
splash = null;
splashTimer.stop();
splashTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, showApp);
splashTimer = null;
// My Application .. where I wrote all components
var mainWin:WindowedApplication = new MyAIRApplication();
mainWin.activate();
mainWin.visible = true;
}
]]>
</mx:Script>
</mx:WindowedApplication>
Splash.mxml:
<?xml version="1.0" encoding="utf-8"?>
<mx:Window xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="400" height="300"
showFlexChrome="false" >
<mx:Image x="0" y="0" width="600" height="400" source="@Embed('../images/splash-bg.png')" scaleContent="false"/>
</mx:Window>
但我現在面臨兩個問題:
- 我的AIR應用程序(即MyAIRA應用程序)沒有顯示出來,完成啓動畫面。
- 我閃屏越做越左上角顯示總是
誰能請我提供解決方案嗎?