Visual Studio Code

Olaf Krueger edited this page Aug 6, 2018 · 4 revisions
  • Download and install Visual Studio Code

  • Install Josh Tynjala's asconfigc, a command line utility for compiling AS/MXML projects (as of version 0.9.0 this step is optional as asconfigc is now included in the extension.)

  • Install the AS/MXML VSCode Extension by the same author. (Searching within VS Code is the easiest way to do this.)

  • Select a workspace in VSCode

  • Select SDK for workspace

  • Set up project: (Note: Yeoman can be used to automate this step.) The linked project is no longer active and was created for FlexJS. It should be easy to make it compatible with Royale.

    project
    |
    + -- src
    |    |
    |    \ -- HelloRoyale.mxml
    |
    + -- asconfig.json
    
    • in 'asconfig.json':

      {
          "compilerOptions": {
          "source-map": true,
      	    "targets": [
      		    "JSRoyale"
      	    ]
          },
          "files": [
      	    "src/HelloRoyale.mxml"
          ]
      }
    • in 'src/HelloRoyale.mxml'

      <?xml version="1.0" encoding="utf-8"?>
      <js:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:js="library://ns.apache.org/royale/express">
      	<js:initialView>
      		<js:View>
      			<js:Label text="Hello World" x="100" y="100"/>
      		</js:View>
      	</js:initialView>
      </js:Application>
  • Select Tasks > Run Build Task... to build (or equivalent shortcut).

  • Open bin/js-debug/index.html or bin/js-release/index.html in your browser and you should see "Hello World".

For instructions on more integrated debugging, please refer to the extension documentation for Chrome, Firefox or Node JS.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.