Getting a blank screen when using Adobe’s Flash Packager for iPhone?

Chris Cantrell released an iPhone packager refresher a few weeks back but when I packaged up my AIR app I was getting a blank white screen (as were a few others). However I got it to work after I made a few changes to my Application descriptor file – the XML file created with your AIR project e.g. myApp-app.xml.

Make sure you have all the properties as below:

<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://ns.adobe.com/air/application/2.0">
    <id>com.example.HelloWorld</id>
    <filename>MobileDesigner</filename>
    <name>Hello World</name>
    <version>v1</version>
    <initialWindow>
        <renderMode>gpu</renderMode>
        <content>HelloWorld.swf</content>
        <fullScreen>true</fullScreen>
        <aspectRatio>portrait</aspectRatio>
        <autoOrients>true</autoOrients>
        <visible>true</visible>
    </initialWindow>
    <supportedProfiles>mobileDevice</supportedProfiles>
    <icon>
<!--        <image29x29>icons/icon29.png</image29x29> -->
        <image57x57>Icon_57.png</image57x57>
<!--        <image512x512>icons/icon512.png</image512x512> -->
    </icon>
    <iPhone>
        <InfoAdditions>
            <![CDATA[
                <key>UIStatusBarStyle</key>
                <string>UIStatusBarStyleBlackOpaque</string>
                <key>UIRequiresPersistentWiFi</key>
                <string>NO</string>
            ]]>
        </InfoAdditions>
    </iPhone>
</application>

Another tip is to not draw any graphics or UI in your main Sprite’s constructor. Instead create another method and do any drawing there.

package
{
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;

	[SWF(width="320", height="480", frameRate="12", backgroundColor="#FFFFFF")]
	public class HelloWorld extends Sprite
	{
		public function HelloWorld()
		{
			super();

			this.stage.scaleMode = StageScaleMode.NO_SCALE;
			this.stage.align = StageAlign.TOP_LEFT;

			init();
		}

		private function init():void
		{
			var funk:Sprite = new Sprite();
			this.addChild( funk );
			funk.graphics.beginFill( 0xFF0000 );
			funk.graphics.drawRect( 0, 0, 360, 480 );
			funk.graphics.endFill();
		}
	}
}

Hope that helps!

4 Comments

  1. Hugo M.
    Posted November 3, 2010 at 5:06 am | Permalink

    Hi Alastair,
    i’m still getting a blank screen upon building a AS3 App with flash builder and then using command line compiler to compile the iphone build.

    i’m using swcs to build the ui designed in photoshop.

  2. Derek
    Posted November 17, 2010 at 11:56 am | Permalink

    Hey Alastair!

    Yeah I am struggling with Chris Cantrell demo of the iReversi game… Everything compiles fine it seems… Running from within Flashbuilder it compiles and I can run it on my desktop no problem… But when I moved it over to my iPhone 3Gs still get the white screen.

    Tried the init() function as you listed above as well as updated my app.xml to everything you have… Still same issue.

    Anyone else having this issue? Anyone find a solution?

    Thanks in advance

    Derek

  3. Pavel
    Posted March 15, 2011 at 9:22 am | Permalink

    Have just started discussion here http://forums.adobe.com/thread/821711

  4. Jules
    Posted March 21, 2011 at 11:06 am | Permalink

    Ugggghhhh! Adobe packager. Lowest-common-denominator middleware for the iPhone. This has to be the bottom of the barrel in terms of software development.

    Regards
    Jules

Post a Comment

Your email is never shared. Required fields are marked *

*
*

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word