Use a haxe compiled swc in as3

162 views
Skip to first unread message

Żabojad

unread,
Nov 30, 2013, 9:10:19 AM11/30/13
to haxe...@googlegroups.com
Hello, 

Following these instructions there http://haxe.org/manual/swc I've created a little swc with haxe and try now to use it in Flash Pro.

The first thing I do in the fla's main timeline is : 

import flash.display.MovieClip;

// init haxe swc
haxe.initSwc( new MovieClip() );

 But when the first line of code referencing a class from the swc comes,


// create an instance of a class from the swc
var obj = new my.package.MyHaxeClassFromSwc();

 I get :
 
1046: Type was not found or was not a compile-time constant: MyHaxeClassFromSwc.


If I try to import a class from the swc, 

import my.package.MyHaxeClassFromSwc

I get :

VerifyError: Error #1014: Class my.package::MyHaxeClassFromSwc could not be found.

What am I doing wrong ?

Thanks,

Tom


Justin L Mills

unread,
Nov 30, 2013, 9:35:46 AM11/30/13
to haxe...@googlegroups.com
I have only used a haxe swc with air app once with flashdevelop so I am
a bit light on detail. But normally in un denvelop you can right click
on the swc and add it to your project, I am not sure I needed to run the
initSwc but I was not using the main class so it may depend on how your
using it?

Żabojad:

Żabojad

unread,
Nov 30, 2013, 9:49:43 AM11/30/13
to haxe...@googlegroups.com
Using a swf as lib instead of a swc and removing the haxe.initSwc( new MovieClip() ) line gives me:

TypeError: Error #1006: iterator is not a function.
at haxe.ds::StringMap/keys()
at haxe::Http/request() 

clemos

unread,
Nov 30, 2013, 10:14:20 AM11/30/13
to haxe...@googlegroups.com
I believe you need to disable dead code elimination.

Regards ;)
Clément


--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages