[haXe] best strategy to port an existing js library
Franco Ponticelli
franco.ponticelli at gmail.com
Fri Dec 7 12:29:14 CET 2007
There is no loader and I doubt you need one since you can include your JS
library just before the haXe generated file.
About wrapping you can use both extern or typedef depending on what you are
implementing.
In your case the extern could be the right solution.
extern HelloClass {
public function new() : Void;
public function showText() : String;
}
Pay attention to the case of fields that in haXe must start with a lower
case letter. This can be origin to incompabilities.
Regards,
Franco.
On Dec 7, 2007 11:00 AM, picnic <bitvolt at gmail.com> wrote:
> hi
> what is best strategy to port an existing js library? How is
> encapsulation done, e.g. for an js class in a separate file:
>
> -------------HelloClass.js------------------
> function HelloClass(){
> var m_text = "Hello World";
> this.ShowText = DisplayText;
> function DisplayText(){
> alert( m_text );
> return;}}
> --------------------------------------------------
>
> i guess there should be some kind of a loader function in haxe.js
>
> thanks
> picnic
>
> --
> haXe - an open source web programming language
> http://haxe.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.motion-twin.com/pipermail/haxe/attachments/20071207/8c6870ec/attachment.htm
More information about the Haxe
mailing list