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!
This entry was written by
Alastair, posted on
October 27, 2010 at 1:27 pm, filed under
AIR,
ActionScript,
Flash,
Flex,
iPhone. Bookmark the
permalink. Follow any comments here with the
RSS feed for this post.
or leave a trackback:
Trackback URL.
© Copyright 2006 - 2012 Alastair Dawson
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
4 Comments
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.
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
Have just started discussion here http://forums.adobe.com/thread/821711
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