visual-studioactionscriptapache-royale

Royale setup in VSCode


New to Royale, copied checkbox mxml code from Tour de Jewel to learn Royale. Compilation with errors.

Followed instruction from https://github.com/BowlerHatLLC/vscode-as3mxml/wiki/Install-the-ActionScript-and-MXML-extension-for-Visual-Studio-Code and setup VSCode successfully.

Compilation error:
MXMLJSC
+royalelib=d:\Apps\Installations\apache-royale-0.9.6-bin-js\royale-asjs\frameworks
--debug=true
--targets=JSRoyale
--source-map=true
--
src/Main.mxml
d:\Workspace\VSProjects\Project02\src\Main.mxml(13): col: 10 Error: In initializer for 'j:initialView', type org.apache.royale.jewel.Card is not assignable to target type 'org.apache.royale.core.IApplicationView'.

<j:Card width="350">
^

1.319005 seconds
The terminal process terminated with exit code: 3


<j:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:j="library://ns.apache.org/royale/jewel" 
        xmlns:html="library://ns.apache.org/royale/html" 
        xmlns:js="library://ns.apache.org/royale/basic">

<j:valuesImpl>
    <js:SimpleCSSValuesImpl />
</j:valuesImpl>

<j:initialView>
     <j:Card width="350">
        <html:H3 text="Jewel CheckBox"/>

        <j:CheckBox text="Not Checkbox"/>

        <j:CheckBox text="Checked" selected="true"/>

        <j:CheckBox text="Disabled">
            <j:beads>
                <j:Disabled/>
            </j:beads>
        </j:CheckBox>

        <j:CheckBox text="Checked And Disabled" selected="true">
            <j:beads>
                <j:Disabled/>
            </j:beads>
        </j:CheckBox>
    </j:Card>
</j:initialView></j:Application>

Solution

  • You missed j:View:

        <j:initialView>
            <j:View>
                <j:Card/>
            </j:View>
        </j:initialView>