Skip to main content
Inspiring
January 30, 2012
Question

AIR3 iOS Start Up Screen is messed up [HELP]

  • January 30, 2012
  • 14 replies
  • 16791 views

I am including Default.png, Default-Landscape.png and Default-LanscapeRight.png

When I launch my application ( which only runs in landscape mode ) .. the correct splash screen shows for a split second .. then it switches to show it stretched and portrait.

What is causing this ?

This topic has been closed for replies.

14 replies

sinious
Legend
March 2, 2012

Don't forget the inverted state, Default-LandscapeRight.png.

Colin Holgate
Inspiring
March 2, 2012

You don't need that. The Left and Right variations overwrite the Default-Landscape one, but if they're not there, the Landscape one is used,, and oriented to the correct direction.

sinious
Legend
March 1, 2012

Interesting information nonetheless. I haven't dev'd any universals yet. Thanks for the tip.

Colin Holgate
Inspiring
March 1, 2012

For apps that are landscape only, but for iPhone, iPhone 4, and iPad, you just need:

Default.png

Default@2x.png

Default-Landscape.png

sinious
Legend
March 1, 2012

Very strange, I can't edit my post..

startOrientation = stage.orientation;

should be...

var startOrientation:String = stage.orientation;

(just giving the frame script version of my class version)

sinious
Legend
March 1, 2012

It is mandatory to support DefaultRight landscape. There's a quick snippit to allow you to rotate the device to Landscape or Upside Down Landscape. Without it you'll get punted.

e.g.

import flash.display.StageAlign;

import flash.display.StageOrientation;

import flash.display.StageScaleMode;

stage.align = StageAlign.TOP_LEFT;

stage.scaleMode = StageScaleMode.NO_SCALE;

startOrientation = stage.orientation;

if (startOrientation == StageOrientation.DEFAULT || startOrientation == StageOrientation.UPSIDE_DOWN)

{

          stage.setOrientation(StageOrientation.ROTATED_RIGHT);

}

else

{

          stage.setOrientation(startOrientation);

}

stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGING, _orientationChangeHandler);

function _orientationChangeHandler(e:StageOrientationEvent):void

{

          if (e.afterOrientation == StageOrientation.DEFAULT || e.afterOrientation ==  StageOrientation.UPSIDE_DOWN)

          {

                    e.preventDefault();

          }

}

Projectitis
Inspiring
March 1, 2012

So this might be why it worked pre 3.1 but not with 3.1?

And how do you add a Default screen for both ipad and iPhone?  Is there a different naming convention?

sinious
Legend
March 1, 2012

Default-Landscape~ipad.png? What's with the tilde ~ipad?

Projectitis
Inspiring
March 1, 2012

Thanks John, that's how I remeber it.  Just to copy/paste the relevent information directly (below).

This is also how our ADT helper tool works.

Providing Device-Specific Launch Images

Universal apps must provide launch images for both the iPhone and iPad idioms. Because iPhone apps require only one launch image (Default.png), whereas iPad apps typically require different images for portrait and landscape orientations, you can usually do without device-specific modifiers. However, if you create multiple launch images for each idiom, the names of device-specific image files are likely to collide. In that situation, you can append a device modifier to filenames to indicate that they are for a specific platform only. The following device modifiers are recognized for launch images in iOS 4.0 and later:

  • ~ipad. The launch image should be loaded on iPad devices only.
  • ~iphone. The launch image should be loaded on iPhone or iPod touch devices only.

Because device modifiers are not supported in iOS 3.2, the minimal set of launch images needed for a universal app (running in iOS 3.2 and later) would need to be named Default.png andDefault~iphone.png. In that case, the Default.png file would contain the iPad launch image (for all orientations) and the Default~iphone.png file would contain the iPhone version of the image. (To support high-resolution displays, you would also need to include a Default@2x~iphone.png launch image.)

sinious
Legend
March 1, 2012

I use FB4.6 with AIR3.1 and I haven't ever experienced this issue. I also was exporting from Flash CS5.5 (before buying FB just to make using ANEs easier) and never experienced this issue.

I've also never had adt compile something entirely correctly for me, which is why I just relegate to FB.

My XML looks as follows, which is very similar, and launches landscape perfectly (AS-only project):

<?xml version="1.0" encoding="utf-8" standalone="no"?>

<application xmlns="http://ns.adobe.com/air/application/3.1">

          <id>com.somecompany.SomeApp</id> -->

          <filename>SomeApp</filename>

          <name>

                    <text xml:lang="en">Some App</text>

          </name>

          <versionNumber>1.0.0</versionNumber>

          <description>

                    <text xml:lang="en">My apps description.</text>

          </description>                            

          <copyright>Copyright 2012, ME</copyright>

          <initialWindow>

                    <content>[This value will be overwritten by Flash Builder in the output app.xml]</content>

              <systemChrome>standard</systemChrome>

              <transparent>false</transparent>

              <visible>true</visible>

              <fullScreen>true</fullScreen>

              <aspectRatio>landscape</aspectRatio>

              <renderMode>gpu</renderMode>

              <autoOrients>true</autoOrients>

    </initialWindow>

  <icon>

    <image29x29>AppIconsForPublish/t29.png</image29x29>

    <image57x57>AppIconsForPublish/t57.png</image57x57>

    <image114x114>AppIconsForPublish/t114.png</image114x114>

    <image512x512>AppIconsForPublish/t512.png</image512x512>

    <image48x48>AppIconsForPublish/t48.png</image48x48>

    <image72x72>AppIconsForPublish/t72.png</image72x72>

  </icon>

          <customUpdateUI>false</customUpdateUI>

          <allowBrowserInvocation>false</allowBrowserInvocation>

          <iPhone>

            <InfoAdditions>

              <![CDATA[<key>UIFileSharingEnabled</key><true/><key>UIDeviceFamily</key><array><string>2</string></array>]]>

            </InfoAdditions>

            <requestedDisplayResolution>standard</requestedDisplayResolution>

          </iPhone>

          <extensions>

        <extensionID>ie.jampot.MobileBackup</extensionID>

    </extensions>

</application>

All I included was Default-Landscape.png and Default-LandscapeRight.png.

I also included the same image immediately in my class (from a library element) to the screen.

Projectitis
Inspiring
March 1, 2012

Thanks Abhayjit, this is my XML:

<?xml version="1.0" encoding="utf-8" ?>

<application xmlns="http://ns.adobe.com/air/application/3.1">

          <id>[App ID]</id>

          <versionNumber>1.2.5</versionNumber>

          <filename>[App filename]</filename>

          <name><text xml:lang="en">[App name]</text></name>

          <description><text xml:lang="en">[App description]</text></description>

          <copyright>Pixelthis Limited</copyright>

          <initialWindow>

                    <title>[App name]</title>

                    <content>[App swf]</content>

                    <autoOrients>false</autoOrients>

                    <renderMode>gpu</renderMode> 

                    <fullScreen>true</fullScreen> 

                    <aspectRatio>landscape</aspectRatio> 

          </initialWindow>

          <supportedProfiles>mobileDevice desktop</supportedProfiles>

          <iPhone>

                    <InfoAdditions><![CDATA[ 

                              <key>UIStatusBarStyle</key> 

                              <string>UIStatusBarStyleBlackOpaque</string> 

                              <key>UIRequiresPersistentWiFi</key> 

                              <false/>

                              <key>UIApplicationExitsOnSuspend</key>

                              <true/>

                              <key>UIPrerenderedIcon</key>

                              <false/>

<key>UIDeviceFamily</key>

                              <array>

                                  <string>2</string>

                              </array>

                    ]]></InfoAdditions> 

                    <requestedDisplayResolution>standard</requestedDisplayResolution>

          </iPhone>

          <icon>

                    <image29x29>icons/icon29x29.png</image29x29>

<image48x48>icons/icon48x48.png</image48x48>

<image57x57>icons/icon57x57.png</image57x57>

<image72x72>icons/icon72x72.png</image72x72>

<image114x114>icons/icon114x114.png</image114x114>

<image512x512>icons/icon512x512.png</image512x512>

          </icon>

</application>

And this is my ADT command:

adt -package -target ipa-test -storetype pkcs12 -keystore "[path/to/keystore.p12]" -storepass [password] -provisioning-profile "[path/to/.mobileprovision]" app_name.ipa app_name-app.xml app_name.swf icons Default-Landscape~ipad.png

Colin Holgate
Inspiring
March 1, 2012

I read somewhere that the ~ versions are sometimes used as PLIST key names, and as sinious says would not be the file names. Just take away the ~ipad part of the name

Also, as it stands your app would be rejected, for not supporting the other landscape.

Participating Frequently
February 25, 2012

I have exactly the same problem with AIR 3.1. I have a game that I need to lock in landscape view, but the splash screen flicker to portrait/stretched is a showstopper experience issue. I am using a couple native extensions. Here's my app.xml, with some names changed and comments removed...

<?xml version="1.0" encoding="utf-8" standalone="no"?>

<application xmlns="http://ns.adobe.com/air/application/3.1">

       <id>com.jdconley.mygame</id>

       <filename>MyGame</filename>

       <name>MyGame</name>

       <versionNumber>1.0.0</versionNumber>

  <initialWindow>

            <content>[This value will be overwritten by Flash Builder in the output app.xml]</content>

            <title>My Game</title>

            <systemChrome>none</systemChrome>

            <transparent>false</transparent>

            <visible>true</visible>

            <minimizable>false</minimizable>

           <maximizable>false</maximizable>

            <resizable>false</resizable>

            <aspectRatio>landscape</aspectRatio>

            <autoOrients>false</autoOrients>

            <fullScreen>true</fullScreen>

            <renderMode>cpu</renderMode>

            <softKeyboardBehavior>pan</softKeyboardBehavior>

    </initialWindow>

  <icon>

  <image29x29>29x29_Icon_2.png</image29x29>

  <image48x48>48x48_Icon_2.png</image48x48>

  <image57x57>57x57_Icon_2.png</image57x57>

  <image72x72>72x72_Icon_2.png</image72x72>

  <image114x114>114x114_Icon_2.png</image114x114>

  </icon>

  <iPhone>

        <InfoAdditions><![CDATA[

                                        <key>UIDeviceFamily</key>

                                        <array>

                                                       <string>1</string>

                                                       <string>2</string>

                                        </array>

                                        <key>UIApplicationExitsOnSuspend</key>

                                        <true/>

            <key>UIRequiresPersistentWiFi</key>

                                        <true/>

                                        <key>SBUsesNetwork</key>

                                        <true/>

                                        <key>UIRequiredDeviceCapabilities</key>

                                        <array>

                                                       <string>wifi</string>

                                        </array>

  ]]></InfoAdditions>

        <requestedDisplayResolution>high</requestedDisplayResolution>

    </iPhone>

  <extensions>

                    <extensionID>com.adobe.appPurchase</extensionID>

                    <extensionID>com.jdconley.myextensions</extensionID>

  </extensions>

</application>

Colin Holgate
Inspiring
February 25, 2012

You have it set to work on iPad, but auto orients is off. That will stop it from being accepted by Apple.

What is the full list of splash screen images you've included? I mean, their exact names.

Participating Frequently
February 25, 2012

The autoOrients=false setting was for experimentation. I was changing everything that looked like it might have an effect. Regardless of the setting for autoOrients it flashes to a distorted portrait view for a moment before calling the constructor on our Application if you have the initial aspectRatio set to landscape in the XML and start the device physically in either right or left landscape orientation.

This is a universal build. I have:

Default.png

Default@2x.png

Default-Portrait.png

Default-Landscape.png

I figured out how to work around the problem by leaving out the initial aspectRatio setting in the xml and using stage.setOrientation from code. The two iPhone png's and the Default-Portrait.png are graphically rotated right to simulate landscape mode. I manually call setOrientation to right at launch if the orientation is default or upside down. This causes the orientation change animation, but it's much less ugly than the distorted portrait view image. Further, I prevent the portrait orientations from happening through the typical means of using the StageOrientationEvent.ORIENTATION_CHANGING event and a preventDefault() call.

I woud love to see a configuration for an OR'd list of allowed orientations, and have AIR deal with all this stuff.

Participating Frequently
February 15, 2012

Ok I investigated it a bit more and it looks like the problem is in adobe AIR SDK 3.1.

I downloaded 3.0 version from here:

http://airdownload.adobe.com/air/win/download/3.0/AdobeAIRSDK.zip

and 3.1 from here:

http://airdownload.adobe.com/air/win/download/3.1/AdobeAIRSDK.zip

and used adt from version 3.1 and 3.0 to publish app using commands:

SDK31/bin/adt -package -target ipa-test-interpreter -storetype pkcs12 -keystore YOUR_CERT.p12 -provisioning-profile YOUR_DEV_PROVISIONING.mobileprovision APPNAME.ipa APPNAME-app.xml APPNAME.swf Default-Landscape.png

SDK30/bin/adt -package -target ipa-test-interpreter -storetype pkcs12 -keystore YOUR_CERT.p12 -provisioning-profile YOUR_DEV_PROVISIONING.mobileprovision APPNAME.ipa APPNAME-app.xml APPNAME.swf Default-Landscape.png

version published using 3.0 works just fine, and the one using 3.1 makes splash screen rotates for a split second.

Maybe it's a problem just when publishing to debug I'm not sure but it looks like AIR 3.1 SDK bug.

Participating Frequently
February 23, 2012

Having the same problem...

Might give AIR 3.0 a try then, thanks!

Participating Frequently
February 23, 2012

I investigated it a bit more because I had to use AIR 3.1

if you're usig AIR SDK 3.1 you can set "Aspect ratio" in AIR for iOS settings panel to "Auto" (instead of for example landscape) then you have to attach both default images for landscape and portrait mode.

this walkaround worked for me, but I hope Adobe will fix it in AIR 3.2

Participating Frequently
February 15, 2012

I'm using Default-Landscape 1024x768 and  Flash Professional CS5.5 for publishing. I publishec couple of apps before and never had those problems it appeared lately (maybe I messed something up with AIR sdk?). It also works fine on another PC with exactly the same project files - so I believe it's not about Default-Landscape.png size or orientation.

February 15, 2012

Hi , can you tell me if you are specifically using iPhoneOS 5.0 sdk to package this ipa ?