You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2018/10/25 06:25:09 UTC

[GitHub] hcsuk commented on issue #325: Adding support for ExternalInterface

hcsuk commented on issue #325: Adding support for ExternalInterface
URL: https://github.com/apache/royale-asjs/pull/325#issuecomment-432929781
 
 
   The idea of defining the API in ActionScript and keeping the type information sounds good.
   I couldn't see any examples of using @externs in ActionScript anywhere, the only thing I could see is a file-level directive within some JavaScript files. I've been trying to get this to work with an AS file but if it's at file scope, it just gets ignored, and if I add it to a function then I get a closure compiler internal error. I'm assuming that this is actually the Royale transpiler that should be removing the function definition when transpiling, so presumably it shouldn't actually create a .js file for it?
   
   I'm slightly unclear how to get the external JavaScript code to call a method within the Royale application still; we would still need to register a callback somehow I guess, or else we'd just have to call the qualified function but without any 'this' parameter. To keep it working with a method closure I believe the "registering a callback" approach is required so we need to define a function somewhere for this - perhaps this then needs to be added to the AS externs code (but without the @extern tag..)
   
   Presumably all of this approach works just for when we compile our apps into JavaScript/HTML, and the application becomes responsible for the compile-switch between JS and SWF and then continues to use flash.external.ExternalInterface in a COMPILE::SWF block...
   
   thanks

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services