Git Product home page Git Product logo

royale-asjs's Introduction

Apache Royale™

Build Status

The Apache Royale project is developing a next-generation of the Apache Flex™ SDK. Royale has the goal of allowing applications developed in MXML and ActionScript to not only run in the Flash/AIR runtimes, but also to run natively in the browser without Flash, on mobile devices as a PhoneGap/Cordova application, and in embedded JS environments such as Chromium Embedded Framework. Royale has the potential to allow your MXML and ActionScript code to run in even more places than Flash currently does.

For detailed information about using Royale, visit:

https://apache.github.io/royale-docs/

For more information about the Apache Royale project, visit:

https://royale.apache.org

Getting Royale

Getting the source code from GitHub is the recommended way to get Royale. You can check out the source via git using the following commands:

git clone https://github.com/apache/royale-asjs.git royale-asjs
cd royale-asjs
git checkout develop

You may also use a precompiled binary convenience package to develop Royale applications using your favorite IDE. In addition to that, Royale is available as Maven artifacts and through Node Package Manager (NPM).

Building Royale

Prerequisites

Before building Royale you must install the following software and set the corresponding environment variables using absolute file paths (relative paths will result in build errors). The set of prerequisites is different depending on whether you want to compile your projects to SWF or not. If you want SWF output, set up the environment variables per the instructions below, then skip to the next section (Additional Prerequisites For SWF Output)

Java

Royale requires Java JDK 11 or greater to be installed on your computer. For more information on installing the Java JDK, see:

https://www.oracle.com/technetwork/java/javase/downloads/index.html

  • Environment variable

    Set the JAVA_HOME environment variable to the Java JDK installation path.

  • PATH

    Add the bin directory of JAVA_HOME to the PATH.

    On Windows, set PATH to

    PATH=%PATH%;%JAVA_HOME%\bin

    On a Mac, set PATH to

    export PATH="$PATH:$JAVA_HOME/bin"

Ant

The Royale Ant build requires Ant 1.8 or greater to be installed on your computer.

For more information on installing Ant, see:

https://ant.apache.org/

  • Environment variable

    Set the ANT_HOME environment variable to the Ant installation path.

  • PATH

    Add the bin directory of ANT_HOME to the PATH.

    On Windows, set PATH to

    PATH=%PATH%;%ANT_HOME%\bin

    On a Mac, set PATH to

    export PATH="$PATH:$ANT_HOME/bin"

Additional Prerequisites For SWF Output

playerglobal.swc

The Adobe Flash Player playerglobal.swc (version 32.0) can be downloaded from:

https://fpdownload.macromedia.com/get/flashplayer/updaters/32/playerglobal32_0.swc

First, create the following directory structure:

[root directory]/player/32.0/

Next, rename the downloaded SWC to 'playerglobal.swc' and place it in the above directory.

  • Environment variable

    Set PLAYERGLOBAL_HOME environment variable to the absolute path of the player directory, not including the version subdirectory (i.e. '[root directory]/player').

Flash Player Content Debugger

The Adobe Flash Player Content Debugger can be found here:

Windows: https://fpdownload.macromedia.com/pub/flashplayer/updaters/32/flashplayer_32_sa_debug.exe

Mac: https://fpdownload.macromedia.com/pub/flashplayer/updaters/32/flashplayer_32_sa_debug.dmg

Linux: https://fpdownload.macromedia.com/pub/flashplayer/updaters/32/flash_player_sa_linux_debug.x86_64.tar.gz

This version of Royale was certified for use with Flash Player 32.0, and is compatible with version 10.2 and up. It has been compiled, but not fully tested, with other Flash Player versions. It has not been fully tested on Linux.

  • Environment variable

    On Windows, set FLASHPLAYER_DEBUGGER to the absolute path including the filename of the Flash Player Projector Content Debugger executable (e.g. 'FlashPlayerDebugger.exe'). Note: the filename of Flash Player Content Debugger can differ slightly between versions. Adjust your path accordingly.

    On the Mac, set FLASHPLAYER_DEBUGGER to the absolute path of 'Flash Player.app/Contents/MacOS/Flash Player Debugger'

    On Linux, set FLASHPLAYER_DEBUGGER to the absolute path of 'flashplayerdebugger'.

Adobe AIR Integration Kit (optional, for SWF output only)

This version of Apache Royale was certified for use with Adobe AIR 32.0 and is compatible with version 3.1 and up. The Adobe AIR integration kit can be downloaded from:

Windows: https://airdownload.adobe.com/air/win/download/32.0/AdobeAIRSDK.zip

Mac: https://airdownload.adobe.com/air/mac/download/32.0/AdobeAIRSDK.dmg

After you download the AIR SDK, unzip it and place it in a directory of your choice.

  • Environment variable

    Set AIR_HOME to the absolute path of the AIR SDK directory.

Building the source

Linux support is currently experimental and while it is possible to compile the SDK it has not been fully tested.

Royale requires code from several other Apache Royale git repositories. To get these repositories, change to the repository root ('royale-asjs') and run:

ant all

This will clone the repositories, checkout the develop branches then build those repositories in the correct order.

Some more helpful commands:

  • To rebuild, run:

    ant
  • To clean the build, of everything other than the downloaded third-party dependencies, run:

    ant clean
  • To generate a source distribution package and a binary distribution package, run:

    ant -Dbuild.number=<YYYYMMDD> -Dbuild.noprompt= release

    The packages can be found in the "out" subdirectory.

  • To get a brief listing of all the targets, run:

    ant -projecthelp

Using the Binary Distribution

If you are not interested in SWF output, the binary distribution can just be unzipped into a folder.

If you want SWF output, use NPM. Run:

  • Mac
sudo npm install @apache-royale/royale-js -g

or for both JS and SWF output:

sudo npm install @apache-royale/royale-js-swf -g --foreground-scripts
  • Windows
npm install @apache-royale/royale-js -g

or for both JS and SWF output:

npm install @apache-royale/royale-js-swf -g --foreground-scripts

Maven

The Royale Maven build generally doesn't require an installation of Maven as we utilise the Maven Wrapper which automatically fetches the right version of Maven. However, you can also build using your local Maven installation.

If you want to use your local installation, just use mvn instead of mvnw

Maven Prerequisites

The Maven build does a prerequisite check before actually starting the build, so it should point out to you parts that aren't setup correctly.

So-far there is only one environment-variable the Maven build uses, this is the same the Ant build uses. For details on this please refer to the chapter of the Ant setup guide titled: Flash Player Content Debugger. If you don't provide this environment variable, the build will be able to build, it will just not run any tests that require the FlashPlayer.

All other parts are automatically downloaded using the tooling we built for the Apache Flex project. This will automatically download missing things like playerglobal or airglobal files.

NOTE: After Adobe finally ended the life of the FlashPlayer, most of the automatically downloaded files are no longer available in the locations they were previously hosted on. Therefore, the automatic fetching of artifacts no longer works. The team is currently working on a replacement for the playerglobal. Right now it is probably the simplest approach to request a snapshot of the adobe artifacts from someone who has a copy of them or to build without the option-with-swf profiles.

Building with Maven

As the Royale repository is split up into 3 parts, we have to run 3 separate Maven builds.

Even if the Maven build doesn't require the projects to be checked out in specially named directories, for the sake of simplicity we will assume you checked out everything in the following directory structure:

  • {checkout-root}
    • royale-compiler
    • royale-typedefs
    • royale-asjs

Then starting from the checkout-root directory, the commands look as follows:

cd royale-compiler
./mvnw install

cd ../royale-typedefs
./mvnw install

cd ../royale-asjs
./mvnw install

This should build the basic framework and you can start writing your firs Maven based Royale applications.

However, there are ways to build additional parts and ways to customize how things are built. For this we utilize Maven profiles.

We use the following general rules of thumb for naming profiles:

  • If activating a profile adds new modules to the build and generally builds things which aren't built without activating the profile, the profile name starts with with-
  • If activating a profile changes the way something is built, the profile name starts with option-with-.

Listing of with- profiles:

  • with-distribution: Additionally creates distributions. These are usually used by Ant builds or IDE integrations. Assembling the distributions usually takes some additional time, therefore it is only built on request. On the CI server this can be used to build the binaries the Royale Installer can download. When used locally there is also an option to set a Maven property distributionTargetFolder. Adding -DdistributionTargetFolder={some path} to the build options of the royale-asjs module, will also create a local unzipped version of the Royale development kit, which can be used by IDEs to provide Royale support.
  • with-examples: Also build all examples
  • with-manualtests: Also builds the modules in the manualtests directory of the royale-asjs repository.
  • with-ui-testsuite: Additionally builds the ui testsuite in the royale-asjs repository. This testsuite automatically deploys applications built in the examples on a local webserver and automates a local Browser instance to click through the applications (NOTE: This currently might require a bit of tweaking)

Listing of option-with- profiles:

  • option-with-cordova: Additionally builds all example using the Cordova tooling
  • option-with-flex-sdk-tests: Additionally runs some tests from the old Apache Flex SDK
  • option-with-sass-compile: The Themes contain a lot of Modules, where each contains SASS resources. Compiling all of these on every build would only slow down the build. Especially because the SASS resources are only changed very infrequently. Therefore, the compiled CSS files are checked in. When enabling this profile the checked in CSS resources are replaced by freshly compiled versions, which then can be checked in.
  • option-with-swf: Per default the Royale build only builds the JavaScript-only version. This can be used to build web-based applications. If you however wish to build Flash and Air versions, you need to activate this profile in order for also building the Flash enabled versions of all libraries.

Using Royale

In order to get started using Royale, you are invited to follow along with the Quick Start Guide.

Thanks for using Apache Royale. Enjoy!

royale-asjs's People

Contributors

aharui avatar alinakazi avatar bigosmallm avatar brianraymes avatar carlosrovira avatar cdouine39 avatar chrisdutz avatar cottage14 avatar cristallium avatar doublefx avatar erikdebruin avatar estanglerbm avatar greg-dove avatar harbs avatar javeiga avatar javeiga-iest avatar jim-page avatar joshtynjala avatar justinmclean avatar lhr07-dbz avatar mjesteve avatar om-fountain avatar pashminakazi avatar pentapache avatar piotrzarzycki21 avatar raudjcholo avatar solidsoft-lda avatar tzivz avatar yestaro avatar yishayw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

royale-asjs's Issues

StyleChangeNotifier doesn't react to background colour changes

StyleChangeNotifier doesn't react to background colour changes. Clicking on the "Change Colour" button in the example below doesn't change the colour of the square. from grey to red.

Example code:

<?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">
    
   <fx:Script><![CDATA[       
       public function clicked():void {
           bg.backgroundColor = "red";
       }
       ]]></fx:Script>

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

   <js:initialView>
       <js:View>
           <js:VContainer>
               <js:Container id="box" width="100" height="100">
                   <js:beads>
                       <js:StyleChangeNotifier />
                   </js:beads>
                   <js:style>
                       <js:SimpleCSSStyles id="bg" backgroundColor="grey" />
                   </js:style>
               </js:Container>
               
               <js:TextButton text="Change Colour" click="clicked()" />
           </js:VContainer>
       </js:View>
   </js:initialView>

</js:Application>

Values on radio buttons are not being set

In this code the selected value label is always set to be be an empty sting:

<?xml version="1.0" encoding="utf-8"?>
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:js="library://ns.apache.org/flexjs/basic">


    <fx:Script><![CDATA[
        public function showSelected():void {
            selected.text = radio.selected.toString();
            selectedValue.text = radio.selectedValue.toString();
        }
        ]]></fx:Script>

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

    <js:initialView>
        <js:View>
            <js:Group id="content">
                <js:beads>
                    <js:VerticalLayout />
                </js:beads>
                <js:RadioButton id="radio" text="one" value="1" groupName="group" click="showSelected()"/>
                <js:RadioButton text="two" value="2" groupName="group" click="showSelected()"/>
                <js:RadioButton text="three" value="3" groupName="group" click="showSelected()"/>
                <js:Label id="selected" />
                <js:Label id="selectedValue" />
            </js:Group>
        </js:View>
    </js:initialView>

</js:Application>

2017-10-16_10-25-45

The issue looks to be in the generated JS and/or the Language.as method:

org.apache.flex.html.RadioButton.prototype.set__value = function(v) {
  org.apache.flex.utils.Language.as(this.icon.element, HTMLInputElement).value = org.apache.flex.utils.Language.as(v, String);
};

From the code:

		public function set value(newValue:Object):void
		{
			IValueToggleButtonModel(model).value = newValue;
		}

As it thinks newValue / v is a number and not a string and the expression "number as String" will always return null.

Centre image incorrectly positions image and fails to take account of it's height and width

Example code:

<?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 width="100%" height="100%">
            <js:Container width="600" height="300">
                <js:style>
                    <js:SimpleCSSStyles backgroundColor="#FF0000" />
                </js:style>
                <js:Image src="http://apache.org/img/asf_logo.png">
                    <js:beads>
                        <js:CenterElement />
                    </js:beads>
                </js:Image>
            </js:Container>
        </js:View>
    </js:initialView>

</js:Application>

Doesn't centre the image:
2017-11-13_15-17-44

Inspecting the image you can see it's style been set to:
position: absolute; left: 300px; top: 150px;

Compiler throws null pointer RTE on implicit coercion of object to string

This code:

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

<fx:Script><![CDATA[
    public function showSelected():void {
        selected.text = radio.selectedValue;
    }
    ]]></fx:Script>

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

<js:initialView>
    <js:View>
        <js:Group id="content">
            <js:beads>
                <js:VerticalLayout />
            </js:beads>
            <js:RadioButton id="radio" text="one" value="1" groupName="group" click="showSelected()"/>
            <js:RadioButton text="two" value="2" groupName="group" click="showSelected()"/>
            <js:RadioButton text="three" value="3" groupName="group" click="showSelected()"/>
            <js:Label id="selected" />
        </js:Group>
    </js:View>
</js:initialView>

</js:Application>

Produces this compiler null pointer exception:

/Users/justinmclean/IdeaProjects/FlexJSTest/src/RadioButtonTest.mxml(7): col: 9 Internal error: java.lang.NullPointerException
	at org.apache.flex.compiler.internal.projects.FlexProject.isValidTypeConversion(FlexProject.java:2304)
	at org.apache.flex.compiler.internal.semantics.MethodBodySemanticChecker.checkImplicitConversion(MethodBodySemanticChecker.java:564)
	at org.apache.flex.compiler.internal.semantics.MethodBodySemanticChecker.checkImplicitConversion(MethodBodySemanticChecker.java:374)
	at org.apache.flex.compiler.internal.semantics.MethodBodySemanticChecker.checkAssignment(MethodBodySemanticChecker.java:246)
	at org.apache.flex.compiler.internal.as.codegen.ABCGeneratingReducer.reduce_assignToMemberExpr_to_void_expression(ABCGeneratingReducer.java:2904)
	at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.action_235(CmcEmitter.java:4432)
	at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.dispatchAction(CmcEmitter.java:8057)
	at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduceAntecedent(CmcEmitter.java:39127)
	at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.dispatchAction(CmcEmitter.java:9398)
	at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduceAntecedent(CmcEmitter.java:39127)
	at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduce(CmcEmitter.java:39104)
	at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduceSubgoals(CmcEmitter.java:39155)
	at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduceAntecedent(CmcEmitter.java:39126)
	at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduce(CmcEmitter.java:39104)
	at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduceSubgoals(CmcEmitter.java:39146)
	at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduceAntecedent(CmcEmitter.java:39126)
	at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.reduce(CmcEmitter.java:39104)
	at org.apache.flex.compiler.internal.as.codegen.CmcEmitter.burm(CmcEmitter.java:39406)
	at org.apache.flex.compiler.internal.as.codegen.ABCGenerator.generateInstructions(ABCGenerator.java:228)
	at org.apache.flex.compiler.internal.as.codegen.ABCGenerator.generateMethodBodyForFunction(ABCGenerator.java:393)
	at org.apache.flex.compiler.internal.as.codegen.ABCGenerator.generateMethodBodyForFunction(ABCGenerator.java:347)
	at org.apache.flex.compiler.internal.as.codegen.ABCGenerator.generateFunction(ABCGenerator.java:262)
	at org.apache.flex.compiler.internal.as.codegen.ClassDirectiveProcessor.declareFunction(ClassDirectiveProcessor.java:886)
	at org.apache.flex.compiler.internal.as.codegen.DirectiveProcessor.processNode(DirectiveProcessor.java:214)
	at org.apache.flex.compiler.internal.as.codegen.MXMLClassDirectiveProcessor.processNode(MXMLClassDirectiveProcessor.java:1116)
	at org.apache.flex.compiler.internal.as.codegen.MXMLClassDirectiveProcessor.traverse(MXMLClassDirectiveProcessor.java:861)
	at org.apache.flex.compiler.internal.as.codegen.MXMLClassDirectiveProcessor.traverse(MXMLClassDirectiveProcessor.java:831)
	at org.apache.flex.compiler.internal.as.codegen.MXMLClassDirectiveProcessor.processMXMLScript(MXMLClassDirectiveProcessor.java:4153)
	at org.apache.flex.compiler.internal.as.codegen.MXMLClassDirectiveProcessor.processNode(MXMLClassDirectiveProcessor.java:982)
	at org.apache.flex.compiler.internal.as.codegen.MXMLClassDirectiveProcessor.traverse(MXMLClassDirectiveProcessor.java:861)
	at org.apache.flex.compiler.internal.as.codegen.MXMLClassDirectiveProcessor.traverse(MXMLClassDirectiveProcessor.java:831)
	at org.apache.flex.compiler.internal.as.codegen.MXMLClassDirectiveProcessor.processMainClassDefinitionNode(MXMLClassDirectiveProcessor.java:653)
	at org.apache.flex.compiler.internal.as.codegen.GlobalDirectiveProcessor.declareMXMLDocument(GlobalDirectiveProcessor.java:518)
	at org.apache.flex.compiler.internal.as.codegen.DirectiveProcessor.processNode(DirectiveProcessor.java:232)
	at org.apache.flex.compiler.internal.as.codegen.DirectiveProcessor.traverse(DirectiveProcessor.java:188)
	at org.apache.flex.compiler.internal.as.codegen.ABCGenerator.generate(ABCGenerator.java:122)
	at `org.apache.flex.compiler.internal.units.MXMLCompilationUnit.handleABCBytesRequest(MXMLCompilationUnit.java:199)`
	at org.apache.flex.compiler.internal.units.CompilationUnitBase.processABCBytesRequest(CompilationUnitBase.java:876)
	at org.apache.flex.compiler.internal.units.CompilationUnitBase.access$300(CompilationUnitBase.java:109)
	at org.apache.flex.compiler.internal.units.CompilationUnitBase$4$1.call(CompilationUnitBase.java:313)
	at org.apache.flex.compiler.internal.units.CompilationUnitBase$4$1.call(CompilationUnitBase.java:309)
	at org.apache.flex.compiler.internal.units.requests.RequestMaker$1.call(RequestMaker.java:228)
	at org.apache.flex.compiler.internal.units.requests.RequestMaker$1.call(RequestMaker.java:222)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)


        public function showSelected():void {
        ^

Note the error is also pointing to the wrong line i.e. the function rather than the assignment that is the cause of the error in the function.
selected.text = radio.selectedValue;

A similar line in the FlexSDK would produce this error:
Implicit coercion of a value with static type Object to a possibly unrelated type String.

Unable to change DateChooser controller without errors

Currently you can't change DateChooser controller class in MXML but assuming you could and did this then the Mouse controller gets replaced buy the keyboard controller. This seems to be by design - is this correct?

                <js:DateChooser id="chooser" width="300" click="displayDate()">
                    <js:beads>
                        <js:DateChooserKeyboardController />
                    </js:beads>
                </js:DateChooser>

So to fix it you add both controllers.

                <js:DateChooser id="chooser" width="300" click="displayDate()">
                    <js:beads>
                        <js:DateChooserMouseController />
                        <js:DateChooserKeyboardController />
                    </js:beads>
                </js:DateChooser>

This will die with a RTE in in DateChooserMouseController set strand method as getBeadByType fails to find the view (it's not in the list of beads yet) and returns null.

        var view:DateChooserView = value.getBeadByType(IBeadView) as DateChooserView;
	view.prevMonthButton.addEventListener("click", prevMonthClickHandler);
	view.nextMonthButton.addEventListener("click", nextMonthClickHandler);

Perhaps the view could be obtained from value.view which does have the correct value?

This fixes it but seem rather verbose:

                <js:DateChooser id="chooser" width="300" click="displayDate()">
                    <js:view>
                        <beads:DateChooserView />
                    </js:view>
                    <js:beads>
                        <js:DateChooserMouseController />
                        <js:DateChooserKeyboardController />
                    </js:beads>
                </js:DateChooser>

Is it more correct / in line with PAYG to fix the issue in the DateChooserMouseController set strand method? Or should the default view be added to the beads before the set strand method is called?

Complier tests are currently failing

[INFO] Apache Royale: Compiler: Compiler .................. FAILURE

Tests in error:
MXMLComponentNodeTests.MXMLComponentNode_Sprite:95->getMXMLComponentNode:42->MXMLNodeBaseTests.getMXMLFileNodeWithFlex:112->MXMLNodeBaseTests.getMXMLFileNode:147 » Runtime
MXMLComponentNodeTests.MXMLComponentNode_className_Sprite:113->getMXMLComponentNode:42->MXMLNodeBaseTests.getMXMLFileNodeWithFlex:112->MXMLNodeBaseTests.getMXMLFileNode:147 » Runtime
MXMLComponentNodeTests.MXMLComponentNode_className_id_Sprite_width_height:151->getMXMLComponentNode:42->MXMLNodeBaseTests.getMXMLFileNodeWithFlex:112->MXMLNodeBaseTests.getMXMLFileNode:147 » Runtime
MXMLComponentNodeTests.MXMLComponentNode_empty1:60->getMXMLComponentNode:42->MXMLNodeBaseTests.getMXMLFileNodeWithFlex:112->MXMLNodeBaseTests.getMXMLFileNode:147 » Runtime
MXMLComponentNodeTests.MXMLComponentNode_empty2:77->getMXMLComponentNode:42->MXMLNodeBaseTests.getMXMLFileNodeWithFlex:112->MXMLNodeBaseTests.getMXMLFileNode:147 » Runtime
MXMLComponentNodeTests.MXMLComponentNode_id_Sprite:131->getMXMLComponentNode:42->MXMLNodeBaseTests.getMXMLFileNodeWithFlex:112->MXMLNodeBaseTests.getMXMLFileNode:147 » Runtime
MXMLDesignLayerNodeTests.MXMLDesignLayerNode_empty1:54->getMXMLDesignLayerNode:40->MXMLNodeBaseTests.getMXMLFileNodeWithFlex:112->MXMLNodeBaseTests.getMXMLFileNode:147 » Runtime
MXMLDesignLayerNodeTests.MXMLDesignLayerNode_empty2:67->getMXMLDesignLayerNode:40->MXMLNodeBaseTests.getMXMLFileNodeWithFlex:112->MXMLNodeBaseTests.getMXMLFileNode:147 » Runtime
MXMLDesignLayerNodeTests.MXMLDesignLayerNode_empty3:80->getMXMLDesignLayerNode:40->MXMLNodeBaseTests.getMXMLFileNodeWithFlex:112->MXMLNodeBaseTests.getMXMLFileNode:147 » Runtime
MXMLDesignLayerNodeTests.MXMLDesignLayerNode_id_visible_alpha:93->getMXMLDesignLayerNode:40->MXMLNodeBaseTests.getMXMLFileNodeWithFlex:112->MXMLNodeBaseTests.getMXMLFileNode:147 » Runtime
MXMLDesignLayerNodeTests.MXMLDesignLayerNode_two_children:112->getMXMLDesignLayerNode:40->MXMLNodeBaseTests.getMXMLFileNodeWithFlex:112->MXMLNodeBaseTests.getMXMLFileNode:147 » Runtime
MXMLHTTPServiceNodeTests.MXMLHTTPServiceNode_postRequest:60->getMXMLHTTPServiceNode:41->MXMLNodeBaseTests.getMXMLFileNodeWithFlex:112->MXMLNodeBaseTests.getMXMLFileNode:147 » Runtime
MXMLRemoteObjectNodeTests.MXMLRemoteObjectNode_postRequest:61->getMXMLRemoteObjectNode:41->MXMLNodeBaseTests.getMXMLFileNodeWithFlex:112->MXMLNodeBaseTests.getMXMLFileNode:147 » Runtime
MXMLStateNodeTests.MXMLStateNode_oneState:72->getMXMLStateNode:54->MXMLNodeBaseTests.getMXMLFileNodeWithFlex:112->MXMLNodeBaseTests.getMXMLFileNode:147 » Runtime
MXMLWebServiceNodeTests.MXMLWebServiceNode_twoOperations:58->getMXMLWebServiceNode:41->MXMLNodeBaseTests.getMXMLFileNodeWithFlex:112->MXMLNodeBaseTests.getMXMLFileNode:147 » Runtime

Tests run: 375, Failures: 0, Errors: 15, Skipped: 26

Button's size doesn't include selection indicator

Selecting the middle button in this example code:

<?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:style>
                <js:SimpleCSSStyles padding="20" />
            </js:style>
            <js:Container width="100%">
                <js:beads>
                    <js:HorizontalLayoutWithPaddingAndGap gap="20" />
                </js:beads>
                <js:TextButton text="Button 1" />
                <js:TextButton text="Button 2" />
                <js:TextButton text="Button 3" />
             </js:Container>
        </js:View>
    </js:initialView>

</js:Application>

Cuts off the selection indicator on the top and bottom of the button.

2017-11-13_12-36-28

On buttons 1 and 3 it only shows on one vertical edge.

One way of getting around this issue is adding padding to the buttons container like so:

<?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:style>
                <js:SimpleCSSStyles padding="20" />
            </js:style>
            <js:Container width="100%">
                <js:beads>
                    <js:HorizontalLayoutWithPaddingAndGap paddingLeft="10" paddingRight="10" paddingTop="10" paddingBottom="10" gap="20" />
                </js:beads>
                <js:TextButton text="Button 1" />
                <js:TextButton text="Button 2" />
                <js:TextButton text="Button 3" />
             </js:Container>
        </js:View>
    </js:initialView>

</js:Application>

2017-11-13_12-42-28

Invalid string comparison in new date code

This code is incorrect and fails to work:

        public function getIndexForSelectedDate():Number
        {
            if (!_selectedDate) return -1;

            var str:String = _selectedDate.toDateString();

            for(var i:int=0; i < _days.length; i++) {
                var test:Date = _days[i] as Date;
				
				if (test && test.toDateString() == str)
					return i;

            }
            return -1;
		}

As it is doing comparisons on dates stings like so:

str: "Thu Nov 09 2017"
test: "Thu Nov 09 2017 00:00:00 GMT+1100 (AEDT)"

The strings will never match.

(Tested on OSX Chrome other browsers may or may not have the same issue)

MDL FooterLinkList should expose ability to assign both text and url for displayed link

In order to assign some url for link displayed by MDL FooterLinkList we need to create our custom item renderer based on FooterLinkItemRenderer/FooterLinkItemMouseRenderer and assign from data provider items object url to "href" property of FooterLinkItemRenderer.

We should not have to create every time custom rendere instead simply use existing one.

Proposed solution is use existing "labelField" (text property) and "dataField" (url property) in item renderer.

Image missing load handler event?

It was suggested in #60 to use a load event listener to check when an image was loaded. However I can't see any load handler in the js:Image control. It has rollover, click, double click etc etc handlers but doesn't seem to have any load handler. Is there a bead to add this?

Annotation warnings given when trying to compile Apache Royale examples

When doing a mvn compile in the example directory the following warnings are given I don't recall this happening before the rename.

Oct 24, 2017 7:46:26 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/MainApp/target/javascript/bin/js-debug/org/apache/royale/core/HTMLElementWrapper.js:102: WARNING - Type annotation references non-existent type org.apache.royale.core.WrappedHTMLElement.

  • @type {org.apache.royale.core.WrappedHTMLElement}
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Oct 24, 2017 7:46:26 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/MainApp/target/javascript/bin/js-debug/org/apache/royale/core/HTMLElementWrapper.js:290: WARNING - Type annotation references non-existent type org.apache.royale.core.WrappedHTMLElement.

  • @type {org.apache.royale.core.WrappedHTMLElement} */
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Oct 24, 2017 7:46:26 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/MainApp/target/javascript/bin/js-debug/org/apache/royale/core/IRenderedObject.js:26: WARNING - Type annotation references non-existent type org.apache.royale.core.WrappedHTMLElement.
/** * @type {org.apache.royale.core.WrappedHTMLElement}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Oct 24, 2017 7:46:26 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/MainApp/target/javascript/bin/js-debug/org/apache/royale/core/IViewportModel.js:28: WARNING - Type annotation references non-existent type org.apache.royale.geom.Rectangle.
/** * @type {org.apache.royale.geom.Rectangle}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Oct 24, 2017 7:46:26 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/MainApp/target/javascript/bin/js-debug/org/apache/royale/core/UIBase.js:866: WARNING - Type annotation references non-existent type org.apache.royale.core.WrappedHTMLElement.
var /** @type {org.apache.royale.core.WrappedHTMLElement} */ e = document.body;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Oct 24, 2017 7:46:26 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/MainApp/target/javascript/bin/js-debug/org/apache/royale/core/UIBase.js:894: WARNING - Type annotation references non-existent type org.apache.royale.core.WrappedHTMLElement.
var /** @type {org.apache.royale.core.WrappedHTMLElement} */ p = this.positioner.parentNode;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Oct 24, 2017 7:46:26 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/MainApp/target/javascript/bin/js-debug/org/apache/royale/core/UIBase.js:1007: WARNING - Type annotation references non-existent type org.apache.royale.core.WrappedHTMLElement.

  • @type {org.apache.royale.core.WrappedHTMLElement} */
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Oct 24, 2017 7:46:26 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/MainApp/target/javascript/bin/js-debug/org/apache/royale/core/UIBase.js:1024: WARNING - Type annotation references non-existent type org.apache.royale.core.WrappedHTMLElement.

  • @type {org.apache.royale.core.WrappedHTMLElement} */
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Oct 24, 2017 7:46:26 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/MainApp/target/javascript/bin/js-debug/org/apache/royale/html/UIModuleLoader.js:58: WARNING - Type annotation references non-existent type org.apache.royale.core.WrappedHTMLElement.

  • @type {org.apache.royale.core.WrappedHTMLElement}
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Oct 24, 2017 7:46:26 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/MainApp/target/javascript/bin/js-debug/org/apache/royale/html/UIModuleLoader.js:65: WARNING - Type annotation references non-existent type org.apache.royale.core.WrappedHTMLElement.

  • @type {org.apache.royale.core.WrappedHTMLElement}
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Oct 24, 2017 7:46:26 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/MainApp/target/javascript/bin/js-debug/org/apache/royale/html/beads/models/ViewportModel.js:36: WARNING - Type annotation references non-existent type org.apache.royale.geom.Rectangle.

  • @type {org.apache.royale.geom.Rectangle}
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Oct 24, 2017 7:46:26 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/MainApp/target/javascript/bin/js-debug/org/apache/royale/html/beads/models/ViewportModel.js:43: WARNING - Type annotation references non-existent type org.apache.royale.geom.Rectangle.

  • @type {org.apache.royale.geom.Rectangle}
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Oct 24, 2017 7:46:26 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/MainApp/target/javascript/bin/js-debug/org/apache/royale/html/beads/models/ViewportModel.js:83: WARNING - Type annotation references non-existent type org.apache.royale.geom.Rectangle.

  • @type {org.apache.royale.geom.Rectangle} */
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Oct 24, 2017 7:46:26 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/MainApp/target/javascript/bin/js-debug/org/apache/royale/html/beads/models/ViewportModel.js:89: WARNING - Type annotation references non-existent type org.apache.royale.geom.Rectangle.

  • @type {org.apache.royale.geom.Rectangle} */
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Oct 24, 2017 7:46:26 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/MainApp/target/javascript/bin/js-debug/org/apache/royale/html/supportClasses/Viewport.js:96: WARNING - Type annotation references non-existent type org.apache.royale.geom.Size.

  • @param {org.apache.royale.geom.Size} contentSize
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^

Oct 24, 2017 7:46:26 PM com.google.javascript.jscomp.LoggerErrorManager printSummary
WARNING: 0 error(s), 15 warning(s), 96.8% typed
Oct 24, 2017 7:46:32 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/Module/target/javascript/bin/js-debug/org/apache/royale/core/HTMLElementWrapper.js:102: WARNING - Type annotation references non-existent type org.apache.royale.core.WrappedHTMLElement.

  • @type {org.apache.royale.core.WrappedHTMLElement}
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Oct 24, 2017 7:46:32 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/Module/target/javascript/bin/js-debug/org/apache/royale/core/HTMLElementWrapper.js:290: WARNING - Type annotation references non-existent type org.apache.royale.core.WrappedHTMLElement.

  • @type {org.apache.royale.core.WrappedHTMLElement} */
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Oct 24, 2017 7:46:32 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/Module/target/javascript/bin/js-debug/org/apache/royale/core/IRenderedObject.js:26: WARNING - Type annotation references non-existent type org.apache.royale.core.WrappedHTMLElement.
/** * @type {org.apache.royale.core.WrappedHTMLElement}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Oct 24, 2017 7:46:32 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/Module/target/javascript/bin/js-debug/org/apache/royale/core/IViewportModel.js:28: WARNING - Type annotation references non-existent type org.apache.royale.geom.Rectangle.
/** * @type {org.apache.royale.geom.Rectangle}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Oct 24, 2017 7:46:32 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/Module/target/javascript/bin/js-debug/org/apache/royale/core/UIBase.js:866: WARNING - Type annotation references non-existent type org.apache.royale.core.WrappedHTMLElement.
var /** @type {org.apache.royale.core.WrappedHTMLElement} */ e = document.body;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Oct 24, 2017 7:46:32 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/Module/target/javascript/bin/js-debug/org/apache/royale/core/UIBase.js:894: WARNING - Type annotation references non-existent type org.apache.royale.core.WrappedHTMLElement.
var /** @type {org.apache.royale.core.WrappedHTMLElement} */ p = this.positioner.parentNode;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Oct 24, 2017 7:46:32 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/Module/target/javascript/bin/js-debug/org/apache/royale/core/UIBase.js:1007: WARNING - Type annotation references non-existent type org.apache.royale.core.WrappedHTMLElement.

  • @type {org.apache.royale.core.WrappedHTMLElement} */
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Oct 24, 2017 7:46:32 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/Module/target/javascript/bin/js-debug/org/apache/royale/core/UIBase.js:1024: WARNING - Type annotation references non-existent type org.apache.royale.core.WrappedHTMLElement.

  • @type {org.apache.royale.core.WrappedHTMLElement} */
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Oct 24, 2017 7:46:32 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/Module/target/javascript/bin/js-debug/org/apache/royale/html/beads/models/ViewportModel.js:36: WARNING - Type annotation references non-existent type org.apache.royale.geom.Rectangle.

  • @type {org.apache.royale.geom.Rectangle}
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Oct 24, 2017 7:46:32 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/Module/target/javascript/bin/js-debug/org/apache/royale/html/beads/models/ViewportModel.js:43: WARNING - Type annotation references non-existent type org.apache.royale.geom.Rectangle.

  • @type {org.apache.royale.geom.Rectangle}
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Oct 24, 2017 7:46:32 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/Module/target/javascript/bin/js-debug/org/apache/royale/html/beads/models/ViewportModel.js:83: WARNING - Type annotation references non-existent type org.apache.royale.geom.Rectangle.

  • @type {org.apache.royale.geom.Rectangle} */
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Oct 24, 2017 7:46:32 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/Module/target/javascript/bin/js-debug/org/apache/royale/html/beads/models/ViewportModel.js:89: WARNING - Type annotation references non-existent type org.apache.royale.geom.Rectangle.

  • @type {org.apache.royale.geom.Rectangle} */
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Oct 24, 2017 7:46:32 PM com.google.javascript.jscomp.LoggerErrorManager println
WARNING: /Users/justinmclean/royale-asjs/examples/royale/ModuleExample/Module/target/javascript/bin/js-debug/org/apache/royale/html/supportClasses/Viewport.js:96: WARNING - Type annotation references non-existent type org.apache.royale.geom.Size.

  • @param {org.apache.royale.geom.Size} contentSize
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^

Accidentally adding style to beads gives no warnings and compiles

More a JFYI than a bug (not an important one anyway) but someone may run into this and documenting it may help them.

Example code:

<?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 width="200" height="200">
           <js:Container>
               <js:beads>
                   <js:VerticalLayout />
                   <js:SimpleCSSStyles padding="20" margin="50" backgroundColor="red" />
               </js:beads>
               <js:Label text="Hello" />
               <js:Label text="World" />
           </js:Container>
       </js:View>
   </js:initialView>
</js:Application>

This will compile with no warnings or errors but the padding, margin and background colour are not applied.

ViewDataBinding/ContainerDataBinding fails to bind to string

This code fails to display "Hello World" as expected.

<?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>

    <fx:Script><![CDATA[
        [Bindable] public var str:String = "Hello World";
        ]]></fx:Script>
    
    <js:initialView>
        <js:View percentWidth="100" percentHeight="100">
            <js:beads>
                <js:ViewDataBinding />
            </js:beads>
            <js:Label text="{str}" />
        </js:View>
    </js:initialView>

</js:Application>

Percentage width and height incorrectly uses padding

This example code can be scrolled sidewise until hello world is flash left on left hand side of the browser (i.e. by 500 pixels). Can also be scrolled down.

I would of expected no scrollbars and the container to be the size of the browser window.

<?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:style>
                <js:SimpleCSSStyles padding="500" />
            </js:style>
            <js:Container width="100%" height="100%">
                <js:Label text="Hello World" />
             </js:Container>
        </js:View>
    </js:initialView>

</js:Application>

JSON parse error on HTTPService when URL not found

Example code:

<?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"
                applicationComplete="init()">

    <fx:Script><![CDATA[
        import org.apache.royale.net.HTTPService;

        public var load:HTTPService = new HTTPService();

        public function init():void {
            load.url = "text.JSON";
            load.addEventListener("complete", loadedJSON);
            load.addEventListener("ioError", errorJSON);
            load.addEventListener("communicationError", errorJSON);
            load.addEventListener("httpStatus", httpStatus);
            load.send();
        }

        public function loadedJSON(event:Event):void {
            var json:Object = load.json;
        }

        public function errorJSON(event:Event):void {
              console.error("JSON error");
        }

        public function httpStatus(event:Event):void {
              console.error(load.status);
        }
        ]]></fx:Script>
    
    <js:valuesImpl>
        <js:SimpleCSSValuesImpl/>
    </js:valuesImpl>

    <js:initialView>
        <js:View>
            <js:Label text="Hello World" />
        </js:View>
    </js:initialView>

</js:Application>

When run (on Chrome) this will first show this exception:
HTTPService.js:191 GET file:///Users/justinmclean/IdeaProjects/FlexJSTest/target/javascript/bin/js-debug/text.JSON net::ERR_FILE_NOT_FOUND
And then this one:

Uncaught SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at org.apache.royale.net.HTTPService.get__json (HTTPService.js:383)
    at Example.loadedJSON (Example.js:115)
    at org.apache.royale.net.HTTPService.goog.events.EventTarget.fireListeners (eventtarget.js:284)
    at Function.goog.events.EventTarget.dispatchEventInternal_ (eventtarget.js:381)
    at org.apache.royale.net.HTTPService.goog.events.EventTarget.dispatchEvent (eventtarget.js:196)
    at org.apache.royale.net.HTTPService.org.apache.royale.events.EventDispatcher.dispatchEvent (EventDispatcher.js:73)
    at org.apache.royale.net.HTTPService.org.apache.royale.core.ElementWrapper.dispatchEvent (ElementWrapper.js:221)
    at org.apache.royale.net.HTTPService.progressHandler (HTTPService.js:208)
org.apache.royale.net.HTTPService.get__json @ HTTPService.js:383
Example.loadedJSON @ Example.js:115
goog.events.EventTarget.fireListeners @ eventtarget.js:284
goog.events.EventTarget.dispatchEventInternal_ @ eventtarget.js:381
goog.events.EventTarget.dispatchEvent @ eventtarget.js:196
org.apache.royale.events.EventDispatcher.dispatchEvent @ EventDispatcher.js:73
org.apache.royale.core.ElementWrapper.dispatchEvent @ ElementWrapper.js:221
org.apache.royale.net.HTTPService.progressHandler @ HTTPService.js:208

None of the event handler are called including httpStatus (except complete).

Can select empty cells in DateChooser

Clicking on empty cells in DateChooser selects the cell and set the selected date to null this can cause RTEs.

Sample code:

<?xml version="1.0" encoding="utf-8"?>
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:js="library://ns.apache.org/flexjs/basic">

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

    <fx:Script>
        <![CDATA[
        public function displayDate():void {
            display.text = chooser.selectedDate.toDateString();
        }
        ]]>
    </fx:Script>

    <js:initialView>
        <js:View>
            <js:Group id="content">
                <js:beads>
                    <js:VerticalLayout />
                </js:beads>
                <js:DateChooser id="chooser" width="300" click="displayDate()" />
                <js:Label id="display"/>
            </js:Group>
        </js:View>
    </js:initialView>

</js:Application>

To reproduce just click on an cell without a number in it.

DateChooser firstDayOfWeek is non functional

Most countries don't use Sunday as the first day of the week. Only USA, Canada, Japan and a few other do so. Setting the day of the week to be Monday like so doesn't seem to have any effect.

model.firstDayOfWeek = 1;

Looking at the setter it seems to me that it should be calling updateCalendar() (which it isn't) and perhaps changing model.dayNames to reflect the new order.

Even when dayName array is modified and updateCalendar is called manually there is still no effect. It looks like updateCalendar is missing code to take into account the first day of the week.

MDL Drawer should expose method for closing

If we use navigation Drawer component and display it as navigation menu, there is no ability to close it other than clicking outside component.

Proposed solution is expose method "toggleDrawer" from MDL library where user will be able to use if needed.

No easy way to bind to selectedDate in DateChooser

In this code the text label does not get updated if the selected date changes.

<?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">

    <fx:Script><![CDATA[
        ]]></fx:Script>

    <js:beads>
        <js:ApplicationDataBinding />
    </js:beads>

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

    <js:initialView>
        <js:View>
            <js:Group id="content" width="300" height="500">
                <js:beads>
                    <js:VerticalLayout />
                </js:beads>
                <js:DateChooser id="dc1" height="200" />
                <js:Label text="{dc1.selectedDate}" />
            </js:Group>
        </js:View>
    </js:initialView>

</js:Application>

This is not too unexpected but in order to support binding you would need to create both a Bindable data model and a bindable date chooser as both contain a setter/getter for selected date.

Accidentally adding bead to style causes null pointer exception when compiling

Someone may run into this issue and documenting it may help them.

Example code:

<?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 width="200" height="200">
           <js:Container>
               <js:style>
                   <js:VerticalLayout />
                   <js:SimpleCSSStyles padding="20" margin="50" backgroundColor="red" />
               </js:style>
               <js:Label text="Hello" />
               <js:Label text="World" />
           </js:Container>
       </js:View>
   </js:initialView>
</js:Application>

May not be unreasonable to think that VerticalLayout is a style rather than a bead and make this error.

Will on compilation give the rather unhelpful error below with no stack trace or other information.

Error: Unexpected exception 'java.lang.NullPointerException'.
Unexpected exception 'java.lang.NullPointerException'.

Update to select a range of dates in DateChooser

Wen trying to select a range of dates the text gets selected but only the last date is selected this is confusing.
2017-10-25_18-46-58

This is a common use case e.g. selecting the check in and check out dates for a hotel.

Visually it may be best to disable text selection in the date chooser?

The ability of selecting a date range would need to be added via a new bead rather than the existing component.

DateChooser with percentage width may display less than 7 columns

A DateChooser with a percentage width (but still large enough to display 7 columns) may display less than columns which is confusing as the dates no longer match the correct day.

Code to reproduce (will depend on your screen size):

<?xml version="1.0" encoding="utf-8"?>
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:js="library://ns.apache.org/flexjs/basic">
    <js:valuesImpl>
        <js:SimpleCSSValuesImpl/>
    </js:valuesImpl>

    <js:initialView>
        <js:View>
            <js:Group id="content">
                <js:beads>
                    <js:VerticalLayout />
                </js:beads>
                <js:DateChooser percentWidth="30" />
                <js:DateChooser width="200" />
            </js:Group>
        </js:View>
    </js:initialView>

</js:Application>

Screen shot on Chrome

2017-10-09_17-56-53

Remove flex references

We need to change reference to reflect the new project name. A quick search in the asjs repo turned up over 10,000 references to flex.

Here's a partial list (what else?)

  1. Change asjs package names from org.apache.flex to org.apache.royale
  2. Change compiler package names from org.apache.flex to org.apache.royale
  3. Change environment variable names from FLEXJS to ROYALE?
  4. Documentation annotation from FlexJS to Royale (i.e. @productversion FlexJS 0.9 becomes @productversion Royale 0.9.)
  5. Compiler annotation from flexjs to royale (i.e. @flexjsignorecoercion) These should possibly just drop the flexjs part and simply become i.e. @ignorecoercion.
  6. Are there Flex references in documentation? I assume yes.

Image not removed when src set to null

This code in the Flex SDK

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
			   xmlns:s="library://ns.adobe.com/flex/spark" 
			   xmlns:mx="library://ns.adobe.com/flex/mx"
			   applicationComplete="init()">

	<fx:Script><![CDATA[
       public function blankimage():void {
           image.source = null;
       }
     ]]></fx:Script>
	
	<s:layout>
		<s:VerticalLayout />
	</s:layout>

    <mx:Image id="image" source="https://www.apache.org/foundation/press/kit/asf_logo_url.png" width="50%" height="50%" />
    <mx:Button label="Blank" click="blankimage()" />
</s:Application>

Will blank out the image when the Blank button is pressed and the images's source set to null.

Similar code in RoyaleJS:

<?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">

    <fx:Script><![CDATA[
           public function blankimage():void {
               image.src = null;
           }
        ]]></fx:Script>

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

    <js:initialView>

        <js:View>
            <js:Container id="startPage" visible="true" width="100%">
                <js:beads>
                    <js:VerticalLayout />
                </js:beads>
                <js:Image id="image" src="https://www.apache.org/foundation/press/kit/asf_logo_url.png" width="50%" height="50%" />
                <js:TextButton text="Blank" click="blankimage()" />
            </js:Container>
        </js:View>
    </js:initialView>

</js:Application>

Fails to blank out the image.

There's obviously a few work arounds (i.e. setting visibility) but I've run into issues with slow loading images where the wrong images displayed to the user in an application.

Provenance of AMFNetConnection.as and AMFBinaryData.as

AMFNetConnection and AMFBinaryData are ports from JS to AS of amf.js from https://github.com/emilkm/amfjs which is under ALv2.

If you dig through the history, you will find that the code originally came from r-amf, a project now stored at GoogleCode https://code.google.com/archive/p/r-amf/ which claims to be under a Category X license.

However, it was established in emilkm/amfjs#17 that permission was granted to relicense the code under ALv2.

NumericStepper will show zero even when initial value is above zero

If you set the minimum value (like 1) to a value the model gets updated but the existing value doesn't and stay at the default zero.

Code to reproduce:

<?xml version="1.0" encoding="utf-8"?>
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:js="library://ns.apache.org/flexjs/basic">


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

    <js:initialView>
        <js:View>
            <js:Group id="content">
                <js:beads>
                    <js:VerticalLayout />
                </js:beads>
                <js:NumericStepper id="ns" minimum="1" maximum="10" stepSize="1" />
            </js:Group>
        </js:View>
    </js:initialView>

</js:Application>

Even though the minimum is set to 1 0 is displayed like so:
2017-10-18_17-01-33

mvn compile in royale-asjs repo is currently failing

"mvn clean compile" on the develop branch is currently failing with this error:
[ERROR] Failed to execute goal com.googlecode.maven-download-plugin:download-maven-plugin:1.2.1:wget (get-createjs) on project Fonts: IO Error: Error while expanding /Users/justinmclean/royale-asjs/frameworks/fontsrc/target/downloads/flat-ui-2.2.2.zip: Negative seek offset -> [Help 1]

Removing the cached file (to force it to downloaded a new file) fails to solve the issue:
rm /Users/justinmclean/.m2/repository/.cache/maven-download-plugin/flat-ui-2.2.2.zip

This is the URL it is downloading from:
[INFO] --- download-maven-plugin:1.2.1:wget (get-createjs) @ Fonts ---
Downloading: https://github.com/designmodo/Flat-UI/archive/2.2.2.zip
3213K downloaded

Which looks correct.

Changing to 2.3.0 (listed in releases) [1] also fails to resolve the issue.

  1. https://github.com/designmodo/Flat-UI/releases

DateField doesn't select current date in DateChooser when date previous selected

Date in DateField can get out of sync with date selected in DateChooser.

2017-10-13_18-00-32

Steps to reproduce:

  1. Open DateChooser and select date
  2. Change date in DateField
  3. Open DateChooser again

Sample code to reproduce:

<?xml version="1.0" encoding="utf-8"?>
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:js="library://ns.apache.org/flexjs/basic" xmlns:beads="org.apache.flex.html.beads.*"
                xmlns:accessories="org.apache.flex.html.accessories.*">

    <js:valuesImpl>
        <js:SimpleCSSValuesImpl/>
    </js:valuesImpl>
    
    <js:initialView>
        <js:View>
            <js:Group id="content">
                <js:DateField>
                    <js:beads>
                        <accessories:DateFormatDDMMYYYYBead />
                    </js:beads>
                </js:DateField>
            </js:Group>
        </js:View>
    </js:initialView>

</js:Application>

DateChooser has initial selection date set to today but not shown as selected

From this code:

<?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:beads>
        <js:ApplicationDataBinding />
    </js:beads>

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

    <js:initialView>
        <js:View>
            <js:Group id="content" width="300" height="500">
                <js:beads>
                    <js:VerticalLayout />
                </js:beads>
                <js:DateChooser id="dc1" height="200" />
                <js:DateChooser id="dc2" height="200" selectedDate="{dc1.selectedDate}" />
                <js:Label text="{dc1.selectedDate}" />
            </js:Group>
        </js:View>
    </js:initialView>

</js:Application>

You can see the date selected (in the second date chooser) and displayed in the label however it is not shown as selected in the first date chooser.

2017-10-28_18-34-39

DateChooser with no width or percentage width messes up when clicking on next or previous month buttons

When clicking on the previous or next month buttons A DateChooser rows become messed up like so:
2017-10-09_18-13-24

Sample code to reproduce:

<?xml version="1.0" encoding="utf-8"?>
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:js="library://ns.apache.org/flexjs/basic">

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

    <js:initialView>
        <js:View>
            <js:Group id="content">
                <js:beads>
                    <js:VerticalLayout />
                </js:beads>
                <js:DateChooser />
            </js:Group>
        </js:View>
    </js:initialView>

</js:Application>

NumericStepper can exceed maximum value

The bounds check to the upper value on NumericStepper is incorrect.

If you run this code:

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

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

<js:initialView>
    <js:View>
        <js:Group id="content">
            <js:beads>
                <js:VerticalLayout />
            </js:beads>
            <js:NumericStepper id="ns" minimum="0" maximum="1000" stepSize="7" snapInterval="7"/>
        </js:Group>
    </js:View>
</js:initialView>

</js:Application>

Ands click the up button / press space with the button focused you'll eventually get to a value of 1001.

2017-10-18_19-02-11

This boundary check in the snap function would be causing the issue:
if (value - n < n + si - value)

Button text can extends outside of button

This example show that button text can extend outside of the button.

<?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 width="100%" height="100%">
            <js:Container width="100%" height="100%">
                <js:beads>
                    <js:HorizontalLayoutWithPaddingAndGap gap="20" />
                </js:beads>
                <js:TextButton text="A Button with a lot of text on it" width="100" />
                <js:TextButton text="A Button" width="100" />
             </js:Container>
        </js:View>
    </js:initialView>

</js:Application>

Would be nice to have a truncate text bead (or similar) to stop this from happening.

Naive modification of selected date fails to update the DateChooser display

If you get a reference to the selected data and modify it the display doesn't update even if you try and force it to update.

Sample screen shot
2017-10-13_16-46-49

Sample code to reproduce this.

<?xml version="1.0" encoding="utf-8"?>
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:js="library://ns.apache.org/flexjs/basic" xmlns:beads="org.apache.flex.html.beads.*">

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

    <fx:Script>
        <![CDATA[
        import org.apache.flex.html.beads.DateChooserView;

        public function tomorrow():void {
            var tomorrow:Date =  chooser.selectedDate;
            tomorrow.setDate(tomorrow.getDate() + 1); // fails to update display
            chooser.selectedDate = tomorrow; // trying to force it also fails to update display
            date.text = chooser.selectedDate.toDateString(); // displays tomorrow's date so display is out of sync with selected date
        }
        ]]>
    </fx:Script>

    <js:beads>

    </js:beads>

    <js:initialView>
        <js:View>
            <js:Group id="content">
                <js:beads>
                    <js:VerticalLayout />
                </js:beads>
                <js:DateChooser id="chooser" width="300" />

                <js:TextButton text="Set Date" click="tomorrow()"/>
                <js:Label id="date" />
            </js:Group>
        </js:View>
    </js:initialView>

</js:Application>

This can be worked around by making a new date based on the existing selected date but seem a little cumbersome and error prone.

        public function tomorrow():void {
            var tomorrow:Date =  new Date(chooser.selectedDate.getTime());
            tomorrow.setDate(tomorrow.getDate() + 1);
            chooser.selectedDate = tomorrow;
            date.text = chooser.selectedDate.toDateString();
        }

Perhaps it would be a good idea to expose a method to update the display to keep it in sync with changes to the selected date so you could write something like this:

        public function tomorrow():void {
            var tomorrow:Date =  chooser.selectedDate;
            tomorrow.setDate(tomorrow.getDate() + 1); // fails to update display
            chooser.updateDiaplay();
        }

Boilerplate maven file unable to compile simple example

With this example:

<?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>

And this pom.xml which worked the the FlexJS SNAPSHOT:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.example.helloworld</groupId>
  <artifactId>test</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>swf</packaging>

  <build>
    <sourceDirectory>src</sourceDirectory>
    <plugins>
      <plugin>
        <groupId>org.apache.royale.compiler</groupId>
        <artifactId>royale-maven-plugin</artifactId>
        <version>0.9.0-SNAPSHOT</version>
        <extensions>true</extensions>
        <configuration>
          <mainClass>HelloWorld.mxml</mainClass>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>org.apache.royale.compiler</groupId>
            <artifactId>compiler-jx</artifactId>
            <version>0.9.0-SNAPSHOT</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.apache.royale.framework</groupId>
      <artifactId>Core</artifactId>
      <version>0.9.0-SNAPSHOT</version>
      <type>swc</type>
    </dependency>
    <dependency>
      <groupId>org.apache.royale.framework</groupId>
      <artifactId>Basic</artifactId>
      <version>0.9.0-SNAPSHOT</version>
      <type>swc</type>
    </dependency>
    <dependency>
      <groupId>org.apache.royale.framework</groupId>
      <artifactId>HTML</artifactId>
      <version>0.9.0-SNAPSHOT</version>
      <type>swc</type>
    </dependency>
    <dependency>
      <groupId>org.apache.royale.framework</groupId>
      <artifactId>Language</artifactId>
      <version>0.9.0-SNAPSHOT</version>
      <type>swc</type>
    </dependency>
    
    <dependency>
      <groupId>com.adobe.flash.framework</groupId>
      <artifactId>playerglobal</artifactId>
      <version>20.0</version>
      <type>swc</type>
      <scope>provided</scope>
    </dependency>
    
  </dependencies>

</project>

The compile fails with the following error:

using extern: externs/svg.js
using SWC: /Users/justinmclean/.m2/repository/org/apache/royale/typedefs/royale-typedefs-js/0.9.0-SNAPSHOT/royale-typedefs-js-0.9.0-SNAPSHOT-typedefs.swc
using SWC: /Users/justinmclean/.m2/repository/org/apache/royale/typedefs/royale-typedefs-gcl/0.9.0-SNAPSHOT/royale-typedefs-gcl-0.9.0-SNAPSHOT-typedefs.swc
using SWC: /Users/justinmclean/.m2/repository/org/apache/royale/framework/Core/0.9.0-SNAPSHOT/Core-0.9.0-SNAPSHOT-js.swc
using SWC: /Users/justinmclean/.m2/repository/org/apache/royale/framework/Binding/0.9.0-SNAPSHOT/Binding-0.9.0-SNAPSHOT-js.swc
using SWC: /Users/justinmclean/.m2/repository/org/apache/royale/framework/Graphics/0.9.0-SNAPSHOT/Graphics-0.9.0-SNAPSHOT-js.swc
using SWC: /Users/justinmclean/.m2/repository/org/apache/royale/framework/Collections/0.9.0-SNAPSHOT/Collections-0.9.0-SNAPSHOT-js.swc
using SWC: /Users/justinmclean/.m2/repository/org/apache/royale/framework/Basic/0.9.0-SNAPSHOT/Basic-0.9.0-SNAPSHOT-js.swc
Could not find file for class: org.apache.royale.utils.Language
File not found: org.apache.royale.utils.Language


java.lang.RuntimeException: Unable to find JavaScript filePath for class: org.apache.royale.utils.Language

Both .m2/repository/org/apache/royale/framework/Language/0.9.0-SNAPSHOT/Language-0.9.0-SNAPSHOT-js.swc and .m2/repository/org/apache/royale/framework/Language/0.9.0-SNAPSHOT/Language-0.9.0-SNAPSHOT-swf.swc exist.

And Language.js exists inside the swc:

unzip Language-0.9.0-SNAPSHOT-js.swc
Archive:  Language-0.9.0-SNAPSHOT-js.swc
  inflating: library.swf             
  inflating: js/out/Namespace.js     
  inflating: js/out/org/apache/royale/utils/Language.js  
  inflating: js/out/org/apache/royale/language/string/search.js  
  inflating: js/out/QName.js         
  inflating: js/out/LanguageClasses.js  
  inflating: js/out/org/apache/royale/language/string/match.js  
  inflating: catalog.xml   

Develop branch currently broken and unable to compile with maven

[ERROR] The project org.apache.royale.compiler:debugger:0.9.0-SNAPSHOT (/Users/justinmclean/royale-compiler/debugger/pom.xml) has 1 error
[ERROR] Unresolveable build extension: Plugin net.sourceforge.jburg:jburg-maven-plugin:1.10.4 or one of its dependencies could not be resolved: Could not find artifact org.apache.royale.compiler:compiler-jburg-types:jar:1.1.0-SNAPSHOT in apache-plugins-snapshots (https://repository.apache.org/content/repositories/snapshots) -> [Help 2]

Moving to the rename branch on royale-compiler fails to fix the issue as it fails to compile.

Data binding warning in Apache Royale TODO list example

/Users/justinmclean/royale-asjs/examples/royale/TodoListSampleApp/src/main/royale/sample/todo/renderers/TodoItemRenderer.mxml(49): col: 26 Warning: Data binding will not be able to detect assignments to 'title'.

<js:CheckBox text="{data.title}" 
                        ^

/Users/justinmclean/royale-asjs/examples/royale/TodoListSampleApp/src/main/royale/sample/todo/renderers/TodoItemRenderer.mxml(50): col: 30 Warning: Data binding will not be able to detect assignments to 'selected'.

             selected="{data.selected}" 
                            ^

/Users/justinmclean/royale-asjs/examples/royale/TodoListSampleApp/src/main/royale/sample/todo/renderers/TodoItemRenderer.mxml(49): col: 26 Data binding will not be able to detect assignments to 'title'.

<js:CheckBox text="{data.title}" 
                        ^

/Users/justinmclean/royale-asjs/examples/royale/TodoListSampleApp/src/main/royale/sample/todo/renderers/TodoItemRenderer.mxml(50): col: 30 Data binding will not be able to detect assignments to 'selected'.

             selected="{data.selected}" 

Express Hello World dependancies unclear and cause misleading compiler error

This simple project:

<?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:initialView>
       <js:View>
           <js:Label text="Hello World" />
       </js:View>
   </js:initialView>
</js:Application>

With this pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.example.helloworld</groupId>
  <artifactId>test</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>swf</packaging>

  <build>
    <sourceDirectory>src</sourceDirectory>
    <plugins>
      <plugin>
        <groupId>org.apache.royale.compiler</groupId>
        <artifactId>royale-maven-plugin</artifactId>
        <version>0.9.0-SNAPSHOT</version>
        <extensions>true</extensions>
        <configuration>
          <mainClass>HelloWorld.mxml</mainClass>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>org.apache.royale.compiler</groupId>
            <artifactId>compiler-jx</artifactId>
            <version>0.9.0-SNAPSHOT</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.apache.royale.framework</groupId>
      <artifactId>Basic</artifactId>
      <version>0.9.0-SNAPSHOT</version>
      <type>swc</type>
    </dependency>
    <dependency>
      <groupId>org.apache.royale.framework</groupId>
      <artifactId>HTML</artifactId>
      <version>0.9.0-SNAPSHOT</version>
      <type>swc</type>
    </dependency>

    <dependency>
      <groupId>org.apache.royale.framework</groupId>
      <artifactId>Language</artifactId>
      <version>0.9.0-SNAPSHOT</version>
      <type>swc</type>
      <classifier>js</classifier>
    </dependency>

    <dependency>
      <groupId>com.adobe.flash.framework</groupId>
      <artifactId>playerglobal</artifactId>
      <version>20.0</version>
      <type>swc</type>
      <scope>provided</scope>
    </dependency>
    
  </dependencies>

</project>

Compiles and works correctly. Note that the HTML package is required which may or may not be obvious.

The express version of 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/express">
   <js:initialView>
       <js:View>
           <js:Label text="Hello World" />
       </js:View>
   </js:initialView>
</js:Application>

(with Express rather than Basic in the pom.xml)

Fails to compile with this error:

/Users/justinmclean/IdeaProjects/FlexJSTest/src/Test.mxml(2): col: 1 This tag could not be resolved to an ActionScript class. It will be ignored.

<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

There's a dependancy missing the the pom.xml but what is it?

You get the same error if the HTML package is left out of the pom.xml in the basic version.

Is their any reason the frameworks pom.xml don't include all required dependancies? i.e. Basic should include HTML and Express whatever other packages it needs to work?

Using HTTPService fails to compile when adding Network dependancy to working program

With a working pom / basic example adding a HTTPService call and the Network library as a dependancy fails to compile.

Example code:

<?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"
                applicationComplete="init()">

    <fx:Script><![CDATA[
        import org.apache.royale.net.HTTPService;

        public var http:HTTPService = new HTTPService();

        public function init():void {
            load.url = "test.JSON";
            load.send();
        }
        ]]></fx:Script>
    
    <js:valuesImpl>
        <js:SimpleCSSValuesImpl/>
    </js:valuesImpl>

    <js:initialView>
        <js:View>
            <js:Label text="Hello World" />
        </js:View>
    </js:initialView>

</js:Application>

Add to pom.xml

    <dependency>
      <groupId>org.apache.royale.framework</groupId>
      <artifactId>Network</artifactId>
      <version>0.9.0-SNAPSHOT</version>
      <type>swc</type>
    </dependency>

Fails to compile with several errors as it cannot find HTTPService:

/Users/justinmclean/IdeaProjects/FlexJSTest/src/Example.mxml(7): col: 16 Warning: Definition org.apache.royale.net.HTTPService could not be found.

        import org.apache.royale.net.HTTPService;
               ^

/Users/justinmclean/IdeaProjects/FlexJSTest/src/Example.mxml(9): col: 25 Error: Type was not found or was not a compile-time constant: HTTPService.

        public var http:HTTPService = new HTTPService();
                        ^

/Users/justinmclean/IdeaProjects/FlexJSTest/src/Example.mxml(9): col: 43 Error: Call to a possibly undefined method HTTPService.

        public var http:HTTPService = new HTTPService();
                                          ^

/Users/justinmclean/IdeaProjects/FlexJSTest/src/Example.mxml(13): col: 13 Error: Access of possibly undefined property load.

            load.url = "test.JSON";
            ^

/Users/justinmclean/IdeaProjects/FlexJSTest/src/Example.mxml(14): col: 13 Error: Access of possibly undefined property load.

            load.send();
            ^

/Users/justinmclean/IdeaProjects/FlexJSTest/src/Example.mxml(7): col: 16 Definition org.apache.royale.net.HTTPService could not be found.

        import org.apache.royale.net.HTTPService;
               ^

/Users/justinmclean/IdeaProjects/FlexJSTest/src/Example.mxml(9): col: 25 Type was not found or was not a compile-time constant: HTTPService.

        public var http:HTTPService = new HTTPService();
                        ^

/Users/justinmclean/IdeaProjects/FlexJSTest/src/Example.mxml(9): col: 43 Call to a possibly undefined method HTTPService.

        public var http:HTTPService = new HTTPService();
                                          ^

/Users/justinmclean/IdeaProjects/FlexJSTest/src/Example.mxml(13): col: 13 Access of possibly undefined property load.

            load.url = "test.JSON";
            ^

/Users/justinmclean/IdeaProjects/FlexJSTest/src/Example.mxml(14): col: 13 Access of possibly undefined property load.

            load.send();

Working pom.xml had Basic, HTML, Language and playerglobal as dependancies.

DateChooser with height of 200 or so hides last row of dates

If you set the height on a DataChooser to be under 230 pixels the last row of the DateChooser may be hidden.

Code to reproduce:

<?xml version="1.0" encoding="utf-8"?>
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:js="library://ns.apache.org/flexjs/basic">
    <js:valuesImpl>
        <js:SimpleCSSValuesImpl/>
    </js:valuesImpl>

    <js:initialView>
        <js:View>
            <js:Group id="content">
                <js:beads>
                    <js:VerticalLayout />
                </js:beads>
                <js:DateChooser width="300" height="200" />
                <js:DateChooser width="300" height="230" />
            </js:Group>
        </js:View>
    </js:initialView>

</js:Application>

Screen shot on Chrome
2017-10-09_17-56-32

Slider arrow not in middle of thumb

The arrow on the thumb is not aligned on the vertical centre.

Example code:

<?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:beads>
        <js:ApplicationDataBinding />
    </js:beads>

   <js:initialView>
       <js:View width="200" height="200">
           <js:Container>
               <js:beads>
                   <js:VerticalLayout />
               </js:beads>
               <js:Slider id="s" minimum="0" maximum="10" />
               <js:Label text="{s.value}" />
           </js:Container>
       </js:View>
   </js:initialView>
</js:Application>

2017-11-14_14-12-04

DateField model missing text in date field

Currently it's a little cumbersome to get hold of the text typed into a date field and you need to know what class the view is.

For instance:
dateFieldText = (dateField.view as DateFieldView).textInput.text;

Full example:

<?xml version="1.0" encoding="utf-8"?>
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:js="library://ns.apache.org/flexjs/basic"
                xmlns:accessories="org.apache.flex.html.accessories.*">

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

    <fx:Script>
        <![CDATA[
        import org.apache.flex.html.beads.DateFieldView;

        public function showDate():void {
            selectedDate.text = dateField.selectedDate.toDateString();
            typedDate.text = (dateField.view as DateFieldView).textInput.text;
        }
        ]]>
    </fx:Script>

    <js:initialView>
        <js:View>
            <js:Group id="content">
                <js:beads>
                    <js:VerticalLayout />
                </js:beads>
                <js:DateField id="dateField">
                    <js:beads>
                        <accessories:DateFormatDDMMYYYYBead />
                    </js:beads>
                </js:DateField>
                <js:TextButton text="Show Date" click="showDate()" />
                <js:Label id="selectedDate" />
                <js:Label id="typedDate" />
            </js:Group>
        </js:View>
    </js:initialView>

</js:Application>

Numeric stopper unable to step in 0.1 (or other units other than whole numbers)

This code:

<?xml version="1.0" encoding="utf-8"?>
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:js="library://ns.apache.org/flexjs/basic">


    <fx:Script><![CDATA[
        public function clicked():void {
            ns.minimum = 5;
            ns.value = 1;
        }
        ]]></fx:Script>

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

    <js:initialView>
        <js:View>
            <js:Group id="content">
                <js:beads>
                    <js:VerticalLayout />
                </js:beads>
                <js:NumericStepper id="ns" minimum="0" maximum="1" stepSize="0.1" />
                <js:TextButton text="Change minimum and value" click="clicked()" />
            </js:Group>
        </js:View>
    </js:initialView>

</js:Application>

Is forever stuck on 0 and the step arrow does nothing.

The issue is caused by this line in the model's snap function as Math.round is used:
var n:Number = Math.round((value - minimum) / si) * si + minimum;

When Application is missing initial view confusing variable null0 is undeclared warning occurs

If the initial view is missing from the application a warning is produced when compiling:
App.js:93: WARNING - variable null0 is undeclared
null0,
^^^^^

and the build is marked as successful.

Sample code to reproduce:

<?xml version="1.0" encoding="utf-8"?>
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:js="library://ns.apache.org/flexjs/basic">

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

    <js:DateChooser />
</js:Application>

When run the program produces an RTE "Uncaught ReferenceError: null0 is not defined" at the same line number.

This is an user error obviously but would be nice if an error was raised not a warning or better still a warning/error stating you are missing the initialview.

ViewDataBinding not working as expected when binding to properties within objects

This flex SDK code:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
			   xmlns:s="library://ns.adobe.com/flex/spark" 
			   xmlns:mx="library://ns.adobe.com/flex/mx"
			   applicationComplete="init()">

	<s:layout>
		<s:VerticalLayout />
	</s:layout>
	
	<fx:Script>
		<![CDATA[
		[Bindable] public var obj:Object;

        public function init():void {
            obj = {text:"Hello World"};
        }
		]]>
	</fx:Script>
    
	<mx:Label text="{obj.text}" />

</s:Application>

Generates a warning re binding but still display "Hello World" as expected as the entire object is replaced.

The similar RoyaleJS code also generate a binding warning but fails to display "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"
                xmlns:local="*" applicationComplete="init()">

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

    <fx:Script><![CDATA[

        [Bindable] public var obj:Object;

        public function init():void {
            obj = {text:"Hello World"};
        }
        ]]></fx:Script>
    
    <js:initialView>
        <js:View percentWidth="100" percentHeight="100">
            <js:beads>
                <js:ViewDataBinding/>
            </js:beads>
            <js:Label text="{obj.text}" />
        </js:View>
    </js:initialView>

</js:Application>

I can see that the binding event is being dispatched when the obj assignment is executed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.