This section will try to bring simple code examples that should help to develop with Apache Royale more quickly. This is in part a tribute to Peter deHaan blogs he did for Apache Flex, ActionScript 3 and Adobe AIR some years ago. Hope you like it and want to contribute to get a huge library of Royale code snippets well organized and searchable.
So lets begin with our first code snippet: Hello World.
<?xml version="1.0" encoding="utf-8"?> <js:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:js="library://ns.apache.org/royale/basic"> <js:valuesImpl> <js:SimpleCSSValuesImpl /> </js:valuesImpl> <js:initialView> <js:View> <js:Label text="Hello World" /> </js:View> </js:initialView> </js:Application>
In this example you can see the use of the following MXML tags:
The result of this “Hello World” code snippet is the following:
(We're using an iframe to host the actual results of this example compilation. To see the example in a separate window click this link.)
Full project with source code can be found here:
Project Source Code