Flex-based AIR applications may consist of MXML code, ActionScript code, or both. Since Flex-based AIR applications consist of source code that can be edited with any basic text editor, Flex Builder 3 is not necessary to write the application code. Although you may write the source code with an editor as simple as Notepad or TextEdit, you will still need a compiler to test the application. Flex Builder 3 makes testing very easy. The following examples demonstrate how to test AIR applications using Flex Builder and the AIR SDK.
Open Flex Builder and create a new AIR project called HelloWorld. Please review Chapter 3 for information on creating AIR projects within Flex Builder. Once you have created this project, you should see a navigator window that resembles Figure 5-1.
Update the new HelloWorld.mxml file so that the code looks like Listing 5-1.
<?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Label text="Hello World!" horizontalCenter="0" verticalCenter="0"/> </mx:WindowedApplication>
To test this project with Flex Builder, you will simply need to click the green Play button in the top toolbar. Flex Builder will launch a ...