Problem with --gen-hx-classes and aswing2

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with --gen-hx-classes and aswing2

Nemea Lion
Hi guys

I just downloaded the aswing2 beta to try it out, and when trying to generate the hx classes I got:

haxe -swf out.swf -swf-lib library.swf --gen-hx-classes --no-output

[hidden email]:1: character 0 : Cannot extend basic class.

and the process stop, I get no hx files.

Checking the *.as files I see that the offending class is declared:

package org.aswing.plaf{

 public dynamic class ArrayUIResource extends Array implements UIResource{

     public function ArrayUIResource(content:Array=null){
         if(content){
             for each(var obj:* in content){
                 push(obj);
             }
        }
    }
 }
 }

Any ideas, or what I'm doing wrong?
Is there a workaround to do this?


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Problem with --gen-hx-classes and aswing2

Nicolas Cannasse
Le 25/03/2011 21:19, Nemea Lion a écrit :
> Hi guys
>
> I just downloaded the aswing2 beta to try it out, and when trying to
> generate the hx classes I got:
>
> haxe -swf out.swf -swf-lib library.swf --gen-hx-classes --no-output
>
> [hidden email]:1: character 0 : Cannot
> extend basic class.
[...]

haXe does not allow extending Array, so you'll have to ask aswing users
to adapt their code.

Another possibility is to define your own
org/aswing/plaf/ArrayUIResource.hx class that will override the one
defined in library.swf

Nicolas

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Problem with --gen-hx-classes and aswing2

Nemea Lion
Thanks Nicolas

Thats what I did, I ported the offending as3 file to haxe manually, with :@bind
and used that one to get the other hx classes, it seems to work great so far.
Great work with the compiler, even if it can't get the conversion right away, there
is always a workaround.

Carlos Delgado

2011/3/26 Nicolas Cannasse <[hidden email]>
Le 25/03/2011 21:19, Nemea Lion a écrit :

Hi guys

I just downloaded the aswing2 beta to try it out, and when trying to
generate the hx classes I got:

haxe -swf out.swf -swf-lib library.swf --gen-hx-classes --no-output

[hidden email]:1: character 0 : Cannot
extend basic class.
[...]

haXe does not allow extending Array, so you'll have to ask aswing users to adapt their code.

Another possibility is to define your own org/aswing/plaf/ArrayUIResource.hx class that will override the one defined in library.swf

Nicolas

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org