[haXe] access plain javascript libraries from within haxe ?
[RESOLVED]
Julien D
jd at e-novations.fr
Mon Jan 22 19:30:21 CET 2007
Thanks Nicolas !
After some workaround, i finally made it work.
For other people, be sure to have a return type for the extern class
functions or you will get a compilation error. It should be :
extern class Morph {
public function new( flasobj : String, style : {} ):Void;
}
Thanks again for your help.
Jidé.
Nicolas Cannasse a écrit :
>> 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.
>>
>
> The best is then to write an extern class :
>
> extern class Morph {
> public function new( flasobj : String, style : {} );
> }
>
> Then in your haXe code :
>
> new Morph("myFlashObject",{ style : { width : '300px' } });
>
> Be also careful because here you're using "Morph" without a package, and
> maybe there is one needed in your framework.
>
> Nicolas
>
>
--
___________________________________________________________
| |
| Jidé :: Webdesign, Graphisme, PAO, Communication visuelle |
|___________________________________________________________|
| |
| Julien De Luca (fait parti de la CAE coopaname) |
| |
| téléphone :: 06 28 04 58 30 |
| site web :: www.jide.fr |
| email :: contact at jide.fr |
| numéro icq :: 7266709 |
|___________________________________________________________|
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.motion-twin.com/pipermail/haxe/attachments/20070122/5a8d6f57/attachment.htm
More information about the Haxe
mailing list