flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Ent <p...@adobe.com>
Subject [FALCONJX] [FLEXJS] AS to JS compilation issues
Date Tue, 19 Nov 2013 20:27:37 GMT

I am attempting to take the DataGrid, written in ActionScript, and compile it into JavaScript
to see if that's a viable way to build JavaScript components - or at least get a good head
start on writing the JavaScript. I've run into a couple of  issues since taking the most recent
falcon code changes.

Issue 1
My ActionScript code reads:

import org.apache.flex.core.IBeadModel;


var sharedModel:IDataGridModel = _strand.getBeadByType(IBeadModel) as IDataGridModel;

I get this error while compiling:

/Users/pent/Documents/Apache Flex/DataGridXcompile/bin/js-debug/org/apache/flex/html/staticControls/beads/DataGridView.js:84:
ERROR - variable IBeadModel is undeclared

  var /** @type {org.apache.flex.core.IDataGridModel} */ sharedModel = org.apache.flex.utils.Language.as(this._strand.getBeadByType(IBeadModel),

IBeadModel has an import statement. IBeadModel should be fully qualified, I think.

Issue 2
My ActionScript code reads:

import org.apache.flex.html.staticControls.List;


for(var i:int=0; i < columns.length; i++) {

    var column:List = columns[i];

I get this error while compiling:

/Users/pent/Documents/Apache Flex/DataGridXcompile/bin/js-debug/org/apache/flex/html/staticControls/beads/DataGridView.js:121:
WARNING - Bad type annotation. Unknown type List

    var /** @type {List} */ column = this.columns[i];


What's funny about this last error is that I also have this ActionScript code which does not
produce an error:

for(var i:int=0; i < pm.columnLabels.length; i++) {

    var column:List = new SimpleList();

The JavaScript code generated for these statement is:
for (var /** @type {number} */ i = 0; i < pm.get_columnLabels().length; i++) {
    var /** @type {org.apache.flex.html.staticControls.List} */ column = new org.apache.flex.html.staticControls.SimpleList();

I'll file a bug if it looks like my code is OK.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message