Versions Compared

Key

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

A table showing how each ActionScript language 'feature' is should be translated to Google Closure Tools assisted JavaScript by the FalconJS Compiler.

Using these AS3 references:

- Global Constants, Functions and Classes

- Operators

- Statements, Keywords and Directives

Using Google Closure annotations:

- Annotating JavaScript for the Closure Compiler

Table quick navigation:

- coming soon ;-)

 

Test Available In FlexJS (+/-)?

ActionScript

JavaScript + Closure annotation

Notes

Anchor
Global Constants
Global Constants

 

 

 

 

Infinity

-

Infinity

Infinity

 

-Infinity

-

-Infinity

-Infinity

 

NaN

-

NaN

NaN

 

undefined

-

undefined

undefined

 

 

 

 

 

 

Anchor
globalFunctions
globalFunctions
Global Functions

 

 

 

 

Array()

-

Array

Array

 

Boolean()

-

Boolean

Boolean

 

decodeURI()

-

decodeURI

decodeURI

 

decodeURIComponent()

-

decodeURIComponent

decodeURIComponent

 

encodeURI()

-

encodeURI

encodeURI

 

encodeURIComponent()

-

encodeURIComponent

encodeURIComponent

 

escape()

 

 

 

 

int()

 

 

 

 

isFinite()

 

 

 

 

isNaN()

 

 

 

 

isXMLName()

 

 

 

 

Number()

 

 

 

 

Object()

 

 

 

 

parseFloat()

 

 

 

 

parseInt()

 

 

 

 

String()

 

 

 

 

trace()

 

 

 

 

uint()

 

 

 

 

unescape()

 

 

 

 

Vector()

 

 

 

 

XML()

 

 

 

 

XMLList()

 

 

 

 

 

 

 

 

 

Anchor
classes
classes
Classes

 

 

 

 

ArgumentError

 

 

 

 

arguments

 

 

 

 

Array

 

 

 

 

Boolean

 

 

 

 

Class

 

Description

ActionScript

JavaScript

Classes

 

 

Simple

Code Block
ActionScript
ActionScript
package com.example.components
{
public class MyClass
{
    public function MyClass() {}
}
}

Code Block
Javascript
Javascript
goog.provide('com.example.components.MyClass');

/**
 * @constructor
 */
com.example.components.MyClass = function() {};


 

Date

 

 

 

 

DefinitionError

 

 

 

 

Error

 

 

 

 

EvalError

 

 

 

 

Function

 

 

 

 

int

 

 

 

 

JSON

 

 

 

 

Math

 

 

 

 

Namespace

 

 

 

 

Number

 

 

 

 

Object

 

 

 

 

QName

 

 

 

 

RangeError

 

 

 

 

ReferenceError

 

 

 

 

RegExp

 

 

 

 

SecurityError

 

 

 

 

String

 

 

 

 

SyntaxError

 

 

 

 

TypeError

 

 

 

 

uint

 

 

 

 

URIError

 

 

 

 

Vector

 

 

 

 

VerifyError

 

 

 

 

XML

 

 

 

 

XMLList

 

 

 

 

 

 

 

 

 

Operators

 

 

 

 

Arithmetic

 

 

 

 

+

 

 

 

 

--

 

 

 

 

/

 

 

 

 

++

 

 

 

 

%

 

 

 

 

*

 

 

 

 

-

 

 

 

 

 

 

 

 

 

Arithmetic compound assignment

 

 

 

 

+=

 

 

 

 

/=

 

 

 

 

%=

 

 

 

 

*=

 

 

 

 

-=

 

 

 

 

 

 

 

 

 

Assignment

 

 

 

 

=

 

 

 

 

 

 

 

 

 

Bitwise

 

 

 

 

&

 

 

 

 

<<

 

 

 

 

~

 

 

 

 

|

 

 

 

 

>>

 

 

 

 

>>>

 

 

 

 

^

 

 

 

 

 

 

 

 

 

Bitwise compound assignment

 

 

 

 

&=

 

 

 

 

<<=

 

 

 

 

|=

 

 

 

 

>>=

 

 

 

 

>>>=

 

 

 

 

^=

 

 

 

 

 

 

 

 

 

Comment

 

 

 

 

/../

 

 

 

 

//

 

 

 

 

 

 

 

 

 

Comparison

 

 

 

 

==

 

 

 

 

>

 

 

 

 

>=

 

 

 

 

!=

 

 

 

 

<

 

 

 

 

<=

 

 

 

 

===

 

 

 

 

!==

 

 

 

 

 

 

 

 

 

Logical

 

 

 

 

&&

 

 

 

 

&&=

 

 

 

 

!

 

 

 

 

||

 

 

 

 

||=

 

 

 

 

 

 

 

 

 

Other

 

 

 

 

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="669b6f55-f5f1-43b2-a8ae-23bf7591bb9e"><ac:plain-text-body><![CDATA[

[]

 

 

 

 

]]></ac:plain-text-body></ac:structured-macro>

as

 

 

 

 

,

 

 

 

 

?:

 

 

 

 

delete

 

 

 

 

.

 

 

 

 

in

 

 

 

 

instanceof

 

 

 

 

is

 

 

 

 

::

 

 

 

 

new

 

 

 

 

{}

 

 

 

 

()

 

 

 

 

/

 

 

 

 

:

 

 

 

 

typeof

 

 

 

 

void

 

 

 

 

 

 

 

 

 

String

 

 

 

 

+

 

 

 

 

+=

 

 

 

 

"

 

 

 

 

 

 

 

 

 

XML

 

 

 

 

@

 

 

 

 

{}

 

 

 

 

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="98e7074c-28f5-4128-abc3-68218d066099"><ac:plain-text-body><![CDATA[

[]

 

 

 

 

]]></ac:plain-text-body></ac:structured-macro>

+

 

 

 

 

+=

 

 

 

 

delete

 

 

 

 

..

 

 

 

 

.

 

 

 

 

()

 

 

 

 

<>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Inheriting

 

Code Block
ActionScript
ActionScript
package com.example.components{
import org.apache.flex.Button;

public class MyClass extends Button
{
	public function MyClass()
	{
		super();
	}
}
}

Code Block
Javascript
Javascript
goog.provide('com.example.components.MyClass');

goog.require('org.apache.flex.Button');

/**
 * @constructor
 * @extends {org.apache.flex.Button}
 */
com.example.components.MyClass = function() {
    goog.base(this);
};
goog.inherits(com.example.components.MyClass, org.apache.flex.Button);

 

Implementing

 

TBD

TBD

 

Inheriting + Implementing

 

TBD

TBD

 

 

 

 

 

 

Fields

 

 

 

 

private

 



Code Block
private var _myVar:String = "";

Inside the constructor function:

Code Block
/**
 * @private
 * @type {string}
 */
this._myVar = '';

 

protected

 

This is how far I got today ;-)

 

 

public

 

 

 

 

Global Constants