Hi Hugo,

of course. Take into account that you can always go low level with
COMPILE::JS
for example check Jewel TextInput.as

in TextInputBase.as we have:

COMPILE::JS
public function get input():HTMLInputElement

then in TextInput.as

COMPILE::JS
override protected function createElement():WrappedHTMLElement
{
input = addElementToWrapper(this,'input') as HTMLInputElement;

...

//attach input handler to dispatch royale change event when user write in
textinput
input.addEventListener("input", textChangeHandler)
input.addEventListener("keypress", enterEventHandler, true);

then in the AS3 handler we are dispatching an AS3 event.

protected function textChangeHandler(event:Event):void
{
...
dispatchEvent(new Event(Event.CHANGE));
}

or you could again dispatch a JS event at that point

You should try to always abstract it in AS3 when possible so users of your
library have complete control from AS3 (Royale).

El lun., 5 oct. 2020 a las 1:38, Hugo Ferreira (<[email protected]>)
escribió:

> Hi,
>
> Using externs, it's possible to call JS functions from Royale/AS code
> (Royale AS > JS).
> However I need now the oposite (JS > Royale AS).
> This JS libraries that I'm using have events that I need to send to to
> Royale/AS level (save data for example).
>
> Is this currently possible ?
>


-- 
Carlos Rovira
http://about.me/carlosrovira

Reply via email to