Blograby

Splash Screen

Adobe has made it very easy to add a splash screen to your application. A splash screen is an image that loads first and displays while the application is loading. There are several options for the display of this splash screen, but let’s look at a basic sample, which shows the splashScreenImage property being set to a .png image. Figure 6-10 shows a splash screen with the default settings:

<?xml version=”1.0″ encoding=”utf-8″?>
<s:Application xmlns:fx=”http://ns.adobe.com/mxml/2009″
xmlns:s=”library://ns.adobe.com/flex/spark”
splashScreenImage=”@Embed(‘happytoad.png’)”>
<fx:Declarations>
<!– Place non-visual elements (e.g., services, value objects) here –>
</fx:Declarations>
</s:Application>

There are also some options that can be set on the splash screen. Applying the splash ScreenMinimumDisplayTime and splashScreenScaleMode properties to the Application, ViewNavigatorApplication, or TabbedViewNavigatorApplication tags sets these options. The example below sets the display time to 3 seconds and the scale mode to stretch.

The available options for the splashScreenScaleMode property are letterbox, none, stretch, and zoom. Figure 6-11 shows a splash screen with the splashScreenScaleMode set to stretch:

<?xml version=”1.0″ encoding=”utf-8″?>
<s:Application xmlns:fx=”http://ns.adobe.com/mxml/2009″
xmlns:s=”library://ns.adobe.com/flex/spark”
splashScreenImage=”@Embed(‘happytoad.png’)”
splashScreenMinimumDisplayTime=”3000″
splashScreenScaleMode=”stretch”>
<fx:Declarations>
<!– Place non-visual elements (e.g., services, value objects) here –>
</fx:Declarations>
</s:Application>

Exit mobile version