File “genswf.ml”, Assertion failed (haxe -swf-version -swf-lib)

56 views
Skip to first unread message

Lg46

unread,
Jul 31, 2014, 4:16:43 PM7/31/14
to haxe...@googlegroups.com

Greetings group,

I feel shameful to ask that a stupid question when all of you discuss so many interesting topics, but here's my problem.

I'd like to use the haxe.Json class.

For this it seems I need to compile for Flash Player 11, at least. Otherwise JSON is not found on execution time and I get an exception.

So I compiled my swf lib for Flash Player 11.2 (previously it was for Flash 9), and changed my compilation line to:

-main Preloader.hx
-swf-version 13.2
-swf preloader.swf

--next
-main Client.hx
-swf-version 13.2
-swf-lib inventory_panel.swf
-swf client.swf

However, I'm getting this error:

Compiling Preloader...
**File "genswf.ml", line 554, characters 8-14: Assertion failed**

If I remove the -swf-version from the part before the "next", it compiles the first part. But then the same assertion fails on the next one (client.swf).

I tried to use -swf-version 13-swf-version 13.1 (compiling my lib inventory_panel.swf for Flash 11.1), but same assertion error occurs. I tried to compile with -swf-version 11.1, then it compiles but as expected the Flash Player doesn't have the JSON class then and it fails on execution.

What am I doing wrong?

Lg46

unread,
Jul 31, 2014, 6:00:07 PM7/31/14
to haxe...@googlegroups.com
Seems I was confused by some posts on the Internet referring to Flex and addressing a conflict with JSON. 

Actually in Haxe I have to really use --swf-lib 11.2 to target Flash Player 11.2.
So it compiles okay.

Now, I still have the JSON unfound in Flash (testing with Flash Player 11.7 debug).
I really don't know why this is happening.

Compiling with -D haxeJSON works though, but I'd like to use the native one if possible.

Andreas Mokros

unread,
Jul 31, 2014, 7:08:29 PM7/31/14
to haxe...@googlegroups.com
Hi.

On Thu, 31 Jul 2014 15:00:07 -0700 (PDT)
Lg46 <alex...@gmail.com> wrote:
> Now, I still have the JSON unfound in Flash (testing with Flash
> Player 11.7 debug).

Are you sure it's 11.7 debug? What's the exact error you get?

--
Mockey

Lg46

unread,
Aug 1, 2014, 7:31:09 AM8/1/14
to haxe...@googlegroups.com
> Are you sure it's 11.7 debug? 

This is what I get when I right click Flash, at the bottom of the contextual menu:
About Flash Player 11.7.700.225...

> What's the exact error you get? 
ReferenceError: Error #1065: Variable JSON is not defined.

I read some people got the same problems with other versions using Flex, so this isn't probably a Haxe problem.
Comments talk about some conflicts between the JSON for Flash and the ones for AIR, but I'm not sure if it relates to the same thing here (I mean, AIR classes probably aren't likely affecting Flash?).

Andreas Mokros

unread,
Aug 1, 2014, 8:37:51 AM8/1/14
to haxe...@googlegroups.com
Hi.

On Fri, 1 Aug 2014 04:31:09 -0700 (PDT)
Lg46 <alex...@gmail.com> wrote:
> *ReferenceError: Error #1065: Variable JSON is not defined.*
> I read some people got the same problems with other versions using
> Flex, so this isn't probably a Haxe problem.

Yes, there are quite a few stackoverflow posts with this error. You're
not using Air, are you? But you're using some preloader, right?
What about this then?
http://stackoverflow.com/questions/11099451

quote:
Now, the reason why the above error comes is because if a preloader
(app loading swf) is not compiled with FP 11 or the above directive,
the loaded application's domain will also not have JSON defined. So if
you receive that error, it is either the preloader swf or the loaded
swf that was not compiled with correct Flash Player version.

--
Mockey
Reply all
Reply to author
Forward
0 new messages