External function / Extension in HTML5?

Hi,

i 'm experienced doing extensions for android / ios, how to call external functions etc… but i’m not sure how to do it with html5.
how i can include a script tag with a specific library and execute JS functions that has in it?

any hint is highly appreciated :smiley:
Regards.

Hi,

You need to modify the generated index.html.

Take the original https://github.com/openfl/openfl/blob/master/templates/html5/template/index.html and make a custom version in your project.
Then add this to your project.xml: <template path="Assets/index.html" rename="index.html" />.

And using untyped should allow you to call js functions from haxe.

1 Like

didn’t knew about untyped, thanks ! :smiley:

Not 100% sure untyped will work, the compiler may still complain things don’t exist. In that case use untyped __js__("javascript code here");.

1 Like

You can use extern classes as well