This is an automated email from the ASF dual-hosted git repository. joshtynjala pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/royale-docs.git
commit 2634f935a6a1ad74da44a5a057378884e542736a Author: Josh Tynjala <[email protected]> AuthorDate: Thu Aug 21 15:47:10 2025 -0700 code uses 4 spaces instead of tabs because tabs render with a width of 8 in HTML --- component-sets/jewel/jewel-application.md | 4 +- component-sets/jewel/jewel-card.md | 68 +++++++++--------- component-sets/jewel/jewel-drawer.md | 38 +++++----- component-sets/jewel/jewel-hcontainer.md | 12 ++-- component-sets/jewel/jewel-hgroup.md | 12 ++-- component-sets/jewel/jewel-responsiveview.md | 16 ++--- component-sets/jewel/jewel-vcontainer.md | 12 ++-- component-sets/jewel/jewel-vgroup.md | 12 ++-- component-sets/jewel/jewel-view.md | 18 ++--- .../optimizations/doc-comment-directives.md | 38 +++++----- features/as3.md | 34 ++++----- features/as3/abstract-classes.md | 72 +++++++++---------- features/as3/classes-and-functions.md | 20 +++--- features/as3/import-aliases.md | 32 ++++----- features/as3/interfaces.md | 10 +-- features/as3/language-basics.md | 2 +- features/as3/metadata.md | 6 +- features/as3/packages.md | 16 ++--- features/as3/private-constructors.md | 74 +++++++++---------- features/as3/reflection-introspection.md | 2 +- features/as3/type-inference.md | 44 ++++++------ features/data-binding.md | 84 +++++++++++----------- features/externs.md | 32 ++++----- features/nodejs/external-modules.md | 26 +++---- features/nodejs/modules.md | 24 +++---- features/nodejs/scripting.md | 68 +++++++++--------- features/strands-and-beads.md | 48 ++++++------- features/styles-skins-themes.md | 2 +- formatter/asformat-config-file.md | 6 +- libraries/compiled-code-libraries.md | 48 ++++++------- libraries/crux/quickstart.md | 32 ++++----- linter/aslint-config-file.md | 6 +- testing/royaleunit/create-a-unit-test.md | 80 ++++++++++----------- testing/royaleunit/metadata.md | 28 ++++---- testing/royaleunit/run-unit-tests-with-ant.md | 12 ++-- user-interface/components.md | 2 +- .../loading-external-data/httpservice.md | 2 +- 37 files changed, 521 insertions(+), 521 deletions(-) diff --git a/component-sets/jewel/jewel-application.md b/component-sets/jewel/jewel-application.md index 3f862b4..3238406 100644 --- a/component-sets/jewel/jewel-application.md +++ b/component-sets/jewel/jewel-application.md @@ -45,7 +45,7 @@ In __MXML__ declare an `Application` as the root tag of the main application fil ```mxml <j:Application xmlns:fx="http://ns.adobe.com/mxml/2009" - xmlns:j="library://ns.apache.org/royale/jewel"> + xmlns:j="library://ns.apache.org/royale/jewel"> <j:valuesImpl> <js:SimpleCSSValuesImpl /> @@ -63,7 +63,7 @@ If the filename is `App.mxml`, building the application will generate the follow ```javascript <script type="text/javascript"> - new App().start(); + new App().start(); </script> ``` diff --git a/component-sets/jewel/jewel-card.md b/component-sets/jewel/jewel-card.md index 7350f9b..403f1bc 100644 --- a/component-sets/jewel/jewel-card.md +++ b/component-sets/jewel/jewel-card.md @@ -79,40 +79,40 @@ Finally a `CardActions` with two `BarSection`s (similar to card header). In the ```mxml <j:Card> - <j:CardHeader> - <j:BarSection> - <j:CardTitle text="Object Collection" className="secondary-normal"/> - </j:BarSection> - <j:BarSection itemsHorizontalAlign="itemsRight"> - <j:IconButton unboxed="true" click="assignNewData(avengersComboBox)"> - <j:icon> - <js:MaterialIcon text="{MaterialIconType.SETTINGS_BACKUP_RESTORE}" /> - </j:icon> - <j:beads> - <j:ToolTip toolTip="Assign new data"/> - </j:beads> - </j:IconButton> - </j:BarSection> - </j:CardHeader> - <j:CardPrimaryContent> - <j:Label multiline="true"> - <j:html><![CDATA[<p>This <b>ComboBox</b> is using an object collection as <i>dataProvider</i>. Use <i>labelField</i> to indicate the object property to use as label. A <b>ComboBoxTextPrompt</b> bead is used to show a prompt message.</p>]]></j:html> - </j:Label> - <j:ComboBox localId="avengersComboBox" labelField="label" dataProvider="{listModel.avengers}"> - <j:beads> - <j:ComboBoxTextPrompt prompt="Avengers Team..."/> - </j:beads> - </j:ComboBox> - </j:CardPrimaryContent> - <j:CardActions itemsVerticalAlign="itemsCenter"> - <j:BarSection> - <j:Label localId="avengersComboBoxResult" html="{describeItem(avengersComboBox.selectedItem)}"/> - </j:BarSection> - <j:BarSection gap="3" itemsHorizontalAlign="itemsRight"> - <j:Label text="Select Index: "/> - <j:NumericStepper valueChange="avengersComboBox.selectedIndex = event.target.value" minimum="0" maximum="8"/> - </j:BarSection> - </j:CardActions> + <j:CardHeader> + <j:BarSection> + <j:CardTitle text="Object Collection" className="secondary-normal"/> + </j:BarSection> + <j:BarSection itemsHorizontalAlign="itemsRight"> + <j:IconButton unboxed="true" click="assignNewData(avengersComboBox)"> + <j:icon> + <js:MaterialIcon text="{MaterialIconType.SETTINGS_BACKUP_RESTORE}" /> + </j:icon> + <j:beads> + <j:ToolTip toolTip="Assign new data"/> + </j:beads> + </j:IconButton> + </j:BarSection> + </j:CardHeader> + <j:CardPrimaryContent> + <j:Label multiline="true"> + <j:html><![CDATA[<p>This <b>ComboBox</b> is using an object collection as <i>dataProvider</i>. Use <i>labelField</i> to indicate the object property to use as label. A <b>ComboBoxTextPrompt</b> bead is used to show a prompt message.</p>]]></j:html> + </j:Label> + <j:ComboBox localId="avengersComboBox" labelField="label" dataProvider="{listModel.avengers}"> + <j:beads> + <j:ComboBoxTextPrompt prompt="Avengers Team..."/> + </j:beads> + </j:ComboBox> + </j:CardPrimaryContent> + <j:CardActions itemsVerticalAlign="itemsCenter"> + <j:BarSection> + <j:Label localId="avengersComboBoxResult" html="{describeItem(avengersComboBox.selectedItem)}"/> + </j:BarSection> + <j:BarSection gap="3" itemsHorizontalAlign="itemsRight"> + <j:Label text="Select Index: "/> + <j:NumericStepper valueChange="avengersComboBox.selectedIndex = event.target.value" minimum="0" maximum="8"/> + </j:BarSection> + </j:CardActions> </j:Card> ``` diff --git a/component-sets/jewel/jewel-drawer.md b/component-sets/jewel/jewel-drawer.md index e2cc431..f1a743e 100644 --- a/component-sets/jewel/jewel-drawer.md +++ b/component-sets/jewel/jewel-drawer.md @@ -56,25 +56,25 @@ In __MXML__ declare a `Drawer` like this: ```mxml <j:Drawer> - <j:beads> - <j:ResponsiveDrawer auto="true"/> - </j:beads> - - <j:DrawerHeader> - <j:ImageButton src="assets/apache-royale-jewel-logo-white.svg"/> - </j:DrawerHeader> - - <j:DrawerContent> - <j:Navigation/> - <j:Divider/> - <j:Navigation/> - </j:DrawerContent> - - <j:DrawerFooter> - <j:BarSection> - <j:Label text="Some Footer Content"/> - </j:BarSection> - </j:DrawerFooter> + <j:beads> + <j:ResponsiveDrawer auto="true"/> + </j:beads> + + <j:DrawerHeader> + <j:ImageButton src="assets/apache-royale-jewel-logo-white.svg"/> + </j:DrawerHeader> + + <j:DrawerContent> + <j:Navigation/> + <j:Divider/> + <j:Navigation/> + </j:DrawerContent> + + <j:DrawerFooter> + <j:BarSection> + <j:Label text="Some Footer Content"/> + </j:BarSection> + </j:DrawerFooter> </j:Drawer> ``` diff --git a/component-sets/jewel/jewel-hcontainer.md b/component-sets/jewel/jewel-hcontainer.md index 1f00db5..8b89873 100644 --- a/component-sets/jewel/jewel-hcontainer.md +++ b/component-sets/jewel/jewel-hcontainer.md @@ -43,12 +43,12 @@ In __MXML__ declare a `HContainer` like this: ```mxml <j:HContainer width="100%" height="300" gap="3" itemsHorizontalAlign="itemsCenter"> - <j:Card width="100" height="50%"> - <j:Label text="horz center"/> - </j:Card> - <j:Card width="100" height="50%"> - <j:Label text="horz center"/> - </j:Card> + <j:Card width="100" height="50%"> + <j:Label text="horz center"/> + </j:Card> + <j:Card width="100" height="50%"> + <j:Label text="horz center"/> + </j:Card> </j:HContainer> ``` diff --git a/component-sets/jewel/jewel-hgroup.md b/component-sets/jewel/jewel-hgroup.md index 65107ca..dfc3c72 100644 --- a/component-sets/jewel/jewel-hgroup.md +++ b/component-sets/jewel/jewel-hgroup.md @@ -43,12 +43,12 @@ In __MXML__ declare a `HGroup` like this: ```mxml <j:HGroup width="100%" height="300" gap="3" itemsHorizontalAlign="itemsCenter"> - <j:Card width="100" height="50%"> - <j:Label text="horz center"/> - </j:Card> - <j:Card width="100" height="50%"> - <j:Label text="horz center"/> - </j:Card> + <j:Card width="100" height="50%"> + <j:Label text="horz center"/> + </j:Card> + <j:Card width="100" height="50%"> + <j:Label text="horz center"/> + </j:Card> </j:HGroup> ``` diff --git a/component-sets/jewel/jewel-responsiveview.md b/component-sets/jewel/jewel-responsiveview.md index af01747..5bedff0 100644 --- a/component-sets/jewel/jewel-responsiveview.md +++ b/component-sets/jewel/jewel-responsiveview.md @@ -47,7 +47,7 @@ In __MXML__ declare a `ResponsiveView` like this: ```mxml <j:ResponsiveView xmlns:fx="http://ns.adobe.com/mxml/2009" - xmlns:j="library://ns.apache.org/royale/jewel"> + xmlns:j="library://ns.apache.org/royale/jewel"> <!-- ResponsiveView code goes here --> </j:ResponsiveView> @@ -59,13 +59,13 @@ You can also set the ResponsiveView directly in the application mxml file inside ```mxml <j:Application xmlns:fx="http://ns.adobe.com/mxml/2009" - xmlns:j="library://ns.apache.org/royale/jewel"> - ... - <j:initialView> - <j:ResponsiveView> - <!-- ResponsiveView code goes here --> - </j:ResponsiveView> - </j:initialView> + xmlns:j="library://ns.apache.org/royale/jewel"> + ... + <j:initialView> + <j:ResponsiveView> + <!-- ResponsiveView code goes here --> + </j:ResponsiveView> + </j:initialView> </j:Application> ``` diff --git a/component-sets/jewel/jewel-vcontainer.md b/component-sets/jewel/jewel-vcontainer.md index 942c565..5110d24 100644 --- a/component-sets/jewel/jewel-vcontainer.md +++ b/component-sets/jewel/jewel-vcontainer.md @@ -43,12 +43,12 @@ In __MXML__ declare a `VContainer` like this: ```mxml <j:VContainer width="100%" height="300" gap="3" itemsVerticalAlign="itemsBottom"> - <j:Card width="50%" height="100"> - <j:Label text="vert bottom"/> - </j:Card> - <j:Card width="50%" height="100"> - <j:Label text="vert bottom"/> - </j:Card> + <j:Card width="50%" height="100"> + <j:Label text="vert bottom"/> + </j:Card> + <j:Card width="50%" height="100"> + <j:Label text="vert bottom"/> + </j:Card> </j:VContainer> ``` diff --git a/component-sets/jewel/jewel-vgroup.md b/component-sets/jewel/jewel-vgroup.md index 2c88406..71c5478 100644 --- a/component-sets/jewel/jewel-vgroup.md +++ b/component-sets/jewel/jewel-vgroup.md @@ -43,12 +43,12 @@ In __MXML__ declare a `VGroup` like this: ```mxml <j:VGroup width="100%" height="300" gap="3" itemsVerticalAlign="itemsBottom"> - <j:Card width="50%" height="100"> - <j:Label text="vert bottom"/> - </j:Card> - <j:Card width="50%" height="100"> - <j:Label text="vert bottom"/> - </j:Card> + <j:Card width="50%" height="100"> + <j:Label text="vert bottom"/> + </j:Card> + <j:Card width="50%" height="100"> + <j:Label text="vert bottom"/> + </j:Card> </j:VGroup> ``` diff --git a/component-sets/jewel/jewel-view.md b/component-sets/jewel/jewel-view.md index 546e9a8..380bcfa 100644 --- a/component-sets/jewel/jewel-view.md +++ b/component-sets/jewel/jewel-view.md @@ -45,8 +45,8 @@ In __MXML__ declare a `View` like this: ```mxml <j:View xmlns:fx="http://ns.adobe.com/mxml/2009" - xmlns:j="library://ns.apache.org/royale/jewel" - width="100%" height="100%"> + xmlns:j="library://ns.apache.org/royale/jewel" + width="100%" height="100%"> <!-- View code goes here --> </j:View> @@ -56,13 +56,13 @@ or directly in the application mxml file inside the `initialView`: ```mxml <j:Application xmlns:fx="http://ns.adobe.com/mxml/2009" - xmlns:j="library://ns.apache.org/royale/jewel"> - ... - <j:initialView> - <j:View width="100%" height="100%"> - <!-- View code goes here --> - </j:View> - </j:initialView> + xmlns:j="library://ns.apache.org/royale/jewel"> + ... + <j:initialView> + <j:View width="100%" height="100%"> + <!-- View code goes here --> + </j:View> + </j:initialView> </j:Application> ``` diff --git a/create-an-application/optimizations/doc-comment-directives.md b/create-an-application/optimizations/doc-comment-directives.md index 3e275b5..3252183 100644 --- a/create-an-application/optimizations/doc-comment-directives.md +++ b/create-an-application/optimizations/doc-comment-directives.md @@ -61,7 +61,7 @@ This means that for: ```as3 class MyThing { - public var myImportantVar:String = 'myValue'; + public var myImportantVar:String = 'myValue'; } ``` @@ -99,12 +99,12 @@ A simplistic, illustrative example is: ```as3 if (myVar is MyClass) { //this generates code to check if myVar is of type 'MyClass' - (myVar as MyClass).myClassMethod(); - //the above normally generates similar code to check if myVar is of type 'MyClass' - //or a subclass of MyClass, and if it is not, treats it as null - MyClass(myVar).myOtherClassMethod(); - //the above normally generates similar code to check if myVar is of type 'MyClass' - //or a subclass of MyClass, and if it is not, throws an error + (myVar as MyClass).myClassMethod(); + //the above normally generates similar code to check if myVar is of type 'MyClass' + //or a subclass of MyClass, and if it is not, treats it as null + MyClass(myVar).myOtherClassMethod(); + //the above normally generates similar code to check if myVar is of type 'MyClass' + //or a subclass of MyClass, and if it is not, throws an error } ``` @@ -140,10 +140,10 @@ A simplistic example is: * setting goes here */ public function testResolveUncertain():void { - var myClass:Class = int; - if (new myClass(30) === 30) trace('it worked!); - var myOtherClass:Class = String; - if (new myOtherClass('test') === 'test') trace('it worked again!); + var myClass:Class = int; + if (new myClass(30) === 30) trace('it worked!); + var myOtherClass:Class = String; + if (new myOtherClass('test') === 'test') trace('it worked again!); } ``` @@ -180,12 +180,12 @@ A simplistic example is: * setting goes here */ public function myTest():void { - var vi:Vector.<int> = new <int>[0, 1, 2, 3, 4]; - vi[8] = 0; - //index 8 above is too high - //by default this will throw a RangeError, but if - //@royalesuppressvectorindexcheck is used to suppress index checking, - //no runtime error would be thrown in javascript. + var vi:Vector.<int> = new <int>[0, 1, 2, 3, 4]; + vi[8] = 0; + //index 8 above is too high + //by default this will throw a RangeError, but if + //@royalesuppressvectorindexcheck is used to suppress index checking, + //no runtime error would be thrown in javascript. } ``` @@ -221,8 +221,8 @@ A simplistic example is: * setting goes here */ public function testComplexImplicitCoercion():void { - var something:* = new Cat(); - var myDog:Dog = something; + var something:* = new Cat(); + var myDog:Dog = something; } ``` diff --git a/features/as3.md b/features/as3.md index 1f4aca4..cac7650 100644 --- a/features/as3.md +++ b/features/as3.md @@ -31,23 +31,23 @@ The following code snippet shows some of ActionScript's core syntax: ```as3 package org.apache.royale { - public class WelcomeToActionScript - { - public function WelcomeToActionScript() - { - var message:String = "Hello world"; - sayHi(message, 3); - } - - private function sayHi(message:String, times:int):void - { - for (var i:int = 0; i < times; i++) - { - // prints message to debug console - trace(message); - } - } - } + public class WelcomeToActionScript + { + public function WelcomeToActionScript() + { + var message:String = "Hello world"; + sayHi(message, 3); + } + + private function sayHi(message:String, times:int):void + { + for (var i:int = 0; i < times; i++) + { + // prints message to debug console + trace(message); + } + } + } } ``` diff --git a/features/as3/abstract-classes.md b/features/as3/abstract-classes.md index 4c43d2d..ffed007 100644 --- a/features/as3/abstract-classes.md +++ b/features/as3/abstract-classes.md @@ -43,17 +43,17 @@ Consider the following code that creates a class named `GraphicsObject`: ```as3 package { - public abstract class GraphicsObject - { - public function GraphicsObject() - { - } + public abstract class GraphicsObject + { + public function GraphicsObject() + { + } - public var x:Number; - public var y:Number; + public var x:Number; + public var y:Number; - public abstract function draw(context:IGraphicsContext):void; - } + public abstract function draw(context:IGraphicsContext):void; + } } ``` @@ -74,26 +74,26 @@ The next code sample shows how to extend the abstract class `GraphicsObject` and ```as3 package { - public class Rectangle extends GraphicsObject - { - public function Rectangle(width:Number, height:Number) - { - this.width = width; - this.height = height; - } - - public var width:Number; - public var height:Number; - - public abstract function draw(context:IGraphicsContext):void - { - context.moveTo(x, y); - context.lineTo(x + width, y); - context.lineTo(x + width, y + height); - context.lineTo(x, y + height); - context.lineTo(x, y); - } - } + public class Rectangle extends GraphicsObject + { + public function Rectangle(width:Number, height:Number) + { + this.width = width; + this.height = height; + } + + public var width:Number; + public var height:Number; + + public abstract function draw(context:IGraphicsContext):void + { + context.moveTo(x, y); + context.lineTo(x + width, y); + context.lineTo(x + width, y + height); + context.lineTo(x, y + height); + context.lineTo(x, y); + } + } } ``` @@ -103,13 +103,13 @@ If we extended `GraphicsObject` and did not implement its abstract method, we'd ```as3 package { - // Error: Method draw in abstract class GraphicsObject not implemented by class Foobar - public class Foobar extends GraphicsObject - { - public function Foobar() - { - } - } + // Error: Method draw in abstract class GraphicsObject not implemented by class Foobar + public class Foobar extends GraphicsObject + { + public function Foobar() + { + } + } } ``` diff --git a/features/as3/classes-and-functions.md b/features/as3/classes-and-functions.md index 477dca0..a1900c1 100644 --- a/features/as3/classes-and-functions.md +++ b/features/as3/classes-and-functions.md @@ -39,11 +39,11 @@ Constructors in ActionScript are optional. If you need to initialize something i ```as3 package { - public class SubClass() { - foo = "foo"; - super("baz") - } - private var foo:String + public class SubClass() { + foo = "foo"; + super("baz") + } + private var foo:String } ``` @@ -70,11 +70,11 @@ You don't need to declare a class to use code. You can have "utility" functions ```as3 package com.acme { - public function doAwesome(notSoAwesome:Object):Awesome { - return new Awesome( - doSomethingComplicatedInTheSamePackage(notSoAwesome) - ); - } + public function doAwesome(notSoAwesome:Object):Awesome { + return new Awesome( + doSomethingComplicatedInTheSamePackage(notSoAwesome) + ); + } } ``` diff --git a/features/as3/import-aliases.md b/features/as3/import-aliases.md index 9bc63a1..201d074 100644 --- a/features/as3/import-aliases.md +++ b/features/as3/import-aliases.md @@ -43,27 +43,27 @@ Consider the following code that imports two classes named `Event`, but gives th ```as3 package { - import ExampleEvent = com.example.events.Event; - import RoyaleEvent = org.apache.royale.events.Event; + import ExampleEvent = com.example.events.Event; + import RoyaleEvent = org.apache.royale.events.Event; - public class MyClass - { - public function MyClass() - { - addEventListener(RoyaleEvent.CHANGE, onRoyaleEvent); - addEventListener(ExampleEvent.EXAMPLE, onExampleEvent); - } + public class MyClass + { + public function MyClass() + { + addEventListener(RoyaleEvent.CHANGE, onRoyaleEvent); + addEventListener(ExampleEvent.EXAMPLE, onExampleEvent); + } - public function onRoyaleEvent(event:RoyaleEvent):void - { + public function onRoyaleEvent(event:RoyaleEvent):void + { - } + } - public function onExampleEvent(event:ExampleEvent):void - { + public function onExampleEvent(event:ExampleEvent):void + { - } - } + } + } } ``` diff --git a/features/as3/interfaces.md b/features/as3/interfaces.md index d8df8b7..2d9f441 100644 --- a/features/as3/interfaces.md +++ b/features/as3/interfaces.md @@ -42,10 +42,10 @@ Here's one example ```as3 package com.acme { - public interface IFoo { - function get name():String; - function set name(name:String):void; - function sayFoo(output:IOutput):void; - } + public interface IFoo { + function get name():String; + function set name(name:String):void; + function sayFoo(output:IOutput):void; + } } ``` \ No newline at end of file diff --git a/features/as3/language-basics.md b/features/as3/language-basics.md index 29b0b00..138e541 100644 --- a/features/as3/language-basics.md +++ b/features/as3/language-basics.md @@ -24,7 +24,7 @@ permalink: /features/as3/language-basics Language basics in ActionScript 3 -ActionScript is a superset of the ECMAScript edition 4 specification. That gives it the same roots as JavaScript and code will look very similar. The biggest difference is the optionally typed quality of ActionScript, and classes. Ecma 6 added classes to JavaScript as well, but JavaScript classes are less structured that ActionScript classes. +ActionScript is a superset of the ECMAScript edition 4 specification. That gives it the same roots as JavaScript and code will look very similar. The biggest difference is the optionally typed quality of ActionScript, and classes. ECMAScript 6 added classes to JavaScript as well, but JavaScript classes are less structured that ActionScript classes. Because ActionScript was forked from the ECMAScript specification at version 4, there are features that JavaScript has which are missing from ActionScript and vice versa. Below is an overview of the main ActionScript features. diff --git a/features/as3/metadata.md b/features/as3/metadata.md index 6ddc4c2..58a0934 100644 --- a/features/as3/metadata.md +++ b/features/as3/metadata.md @@ -37,7 +37,7 @@ The next example in **MXML** decorates the class with `[Event]` metadata inside ```mxml <fx:Metadata> - [Event(name="someEvent", type="org.apache.royale.events.Event")] + [Event(name="someEvent", type="org.apache.royale.events.Event")] </fx:Metadata> ``` @@ -633,7 +633,7 @@ For example, you may create an **MXML** component that defines a new event. To m ```mxml <fx:Metadata> - [Event(name="someEvent",type="org.apache.royale.events.Event")] + [Event(name="someEvent",type="org.apache.royale.events.Event")] </fx:Metadata> ``` @@ -643,7 +643,7 @@ In an MXML file, you insert the metadata tags either in an `<fx:Script>` block a ```mxml <j:Group xmlns:fx="http://ns.adobe.com/mxml/2009" - xmlns:j="library://ns.apache.org/royale/jewel"> + xmlns:j="library://ns.apache.org/royale/jewel"> <fx:Metadata> [Event("enableChange",type="org.apache.royale.events.Event")] diff --git a/features/as3/packages.md b/features/as3/packages.md index 1a23dc9..245cace 100644 --- a/features/as3/packages.md +++ b/features/as3/packages.md @@ -28,10 +28,10 @@ Code in ActionScript is structured the same way Java code is structured. Each Ac ```as3 package { - class Foo { - public function Foo() { - } - } + class Foo { + public function Foo() { + } + } } ``` @@ -39,10 +39,10 @@ You can name your folder structure any way you like, but an accepted convention ```as3 package com.acme { - class MyFoo { - public function MyFoo() { - } - } + class MyFoo { + public function MyFoo() { + } + } } ``` diff --git a/features/as3/private-constructors.md b/features/as3/private-constructors.md index 0bb1a86..e4642d7 100644 --- a/features/as3/private-constructors.md +++ b/features/as3/private-constructors.md @@ -43,28 +43,28 @@ You might implement a global logger as a singleton by using a private constructo ```as3 package { - public class Logger - { - private static var _instance:Logger; - - public static function getInstance():Logger - { - if(!_instance) - { - _instance = new Logger(); - } - return _instance; - } - - private function Logger() - { - } - - public function log(message:String):void - { - trace("LOG: " + message); - } - } + public class Logger + { + private static var _instance:Logger; + + public static function getInstance():Logger + { + if(!_instance) + { + _instance = new Logger(); + } + return _instance; + } + + private function Logger() + { + } + + public function log(message:String):void + { + trace("LOG: " + message); + } + } } ``` @@ -73,14 +73,14 @@ If you were to attempt to instantate this `Logger` class, the compiler would fai ```as3 package com.example { - public class MyApplication - { - public function MyApplication() - { - // Error: Attempted access of inaccessible constructor through a reference with static type Logger - var obj:Logger = new Logger(); - } - } + public class MyApplication + { + public function MyApplication() + { + // Error: Attempted access of inaccessible constructor through a reference with static type Logger + var obj:Logger = new Logger(); + } + } } ``` @@ -89,13 +89,13 @@ However, you may call `Logger.getInstance()` to access an instance that is creat ```as3 package com.example { - public class MyApplication - { - public function MyApplication() - { - Logger.getInstance().log("Application started"); - } - } + public class MyApplication + { + public function MyApplication() + { + Logger.getInstance().log("Application started"); + } + } } ``` diff --git a/features/as3/reflection-introspection.md b/features/as3/reflection-introspection.md index 7e4e514..491ec7b 100644 --- a/features/as3/reflection-introspection.md +++ b/features/as3/reflection-introspection.md @@ -151,7 +151,7 @@ Note that static class objects are always dynamic, as are Interface Objects ``` if(isDynamicObject(myObject)){ - trace("yay!); + trace("yay!); } ``` diff --git a/features/as3/type-inference.md b/features/as3/type-inference.md index a44c5c3..50966e5 100644 --- a/features/as3/type-inference.md +++ b/features/as3/type-inference.md @@ -70,11 +70,11 @@ The property defined below includes both getter and setter functions, and they a private var _memberProp = "hello"; public function get memberProp() { - return _memberProp; + return _memberProp; } public function set memberProp(value) { - _memberProp = value; + _memberProp = value; } ``` @@ -84,7 +84,7 @@ The return type of the function below is `Number` because the result of the `ret ```as3 function add(a:Number, b:Number) { - return a + b; + return a + b; } ``` @@ -93,14 +93,14 @@ If a function contains no `return` statements, the inferred type is `void`. ```as3 function log(text:String, source:String = null) { - if (source) - { - trace("[" + source + "] " + text); - } - else - { - trace(text); - } + if (source) + { + trace("[" + source + "] " + text); + } + else + { + trace(text); + } } ``` @@ -109,11 +109,11 @@ If a function contains multiple `return` statements, the common base class of al ```as3 function getResult(a:A, b:B, preferB:Boolean = true) { - if (preferB) - { - return b; - } - return a; + if (preferB) + { + return b; + } + return a; } ``` @@ -161,12 +161,12 @@ The return type of the function below is `Number` because the function returns a ```as3 function round(value:Number) { - var integer = int(value); - var difference = value - integer; - if (difference >= 0.5) { - return integer + 1.0; - } - return integer; + var integer = int(value); + var difference = value - integer; + if (difference >= 0.5) { + return integer + 1.0; + } + return integer; } ``` diff --git a/features/data-binding.md b/features/data-binding.md index 4df2251..31b80a0 100644 --- a/features/data-binding.md +++ b/features/data-binding.md @@ -66,48 +66,48 @@ You can bind the value of a property in the user interface to that value of anot ``` <?xml version="1.0" encoding="utf-8"?> <j:Application xmlns:fx="http://ns.adobe.com/mxml/2009" - xmlns:j="library://ns.apache.org/royale/jewel" - pageTitle="Data Binding test"> - - <fx:Script> - <![CDATA[ - - private function textInputChange(event:Event):void - { - textToChange.text = event.target.text; - } - - ]]> - </fx:Script> - - <fx:Binding - source="input1.text" - destination="textToChange.text"/> - - <fx:Binding - source="input2.text" - destination="textToChange.text"/> - - <j:initialView> - <j:View width="100%" height="100%"> - <j:VGroup width="100%" height="100%" gap="5" > - <j:TextInput id="input1" width="300" text="" change="textInputChange(event)"> - <j:beads> - <j:TextPrompt prompt="Type something"/> - </j:beads> - </j:TextInput> - - <j:Label id="textToChange" text="This is a text" /> - - <j:TextInput id="input2" width="300" text="" change="textInputChange(event)"> - <j:beads> - <j:TextPrompt prompt="Type something else"/> - </j:beads> - </j:TextInput > - - </j:VGroup> - </j:View> - </j:initialView> + xmlns:j="library://ns.apache.org/royale/jewel" + pageTitle="Data Binding test"> + + <fx:Script> + <![CDATA[ + + private function textInputChange(event:Event):void + { + textToChange.text = event.target.text; + } + + ]]> + </fx:Script> + + <fx:Binding + source="input1.text" + destination="textToChange.text"/> + + <fx:Binding + source="input2.text" + destination="textToChange.text"/> + + <j:initialView> + <j:View width="100%" height="100%"> + <j:VGroup width="100%" height="100%" gap="5" > + <j:TextInput id="input1" width="300" text="" change="textInputChange(event)"> + <j:beads> + <j:TextPrompt prompt="Type something"/> + </j:beads> + </j:TextInput> + + <j:Label id="textToChange" text="This is a text" /> + + <j:TextInput id="input2" width="300" text="" change="textInputChange(event)"> + <j:beads> + <j:TextPrompt prompt="Type something else"/> + </j:beads> + </j:TextInput > + + </j:VGroup> + </j:View> + </j:initialView> </j:Application> ``` diff --git a/features/externs.md b/features/externs.md index a9b18cb..eca118e 100644 --- a/features/externs.md +++ b/features/externs.md @@ -55,22 +55,22 @@ This is the code of the AS3 dialogPolyfill.as class file: //////////////////////////////////////////////////////////////////////////////// package { - /** - * @externs - */ - COMPILE::JS - public class dialogPolyfill - { - /** - * <inject_html> - * <script src="https://cdnjs.cloudflare.com/ajax/libs/dialog-polyfill/0.4.9/dialog-polyfill.min.js"></script> - * <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/dialog-polyfill/0.4.9/dialog-polyfill.min.css"> - * </inject_html> - */ - public function dialogPolyfill(){} - - public static function registerDialog(dialog:Element):void {} - } + /** + * @externs + */ + COMPILE::JS + public class dialogPolyfill + { + /** + * <inject_html> + * <script src="https://cdnjs.cloudflare.com/ajax/libs/dialog-polyfill/0.4.9/dialog-polyfill.min.js"></script> + * <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/dialog-polyfill/0.4.9/dialog-polyfill.min.css"> + * </inject_html> + */ + public function dialogPolyfill(){} + + public static function registerDialog(dialog:Element):void {} + } } ``` diff --git a/features/nodejs/external-modules.md b/features/nodejs/external-modules.md index ad25286..bb0a384 100644 --- a/features/nodejs/external-modules.md +++ b/features/nodejs/external-modules.md @@ -43,11 +43,11 @@ Create a file named *boxen.as* and add the following code: ```actionscript package { - /** - * @externs - */ - [JSModule(name="boxen")] - public native function boxen(message:String, options:Object = null):String; + /** + * @externs + */ + [JSModule(name="boxen")] + public native function boxen(message:String, options:Object = null):String; } ``` @@ -89,14 +89,14 @@ Create a file named *MyScript.as*, and add the following content: ```actionscript package { - public class MyScript - { - public function MyScript() - { - var result:String = boxen("I loaded a module!"); - trace(result); - } - } + public class MyScript + { + public function MyScript() + { + var result:String = boxen("I loaded a module!"); + trace(result); + } + } } ``` diff --git a/features/nodejs/modules.md b/features/nodejs/modules.md index 5440419..f2ce738 100644 --- a/features/nodejs/modules.md +++ b/features/nodejs/modules.md @@ -33,15 +33,15 @@ Create a file named *leftPad.as* and add the following code: ```actionscript package { - public function leftPad(input:String, minLength:int, char:String = " "):String - { - var result:String = input; - while(result.length < minLength) - { - result = char + result; - } - return result; - } + public function leftPad(input:String, minLength:int, char:String = " "):String + { + var result:String = input; + while(result.length < minLength) + { + result = char + result; + } + return result; + } } ``` @@ -92,9 +92,9 @@ For a project compiled with Apache Royale, the `main` field should point to the ``` { - "name": "my-left-pad", - "version": "1.0.0", - "main": "bin/js-release/index.js" + "name": "my-left-pad", + "version": "1.0.0", + "main": "bin/js-release/index.js" } ``` diff --git a/features/nodejs/scripting.md b/features/nodejs/scripting.md index 8b69069..2b7e65b 100644 --- a/features/nodejs/scripting.md +++ b/features/nodejs/scripting.md @@ -33,12 +33,12 @@ Create a file named *MyServer.as*, and add the following code: ```actionscript package { - public class MyServer - { - public function MyServer() - { - } - } + public class MyServer + { + public function MyServer() + { + } + } } ``` @@ -49,34 +49,34 @@ Next, let's expand this code to create a simple server using the [http](https:// ```actionscript package { - import http.IncomingMessage; - import http.Server; - import http.ServerResponse; - - public class MyServer - { - private static const HOSTNAME:String = "localhost"; - private static const PORT:int = 3000; - - public function MyServer() - { - var server:Server = http.createServer(handleRequest); - - server.listen(PORT, HOSTNAME, handleServerStart); - } - - private function handleRequest(req:IncomingMessage, res:ServerResponse):void - { - res.statusCode = 200; - res.setHeader("Content-Type", "text/plain"); - res.end("Hello World\n"); - } - - private function handleServerStart():void - { - console.log("Server running at http://" + HOSTNAME + ":" + PORT + "/"); - } - } + import http.IncomingMessage; + import http.Server; + import http.ServerResponse; + + public class MyServer + { + private static const HOSTNAME:String = "localhost"; + private static const PORT:int = 3000; + + public function MyServer() + { + var server:Server = http.createServer(handleRequest); + + server.listen(PORT, HOSTNAME, handleServerStart); + } + + private function handleRequest(req:IncomingMessage, res:ServerResponse):void + { + res.statusCode = 200; + res.setHeader("Content-Type", "text/plain"); + res.end("Hello World\n"); + } + + private function handleServerStart():void + { + console.log("Server running at http://" + HOSTNAME + ":" + PORT + "/"); + } + } } ``` diff --git a/features/strands-and-beads.md b/features/strands-and-beads.md index ea0751b..89b4d26 100644 --- a/features/strands-and-beads.md +++ b/features/strands-and-beads.md @@ -130,30 +130,30 @@ The following piece of code shows the most basic bead structure to use when you ```as3 package beads -{ - import org.apache.royale.core.IBead; - import org.apache.royale.core.IStrand; - import org.apache.royale.core.UIBase; - - /** - * sample code for a bead class - */ - public class SomeBead implements IBead - { - protected var _strand:IStrand; - - /** - * @copy org.apache.royale.core.IBead#strand - * - * @royaleignorecoercion org.apache.royale.core.UIBase; - */ - public function set strand(value:IStrand):void - { - _strand = value; - - // do something - } - } +{ + import org.apache.royale.core.IBead; + import org.apache.royale.core.IStrand; + import org.apache.royale.core.UIBase; + + /** + * sample code for a bead class + */ + public class SomeBead implements IBead + { + protected var _strand:IStrand; + + /** + * @copy org.apache.royale.core.IBead#strand + * + * @royaleignorecoercion org.apache.royale.core.UIBase; + */ + public function set strand(value:IStrand):void + { + _strand = value; + + // do something + } + } } ``` diff --git a/features/styles-skins-themes.md b/features/styles-skins-themes.md index fed1200..429cb87 100644 --- a/features/styles-skins-themes.md +++ b/features/styles-skins-themes.md @@ -32,7 +32,7 @@ You can plug different style classes into your Royale app that can manage differ ```mxml <js:Application xmlns:fx="http://ns.adobe.com/mxml/2009" - xmlns:js="library://ns.apache.org/royale/basic"> + xmlns:js="library://ns.apache.org/royale/basic"> ... <j:valuesImpl> <js:SimpleCSSValuesImpl /> diff --git a/formatter/asformat-config-file.md b/formatter/asformat-config-file.md index 39985bc..5cf6e7c 100644 --- a/formatter/asformat-config-file.md +++ b/formatter/asformat-config-file.md @@ -30,9 +30,9 @@ The root of this file is an `<asformat-config>` element. To specify a [formatter ```xml <asformat-config> - <collapse-empty-blocks>true</collapse-empty-blocks> - <max-preserve-new-lines>3</max-preserve-new-lines> - <semicolons>ignore</semicolons> + <collapse-empty-blocks>true</collapse-empty-blocks> + <max-preserve-new-lines>3</max-preserve-new-lines> + <semicolons>ignore</semicolons> </asformat-config> ``` diff --git a/libraries/compiled-code-libraries.md b/libraries/compiled-code-libraries.md index 389d633..2972691 100644 --- a/libraries/compiled-code-libraries.md +++ b/libraries/compiled-code-libraries.md @@ -68,12 +68,12 @@ In order for classes to be included in your SWC, you need to actually use them s ```actionscript package { - internal class MyLibrary { - import com.example.ClassA;ClassA; - import com.example.ClassB;ClassB; - import com.example.ClassC;ClassC; - import com.example.ClassD;ClassD; - } + internal class MyLibrary { + import com.example.ClassA;ClassA; + import com.example.ClassB;ClassB; + import com.example.ClassC;ClassC; + import com.example.ClassD;ClassD; + } } ``` @@ -88,9 +88,9 @@ Just referencing the classes like that is enough to have them included. MyComponent1 { - IBeadModel: ClassReference("com.example.ComponentModel"); - IBeadView: ClassReference("com.example.ComponentView"); - IBeadController: ClassReference("com.example.ComponentController"); + IBeadModel: ClassReference("com.example.ComponentModel"); + IBeadView: ClassReference("com.example.ComponentView"); + IBeadController: ClassReference("com.example.ComponentController"); } ``` @@ -128,12 +128,12 @@ Note the important pieces in the config: </external-library-path> <allow-subclass-overrides>true</allow-subclass-overrides> - <mxml> - <children-as-data>true</children-as-data> - </mxml> - <binding-value-change-event>org.apache.royale.events.ValueChangeEvent</binding-value-change-event> - <binding-value-change-event-kind>org.apache.royale.events.ValueChangeEvent</binding-value-change-event-kind> - <binding-value-change-event-type>valueChange</binding-value-change-event-type> + <mxml> + <children-as-data>true</children-as-data> + </mxml> + <binding-value-change-event>org.apache.royale.events.ValueChangeEvent</binding-value-change-event> + <binding-value-change-event-kind>org.apache.royale.events.ValueChangeEvent</binding-value-change-event-kind> + <binding-value-change-event-type>valueChange</binding-value-change-event-type> <define> <name>COMPILE::SWF</name> @@ -151,7 +151,7 @@ Note the important pieces in the config: <name>NonCommittingChangeEvent</name> <name>Transient</name> </keep-as3-metadata> - + <locale/> <library-path/> @@ -198,12 +198,12 @@ Note the important pieces in the config: </js-external-library-path> <allow-subclass-overrides>true</allow-subclass-overrides> - <mxml> - <children-as-data>true</children-as-data> - </mxml> - <binding-value-change-event>org.apache.royale.events.ValueChangeEvent</binding-value-change-event> - <binding-value-change-event-kind>org.apache.royale.events.ValueChangeEvent</binding-value-change-event-kind> - <binding-value-change-event-type>valueChange</binding-value-change-event-type> + <mxml> + <children-as-data>true</children-as-data> + </mxml> + <binding-value-change-event>org.apache.royale.events.ValueChangeEvent</binding-value-change-event> + <binding-value-change-event-kind>org.apache.royale.events.ValueChangeEvent</binding-value-change-event-kind> + <binding-value-change-event-type>valueChange</binding-value-change-event-type> <define> <name>COMPILE::SWF</name> @@ -221,7 +221,7 @@ Note the important pieces in the config: <name>NonCommittingChangeEvent</name> <name>Transient</name> </keep-as3-metadata> - + <locale/> <library-path/> @@ -295,7 +295,7 @@ Your asconfig.json file should look like this the file below. You can use any st "output": "target/MyLibrary.swc" }, "additionalOptions":[ - //include any options you want here + //include any options you want here ] } ``` \ No newline at end of file diff --git a/libraries/crux/quickstart.md b/libraries/crux/quickstart.md index 26e145c..f9c9bb3 100644 --- a/libraries/crux/quickstart.md +++ b/libraries/crux/quickstart.md @@ -48,12 +48,12 @@ Configuring Crux in your Royale application is very straightforward: declare Cru xmlns:config="crux.quickstart.config.*" initialize="setUp()"> <fx:Script> - <![CDATA[ + <![CDATA[ public function setUp():void { tracer('application setUp stub'); } ]]> - </fx:Script> + </fx:Script> <j:beads> <!-- support for simulated stage events in javascript (needed for Crux view processing)--> @@ -89,14 +89,14 @@ Non-visual components that you want Crux to manage are defined in a BeanProvider ```mxml <crux:BeanProvider - xmlns:fx="http://ns.adobe.com/mxml/2009" - xmlns:crux="library://ns.apache.org/royale/crux" - xmlns:service="crux.quickstart.service.*" - xmlns:controller="crux.quickstart.controller.*"> - - <service:UserService id="userService"/> - <controller:UserController id="userController"/> - + xmlns:fx="http://ns.adobe.com/mxml/2009" + xmlns:crux="library://ns.apache.org/royale/crux" + xmlns:service="crux.quickstart.service.*" + xmlns:controller="crux.quickstart.controller.*"> + + <service:UserService id="userService"/> + <controller:UserController id="userController"/> + </crux:BeanProvider> ``` @@ -135,11 +135,11 @@ In addition to injecting a bean, you can inject individual bean properties. In t tabletNumerator="1" tabletDenominator="2" phoneNumerator="1" phoneDenominator="1"> - <j:beads> - <js:ContainerDataBinding/> - </j:beads> + <j:beads> + <js:ContainerDataBinding/> + </j:beads> - <fx:Script> + <fx:Script> <![CDATA[ import crux.quickstart.event.UserEvent; import crux.quickstart.model.User; @@ -160,8 +160,8 @@ In addition to injecting a bean, you can inject individual bean properties. In t this.user = val; } ]]> - </fx:Script> - + </fx:Script> + <j:Form> <j:FormHeading label="User Form (Crux Quickstart Example)"/> <j:FormItem label="User ID: "> diff --git a/linter/aslint-config-file.md b/linter/aslint-config-file.md index 42eaf4d..0b93898 100644 --- a/linter/aslint-config-file.md +++ b/linter/aslint-config-file.md @@ -30,9 +30,9 @@ The root of this file is an `<aslint-config>` element. To specify a [linter opti ```xml <aslint-config> - <max-params>5</max-params> - <no-dynamic-class>true</no-dynamic-class> - <line-comment-position>beside</line-comment-position> + <max-params>5</max-params> + <no-dynamic-class>true</no-dynamic-class> + <line-comment-position>beside</line-comment-position> </aslint-config> ``` diff --git a/testing/royaleunit/create-a-unit-test.md b/testing/royaleunit/create-a-unit-test.md index bb8ac1d..df15aa1 100644 --- a/testing/royaleunit/create-a-unit-test.md +++ b/testing/royaleunit/create-a-unit-test.md @@ -31,24 +31,24 @@ A test case is a class that defines a collection of tests. Each test is written ```as3 package com.example { - import org.apache.royale.test.Assert; - - public class MyFirstTests - { - [Test] - public function testSimpleAdd():void - { - var result:Number = 2 + 3; - Assert.assertEquals(result, 5); - } - - [Test] - public function testSimpleSubtract():void - { - var result:Number = 6 - 4; - Assert.assertEquals(result, 2); - } - } + import org.apache.royale.test.Assert; + + public class MyFirstTests + { + [Test] + public function testSimpleAdd():void + { + var result:Number = 2 + 3; + Assert.assertEquals(result, 5); + } + + [Test] + public function testSimpleSubtract():void + { + var result:Number = 6 - 4; + Assert.assertEquals(result, 2); + } + } } ``` @@ -74,28 +74,28 @@ Create a simple Apache Royale application in an [MXML](features/mxml) file with ```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/basic" - xmlns:test="org.apache.royale.test.*" - applicationComplete="runTests()"> - <fx:Declarations> - <test:RoyaleUnitCore id="core"/> - </fx:Declarations> - <fx:Script> - <![CDATA[ - import org.apache.royale.test.listeners.TraceListener; - import com.example.MyFirstTests; - - public function runTests():void - { - core.addListener(new TraceListener()); - core.runClasses(MyFirstTests); - } - - ]]> - </fx:Script> - <js:valuesImpl> - <js:SimpleValuesImpl values="[]"/> - </js:valuesImpl> + xmlns:js="library://ns.apache.org/royale/basic" + xmlns:test="org.apache.royale.test.*" + applicationComplete="runTests()"> + <fx:Declarations> + <test:RoyaleUnitCore id="core"/> + </fx:Declarations> + <fx:Script> + <![CDATA[ + import org.apache.royale.test.listeners.TraceListener; + import com.example.MyFirstTests; + + public function runTests():void + { + core.addListener(new TraceListener()); + core.runClasses(MyFirstTests); + } + + ]]> + </fx:Script> + <js:valuesImpl> + <js:SimpleValuesImpl values="[]"/> + </js:valuesImpl> </js:Application> ``` diff --git a/testing/royaleunit/metadata.md b/testing/royaleunit/metadata.md index 953fbd1..0cf83c4 100644 --- a/testing/royaleunit/metadata.md +++ b/testing/royaleunit/metadata.md @@ -43,7 +43,7 @@ Specify a method to run after each test in this class. [After] public static function after():void { - // runs after every test method in the same class + // runs after every test method in the same class } ``` @@ -55,7 +55,7 @@ Specify a static method to run one time, after all tests have completed in this [AfterClass] public static function afterClass():void { - // runs after all test methods in the same class have completed + // runs after all test methods in the same class have completed } ``` @@ -69,7 +69,7 @@ Specify a method to run before each test in this class. [Before] public static function before():void { - // runs before every test method in the same class + // runs before every test method in the same class } ``` @@ -81,7 +81,7 @@ Specify a static method to run one time, before any tests have run in this class [BeforeClass] public static function beforeClass():void { - // runs before all test methods in the same class + // runs before all test methods in the same class } ``` @@ -96,7 +96,7 @@ Specify that a specific test method should not run. [Test] public function ignoredTest():void { - // this test will not be run + // this test will not be run } ``` @@ -123,8 +123,8 @@ Specify that a class is a test suite. Should be combined with [`[RunWith]` metad [RunWith("org.apache.royale.test.runners.SuiteRunner")] public class MySuite() { - public var myTestCase:MyTestCase; - public var myOtherSuite:MyOtherSuite; + public var myTestCase:MyTestCase; + public var myOtherSuite:MyOtherSuite; } ``` @@ -138,8 +138,8 @@ Specify that a method is a test that should be run. [Test] public function testSimpleAdd():void { - var result:Number = 2 + 3; - Assert.assertEquals(result, 5); + var result:Number = 2 + 3; + Assert.assertEquals(result, 5); } ``` @@ -151,10 +151,10 @@ To test asynchronous functionality, add the `async` modifier to the `[Test]` met [Test(async)] public function testAsync():void { - Async.delayCall(this, function():void - { - // add asserts here - }, 250); + Async.delayCall(this, function():void + { + // add asserts here + }, 250); } ``` @@ -183,7 +183,7 @@ To require that a specific exception is thrown while a test is running, set the [Test(expected="RangeError")] public function testWithExpectedException():void { - throw new RangeError("Out of range"); + throw new RangeError("Out of range"); } ``` diff --git a/testing/royaleunit/run-unit-tests-with-ant.md b/testing/royaleunit/run-unit-tests-with-ant.md index 7394c67..5f7293d 100644 --- a/testing/royaleunit/run-unit-tests-with-ant.md +++ b/testing/royaleunit/run-unit-tests-with-ant.md @@ -56,22 +56,22 @@ On Windows, set the `command` to an *.exe* file: ```xml <royaleunit player="html" swf="path/to/file.html" - command="c:/Program Files/Google/Chrome/Application/chrome.exe"/> + command="c:/Program Files/Google/Chrome/Application/chrome.exe"/> ``` On macOS, set the `command` to the executable **inside** an *.app* package: ```xml <royaleunit player="html" swf="${basedir}/bin/js-debug/index.html" - command="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"/> + command="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"/> ``` If you need to pass arguments to the executable, set the `commandArgs` attribute: ```xml <royaleunit player="html" swf="path/to/file.html" - command="c:/Program Files/Google/Chrome/Application/chrome.exe" - commandArgs="--no-sandbox --user-data-dir=custom_chrome_profile --no-first-run"/> + command="c:/Program Files/Google/Chrome/Application/chrome.exe" + commandArgs="--no-sandbox --user-data-dir=custom_chrome_profile --no-first-run"/> ``` ## Run unit tests in Adobe Flash Player @@ -88,14 +88,14 @@ On Windows, set the `command` to an *.exe* file: ```xml <royaleunit player="flash" swf="bin-debug/ExampleApp.html" - command="path/to/flashplayer_32_sa_debug.exe"/> + command="path/to/flashplayer_32_sa_debug.exe"/> ``` On macOS, set the `command` to the executable **inside** an *.app* package: ```xml <royaleunit player="flash" swf="bin-debug/ExampleApp.html" - command="/Applications/Flash Player.app/Contents/MacOS/Flash Player Debugger"/> + command="/Applications/Flash Player.app/Contents/MacOS/Flash Player Debugger"/> ``` ## Useful options diff --git a/user-interface/components.md b/user-interface/components.md index bdc41e5..bb4aa6e 100644 --- a/user-interface/components.md +++ b/user-interface/components.md @@ -91,7 +91,7 @@ There are several other component sets that are proofs-of-concept that wrap exis ```mxml <?xml version="1.0" encoding="utf-8"?> <c:MyProjectUsingJewel xmlns:fx="http://ns.adobe.com/mxml/2009" - xmlns:j="library://ns.apache.org/royale/jewel"> + xmlns:j="library://ns.apache.org/royale/jewel"> ``` Let's say I want to insert a multi-line label in my app's UI. I use the Label component in the "j" namespace I established for Jewel: diff --git a/working-with-data/loading-external-data/httpservice.md b/working-with-data/loading-external-data/httpservice.md index 03b4fa8..5086e3f 100644 --- a/working-with-data/loading-external-data/httpservice.md +++ b/working-with-data/loading-external-data/httpservice.md @@ -40,7 +40,7 @@ In Apache Royale you can write an `mx:RemoteObject` like this: ```mxml <fx:Declarations> - <mx:HTTPService id="srv" useProxy="false" resultFormat="text" + <mx:HTTPService id="srv" useProxy="false" resultFormat="text" result="resultHandler(event)" fault="faultHandler(event)"/> </fx:Declarations> ```
