I have a problem.
Our game has payment java script methods and this methods was called via flash.external.call interface.
but i can’t do the same using openfl.external.call targeting html5
The java scripts payment methods was included during the runtime and the swf file was able to load and call it.
my question how could i include/ call dynamic java script class or function from the same domain ?
You could call it directly as untyped someJavaScriptFunction(1, 2).
Alternatively, you can define externs:
@:native("window")
extern class External {
static function someJavaScriptFunction(arg1:Int, arg2:Int):Void;
}
Then External.someJavaScriptFunction(1, 2) will be generated as window.someJavaScriptFunction(1, 2). You can adjust and expand this to fit your specific needs.
Uncaught TypeError: window.GetProposedFriends is not a function
here is my class definition
package;
/**
* ...
* @author 1
*/
@:native("window")
extern class GetProposedFriends
{
static function GetProposedFriends():Void;
}```
Also when I do Inspect Element I can the function there
![Screen Shot 2020-12-17 at 3.11.15 PM|680x500](upload://xbQiWlzyeT05PKaHWeCXhCSTXnu.png)
Difficult to say without more context. Apparently GetProposedFriends is not available from the global state. You should try to find a way to call GetProposedFriends from the devtools console and then adjust the Haxe code accordingly.
Thank you so much for your help.
Yea I am not able to call the script from dev tools but I could found it and call it when I do inspect
for some reason it’s hidden.