On 5/13/15, 8:16 AM, "Michael Schmalle" <teotigraphix...@gmail.com> wrote:
>Well I have spent the last hour reading over their docs, I love seeing >high >traffic projects. I would feel confident in exploring this avenue since >the >project seems huge now. I remember 2 years ago it wasn't so large. > >I am pretty sure I can do what I need to once I figure out the tool chain. > >Seems to me, the hardest part is that middle layer where I have the AS API >for the native extension and the Cordova plugin. From a distance it looks >like I could use the same AS. > >So it really looks like the project I would have is figuring out actually >how to write a Cordova app, then figure out how to write a plugin that >calls my audio engine in a Cordova app. Once I get that working as an >Android plugin, I will know how I have to translate a FlexJS code base to >the Cordova plugin spec. > >I think I already looked at that code you wrote, need to check it again. > >So am I think correct here, eventually it looks like I will need to write >a >custom cross compiler emitter for a Cordova plugin correct? Then this >would >get hooked and run during the cross compile if the compiler args include >it. Maybe. Here’s how I think about it: FalconJX handles SWC-based classes (actually, compilation units) differently from AS and MXML classes. The compiler cross-compiles all AS and MXML, but assumes it can find a .js file for every SWC-based class. That’s how we abstract the differences between Flash and HTML/JS/CSS. We hand wrote both a Button.as and a Button.js. Button.as wraps the Flash button, Button.js wraps an HTMLElement Button. The Button.as is compiled into a SWC and Button.js is included in the same SWC. FalconJX finds the Button.js in the SWC and adds that to the JS output by the emitter for the AS and MXML the app developer wrote. AIUI, an ANE is included in a project in SWC form. There is an AS class compiled into the SWC that represents the AS API surface the rest of the app uses. Somehow, this AS wrapper calls the native code. The Cordova doc seems to imply that you write a JS file in a similar way. In theory, if you hand wrote this JS file and inserted it in the SWC, the right thing would just happen. Once you get to that point, we can see where else the tool chain needs enhancing to automate various parts of the workflow. If there is a different emitter that can auto-generate the JS from the AS then yes, you will be right. And maybe something that auto-inserts the JS into a SWC. But I’d settle for hand-writing and hand-inserting the wrappers as a first step. FlexJS should be able to generate a working Cordova app for you. Try using the cordova-build.xml file. Compile an example like DataBindingTest. Then run "ant -f cordova-build.xml” It should ask you about other settings you’ll need. The final command-line will look something like: ant -f cordova-build.xml -DPROJECT_NAME=DataBindingTest -DTARGET_DIR=<Some output folder> -DPROJECT_DIR=<path to DataBindingTest folder> You will need to install Cordova first and the Cordova platform libraries you want to target. You are correct that Cordova currently has more traffic. Last I checked a year ago, some big players were paying developers to work on it (IBM, MS, Google, RedHat). I demoed the FlexJS/Cordova workflow to their former PMC Chair last year and got a positive response. It wouldn’t be a bad future if FlexJS became a popular way to create Cordova apps. Then we might get more paid developers helping move FlexJS along. Good luck and thanks for looking into it, -Alex