[haXe] access plain javascript libraries from within haxe ?

Julien D jd at e-novations.fr
Mon Jan 22 17:45:22 CET 2007


Hi list !

I was wondering if and how it is possible to call javascript (written in 
js not haxe !) from within haxe ?
To be more precise, i want to call a js function that is included in a 
html file from a haxe file compiled in javascript.

Doc about that is a little vague ;(

I tried untyped __js__("some code here"), and hu, it works when it is a 
simple function without arguments, but unfortunately it does not with 
more complex function like this :

var s = untyped __js__("Morph('myFlashObject', {'style': {'width': 
'300px'}})");
s();

(Morph is a class from mochikit library that is included in the html file).
Moreover, i feel like this is not the good way :) Maybe this can be done 
in a better way ?

Any idea ? Am i clear ?

Thanks for your help !
And congrats to Nicolas for the awesome language.

Jidé.




More information about the Haxe mailing list