Where to look to create a native definition in FlexJS


#1

Hi,

I’m interested in porting some of the Flash API to FlexJS
so they can be available client-side in JS

for ex:

package flash.utils
{
    public function getTimer():int
    {
        // TODO
    }
}

or

package flash.utils
{
    public class Timer
    {
        // TODO
    }
}

I assume FlexJS support such “native” definitions ?

eg. the idea, is like I need to write those API in AS3 for #redtamarin , I could probably at the same time port some to JS


#2

If you run the js/bin/asjsc compiler in Apache FlexJS, you will be able to access native web browser APIs from ActionScript. That should allow you to implement the Flash APIs on top of JS.

Some of the following projects may be of interest to you:

  • spriteflexjs already has some of the APIs implemented for Apache FlexJS. I’m sure it’s not complete, but it may give you a good head start, or maybe you can contribute to this project.
  • KontikiJS was a effort to implement the Flash API for the Randori compiler. Much of the implementation is probably still relevant for Apache FlexJS.

#3

yes, I checked out spriteflexjs and in fact there is nothing special to do to implement “native” definition or so it seems.

And yeah I saw many different places from StageXL for Dart, to Starling display list, to KontikiJS, ActionSwift, Shumway etc.

that basically all do the “same thing”: re-implementing the Flash API

I did implement some in Redtamarin, mainly with flash.utils
see https://github.com/Corsaair/redtamarin/tree/master/src/as3/flash/utils

I need to make some more tests, I also looked into TypeScript and how it deal with different hosts like node or Chakra with the sys lib and the System interface, which is a not too bad approach.

I definitively need to investigate more, thanks.