Troubles trying to use an AS3 library in Haxe - how to ignore redefinitions?

71 views
Skip to first unread message

Hafiz Azman

unread,
Jul 23, 2014, 7:17:55 AM7/23/14
to haxe...@googlegroups.com
I'm trying to use the StandingWave3 audio library in Haxe. I've followed all the instructions here and managed to make the Library.swf file. The problem is when I try to do the

haxe.exe -swf mochi.swf --no-output -swf-lib mochi.swf --gen-hx-classes

equivalent command to generate the Haxe files. I get the error:

standing...@cmodule.awave.CBuffer:1: character 0 : Same field name can't be use for both static and instance : free
standing...@cmodule.awave.DynamicProxy:1: character 0 : Redefinition of variable setProperty in subclass is not allowed
standing...@cmodule.awave.DynamicProxy:1: character 0 : Redefinition of variable deleteProperty in subclass is not allowed
standing...@cmodule.awave.DynamicProxy:1: character 0 : Redefinition of variable getDescendants in subclass is not allowed

..and so on. From this topic I found here it seems I need to write a patch. But the patch file linked to on the Haxe website doesn't exist anymore. Is this because it's obsolete and there's a much easier way to do this? Been struggling on this for more than an hour now, help will be very much appreciated, thanks.

Nicolas Cannasse

unread,
Jul 23, 2014, 10:23:57 AM7/23/14
to haxe...@googlegroups.com
Le 23/07/2014 13:17, Hafiz Azman a écrit :
> I'm trying to use the StandingWave3 audio library in Haxe. I've followed
> all the instructions here
> <http://bruce-lab.blogspot.com.es/2012/03/simple-tutorial-for-using-mochiads-with.html>and
> managed to make the Library.swf file. The problem is when I try to do the
>
> haxe.exe -swf mochi.swf --no-output -swf-lib mochi.swf --gen-hx-classes
>
> equivalent command to generate the Haxe files. I get the error:
>
> standing...@cmodule.awave.CBuffer:1: character 0 : Same field name
> can't be use for both static and instance : free
> standing...@cmodule.awave.DynamicProxy:1: character 0 :
> Redefinition of variable setProperty in subclass is not allowed
> standing...@cmodule.awave.DynamicProxy:1: character 0 :
> Redefinition of variable deleteProperty in subclass is not allowed
> standing...@cmodule.awave.DynamicProxy:1: character 0 :
> Redefinition of variable getDescendants in subclass is not allowed
>
> ..and so on. From this topic I found here
> <https://github.com/labe-me/haxe-away3d/issues/1> it seems I need to
> write a patch. But the patch file linked to on the Haxe website doesn't
> exist anymore. Is this because it's obsolete and there's a much easier
> way to do this? Been struggling on this for more than an hour now, help
> will be very much appreciated, thanks.

The patch example is available here:
https://github.com/HaxeFoundation/haxe/blob/development/extra/extract.patch

Best,
Nicolas

Hafiz Azman

unread,
Jul 23, 2014, 12:26:12 PM7/23/14
to haxe...@googlegroups.com
Ah thank you for that. I've copied the patch file over, and added ignore commands on the class definitions that were giving errors like so:

-cmodule.awave.DynamicProxy.nextValue
-cmodule.awave.DynamicProxy.getDescendants
-cmodule.awave.DynamicProxy.setProperty
-cmodule.awave.DynamicProxy.nextName
-cmodule.awave.DynamicProxy.deleteProperty
-cmodule.awave.CBuffer.free

..and so on. Now it's generated a bunch of haxe files that I can import into my project. Not sure if ignoring those classes would have broken anything. It also generated lots of other haxe files, like basic flash files like BitmapData and Math and String, which I think OpenFL already takes care of so I don't need them? In any case I will try importing and will update this thread with the result. Thanks!


On Wednesday, July 23, 2014 10:23:57 PM UTC+8, Nicolas Cannasse wrote:
Le 23/07/2014 13:17, Hafiz Azman a écrit :
> I'm trying to use the StandingWave3 audio library in Haxe. I've followed
> all the instructions here
> <http://bruce-lab.blogspot.com.es/2012/03/simple-tutorial-for-using-mochiads-with.html>and
> managed to make the Library.swf file. The problem is when I try to do the
>
> haxe.exe -swf mochi.swf --no-output -swf-lib mochi.swf --gen-hx-classes
>
> equivalent command to generate the Haxe files. I get the error:
>
> standingwave3.swf@cmodule.awave.CBuffer:1: character 0 : Same field name
> can't be use for both static and instance : free
> standingwave3.swf@cmodule.awave.DynamicProxy:1: character 0 :
> Redefinition of variable setProperty in subclass is not allowed
> standingwave3.swf@cmodule.awave.DynamicProxy:1: character 0 :
> Redefinition of variable deleteProperty in subclass is not allowed
> standingwave3.swf@cmodule.awave.DynamicProxy:1: character 0 :

Nicolas Cannasse

unread,
Jul 23, 2014, 3:59:36 PM7/23/14
to haxe...@googlegroups.com
Le 23/07/2014 18:26, Hafiz Azman a écrit :
> Ah thank you for that. I've copied the patch file over, and added ignore
> commands on the class definitions that were giving errors like so:
>
> -cmodule.awave.DynamicProxy.nextValue
> -cmodule.awave.DynamicProxy.getDescendants
> -cmodule.awave.DynamicProxy.setProperty
> -cmodule.awave.DynamicProxy.nextName
> -cmodule.awave.DynamicProxy.deleteProperty
> -cmodule.awave.CBuffer.free
>
> ..and so on. Now it's generated a bunch of haxe files that I can import
> into my project. Not sure if ignoring those classes would have broken
> anything. It also generated lots of other haxe files, like basic flash
> files like BitmapData and Math and String, which I think OpenFL already
> takes care of so I don't need them? In any case I will try importing and
> will update this thread with the result. Thanks!

I'm not sure why you want to generate hx classes, simply use -swf-lib
and you'll get access to the API.

Best,
Nicolas

Hafiz Azman

unread,
Jul 24, 2014, 4:40:56 PM7/24/14
to haxe...@googlegroups.com
Yes, that is exactly what I want to do! But I am confused as to how to go about it, using OpenFL in FlashDevelop. Where do I put the -swf-lib line in my project so that I will have access to it?

I appreciate that this could be more of an OpenFL question than Haxe, if it is sorry for taking your time.
Reply all
Reply to author
Forward
0 new messages