03-22-2013 11:45 AM
I've been working with AIR for exactly 1 week and a day, so I'm a newbie.
I want to develop an app in AIR and have it run on both the desktop and BlackBerry 10. I want to reuse as much of the same code as I can. I want it to ONLY use spark and mx elements.
I have created a simple AIR app, here is the mxml file:
<?xml version="1.0" encoding="utf-8"?>
width= "500" height="500" >
<mx:Button label="Close" click="stage.nativeWindow.close()" x="0" y="0" visible="true"/>
<s:Button label="Convert" x="10" y="10" visible="true"/>
There is nothing else to this app. Just the mxml file. When I run it in the simulator, all I get is a white window. No buttons, no errors, nothing - just a white window.
I've been thru the forums and used my google-fu, I have NOT seen anything that says you cannot do this. So, I'm hoping I've got something missing from my mxml file.
Is anyone running an AIR app that does not contain any of the qnx elements and ONLY contants mx & spark elements on BlackBerry 10? Can you post a sample mxml file? Were there any special settings you had to use in FDT or when setting up the run configuration?
03-22-2013 01:26 PM
The SDK package might be messed up and you'll need to rebuild the SDK folder using a Flex 4.x/Air 3.1 version of the SDK as the base package. Then install the BB SDK using that Flex SDK folder as the base and don't integrate with Flex but point to that SDK in the add SDK properties.
Often the white screen is related to the common issue of an unsupported SDK version of AIR (3.1 is the maximum for BB10 currently -- looks like a future version will use 3.4).
For your desktop version, for most compatibility you should build using 3.1 as well for the AIR compiler.
03-22-2013 02:17 PM
BB controls do not support MXML, only AS3. Try taking the name splace out of the Application paths to see if that helps. Short answer is yes, you do not have to use the BB controls, but you will need to skin and size the Spark and Mx controls to the screen density. Best not to mix Spark and Mx controls. Use Spark for new projects.
You probably dont have something set properly in your project if you are getting the white screen.
03-22-2013 04:18 PM
Thank you both for the replies.
In the end, it turned out I had my environment incorrectly configured. I was mixing and matching the BB AIR SDK and the Flex 4.6 I installed elsewhere on my system.
05-21-2013 01:24 PM
I have a rather extensive app that is currently on Apple and Android stores that is a Flex app (4.7) and uses strictly Spark components that works great on the BB10. Little porting effort required.