Search

 

November 2010
S M T W T F S
« Oct   Dec »
 123456
78910111213
14151617181920
21222324252627
282930  

Tags

Archives


« | Main | »

AIR on Android: Splash Screen

By Rich Tretola | November 9, 2010
21,144 views

Here is a short but sweet little post. The fine folks at Adobe has made it super simple to add a splash screen to your AIR on Android application. Simply add the splashScreenImage property to your <s:MobileApplication/>.

Here is a basic example:

1
2
3
4
5
6
7
8
9
<?xml version="1.0" encoding="utf-8"?>
<s:MobileApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                     xmlns:s="library://ns.adobe.com/flex/spark"
                     firstView="views.SimpleSplashHome"
                     splashScreenImage="@Embed('happytoad-white.png')">
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
</s:MobileApplication>

The results are:

Splash with default settings:



There are a few additional properties that you can set for the splash screen.
splashScreenMinimumDisplayTime: defaults to 1000 miliseconds

splashScreenScaleMode: defaults to none, other options are (letterbox, stretch, and zoom) shown below:


splashScreenScaleMode=letterbox:


splashScreenScaleMode=stretch:


splashScreenScaleMode=zoom:


Topics: Adobe AIR, android, Flex, Flex 4, Flex Builder | 9 Comments »

9 Responses to “AIR on Android: Splash Screen”

  1. Marvin Blase Says:
    November 10th, 2010 at 6:21 am

    Here’s some extra commentary by Adobe concerning this:

    The property has effect only when the preloader is set to

    1
    spark.preloaders.SplashScreen

    .

    * The

    1
    spark.preloaders.SplashScreen

    class is the default preloader for Mobile Flex applications.

    Reply to this comment

  2. Marvin Blase Says:
    November 10th, 2010 at 6:31 am

    oh, could you replace the last lines with these:

    This property cannot be set by ActionScript code; it must be set in MXML code.

    ? points better to what i was trying to say :)

    Reply to this comment

  3. Lukasz 'Severiaan' Grela Says:
    November 10th, 2010 at 10:18 am

    Hi,
    is there an ActionScript counterpart?
    and on what version of Android and AIR it is supported?

    Reply to this comment

  4. Sidney de Koning Says:
    November 11th, 2010 at 7:54 am

    Hi Rich,

    Can this also be done with pure AS3?

    Cheers,

    Sidney de Koning

    Reply to this comment

    Rich Tretola Reply:

    Not sure, I haven’t tested pure AS.

    Reply to this comment

  5. reelfernandes Says:
    November 13th, 2010 at 4:03 pm

    Does this alter the app.xml file, perhaps adding some tag with a link to the .png? Any idea how the intended effect can be ported to AS3 only AIR Android apps?

    Reply to this comment

  6. Lukasz 'Severiaan' Grela Says:
    January 14th, 2011 at 7:09 am

    I have test both pure AS3 and Flex (Burrito) and in both there is huge lag (2-3sec) before the application is in charge (to display splash screen) which makes this feature useless, totally. Adobe should do something about it.

    Reply to this comment

  7. llanbu Says:
    October 19th, 2011 at 10:05 am

    I have an android game written in pure as3 which suffers from a 4 second black screen when loading on a device. Is there a way to implement a splash/ loading screen in pure as3?

    Reply to this comment

    Marius Reply:

    Having the same problem..
    Solution already at hand somewhere?

    Reply to this comment

Comments