On 12/5/16, 11:12 PM, "Harbs" <harbs.li...@gmail.com> wrote:

>I created a swc library[1] which relies on some typedefs which I created
>using ActionScript[2].
>
>This all works well when I debug. However, when I compile a release
>build, the “cep global” methods are being renamed and when executed, I
>get “function undefined” errors.
>
>I’m not sure what I’m doing wrong. I could change the function calls to
>use bracket notation, which I expect would prevent goog from renaming
>them, but that seems like a work-around which should be unnecessary. Is
>the problem that I’m using ActionnScript rather than “extern” js files to
>compile the typedef swc?

Sort of.  Because you are trying to call into third-party code, you have
to use bracket notation or extern-formatted js files to prevent renaming.
And, to call that code from other AS, you need .as versions of the API.
But it doesn't matter whether you generate the JS from AS or vice-versa.

I don't think we've run any tests of generating externs JS from AS, but it
should be possible.  But then you need to pack the JS file into the
typedefs SWC in an folder called "externs".  Unzip google_maps.swc to see
an example.

-Alex

>
>Harbs
>
>[1]https://github.com/unhurdle/cep-flexjs/tree/master/CEPTools
>[2]https://github.com/unhurdle/cep-flexjs/tree/master/CEP6.1

Reply via email to