Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
<!-- the basic tex button component -->
<basic:TextButton label="Basic" />

<!-- the jQuery text button component -->
<jquery:TextButton label="jQuery" />

<!-- the CreateJS text button component -->
<createjs:TextButton label="CreateJS" />

Cross-Compiling

Another intriguing option for building the JavaScript side of a component is to use cross-compilation. That is, build your component in ActionScript and let the FalconJX compiler create the JavaScript version. There is catch, however.

  1. Your component must be composition of existing components.
  2. Your component must not use any Flash libraries (unless you have a JavaScript equivalent).
  3. Your component should not need any custom work on the JavaScript side.

The last issue can be waived if all you want to do is use cross compilation once (or until you are happy enough with the JavaScript result) just to get a head start.

Take the DataGrid component as an example. This component is built from Container, ButtonBar, and List. There isn't anything Flash-specific about it nor does it need customization on the JavaScript side. All of the DataGrid beads (models, views, itemRenderer) are purely ActionScript.

There is nothing special about the process: create a Flex project the usual way and develop your component in ActionScript. Any framework elements you use will already have JavaScript equivalents. If you know you will need to refine the JavaScript result, then develop as much as possible in ActionScript and then do the cross-compile; the result will be well worth it as it will save you a lot of time making the JavaScript version.