I have quite some experience with Flex and I am just starting to write my first AIR application and would like to use as much Spark as possible here.
So I started withe a simple Hello World application:
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" backgroundColor="red"
initialize="initializeHandler(event)">
<s:Label text="Hello World"/>
<s:Button label="Test" initialize="onButtonInitialize()"/>
<fx:Script><![CDATA[
import mx.events.FlexEvent;
private function onButtonInitialize():void
{
trace("Button");
}
private function initializeHandler(event:FlexEvent):void
{
trace("Application");
}
]]></fx:Script>
</s:WindowedApplication>
Unfortunately this simple example shows no child components and even none of the initialize handlers is triggered. However as soon as I change the root tag to mx:WindowedApplication everything behaves as expected: The label and the button are shown and the console shows the output of the two trace statements.
What am I missing?
I am using Flex 4.5.0 and use flex-mojos for the build.
I’m going to guess that it’s your descriptor file that’s off. Here’s the default one that Flash Builder created for me: