Versions Compared

Key

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

If you want to play with FlexJS and are too lazy to build from the sources, I have hacked together a way for you to try it in Flash BuilderFollow these instructions to use Flash Builder 4.7 for developing FlexJS applications.

Setup instructions are:

  1. Get Install Apache Flex 4.9 working or later as an SDK in FB. (I tried it with FB 4.7, but not FB 4.6)
  2. Shut down FB
  3. Install Google Closure library. You can get a zip from: http://code.google.com/p/closure-library/downloads/list
  4. Set the environment variable GOOG_HOME to point to the "library" folder that contains the closure and third_party folders. This folder's name and location may be different in different version of Google Closure.
  5. Unzip FlexJSOverlay.zip from http://people.apache.org/~aharui/FlexJS/ into a some other folder.
  6. Change to that folder and run deploy.sh or deploy.bat <path to Apache Flex 4.9 SDK folder> <path to where the script should make a copy of Apache Flex 4.9 SDK folder>
    Note that the deploy script will neuter the Flex aspects of this folder and replace it with FlexJS stuffthe FlexJS SWC and a new MXML and AS compiler known as Falcon that knows how to compile FlexJS applications.
  7. Run Flash Builder
  8. In the Flash Builder Preferences menu add this new folder as a Flex SDK.
  9. Choose from the File menu, Import, Run/Debug, Launch Configurations
  10. Choose the ide/flashbuilder folder from this modified copy of the Apache Flex 4.9 we are mucking withSDK.
    There should now be three several new configs in the Run menu under External Tools

Creating a FlexJS Application

Flash Builder does not currently know how to create new FlexJS Application. The recommended way to create a new Application is to copy an existing working example and modify it as followsNow for each project:

...

  1. Create a new Flex Project
  2. Choose this modified Apache Flex SDK
  3. Do not change the output folder from bin-debug
  4. Hit OK. Flash Builder will generate a totally messed up Application tag so replace it with this template:

...

  1. new project and a new Application MXML file that has errors. Ignore those errors for now.
  2. Get the example source for the DataBindingTest from
  1. http://

...

  1. people.

...

  1. apache.

...

  1. org/

...

  1. ~aharui/FlexJS/DataBindingTest/bin-release/srcview/DataBindingTest.zip
  2. Copy the contents of DataBindingTest.mxml into your Application MXML file. The current tools require that the Application name matches the Project name so you can't just copy DataBindingTest.mxml to the source folder and make that the default Application for the project.
  3. Copy the rest of the files to the source folder for your project.
  4. Rename the references to DataBindingTest in the other source files to match your Application's name

Source Code

...

  1. .

Building and Running/Debugging

As you edit the code, the regular Flex compiler is compiling and reporting errors, but it only knows how to build Flex SWFs so the output SWF probably won’t run. So, before you debug, select the main MXML file from the Package Explorer and choose from the Run menu the new External Tool: “FlexJS (Debug Build)”. This will run the Falcon compiler with the right options to generate a SWF in the bin-debug folder that overwrites the one that is there. Then you should be able to set breakpoints and debug.

The Falcon compiler cannot currently access your project's settings so any custom compiler options, library and source-paths must be added to the Launch Configuration.

Once you have your app working as a SWF, try the FalconJX tool in the Run menu. It will output a debug version to the bin/js-debug and a minified version to the bin/js-release folder. Run the index.html in a browser.

Converting an Existing Flex Application

The FlexJS prototype is so new, that nobody has attempted to convert an existing application since significant functionality is probably missing. However, the steps should be:

  1. In the Project Properties, change the Flex SDK.
  2. In each MXML file, change the xmlns for mx or s (or both) to library://ns.apache.org/flexjs/basic
  3. You will then have to fix lots of errors in your code where your code uses imports and API from Flex SDK classes that are not currently supported in FlexJS.

Getting Help

Please ask questions on the dev@flex.apache.org mailing list. Please start the subject of your email with FLEXJS. You may file bugs at https://issues.apache.org/jira/browse/FLEX under the component "FlexJS". Remember, Apache projects like Apache Flex is mostly staffed by volunteers so response times may vary and any contributions like patches are welcomeI’m sure there’ll be lots of issues, but feel free to comment or contribute. Remember, this is in its infancy so it will likely fall down easily and poop unexpectedly.