Forum General playerio with haxe problem

Any issues or discussions relating to Flash development are welcome here.

playerio with haxe problem

Postby powerfear » April 15th, 2012, 6:40 pm

I'm trying to use playerio in my haxe/nme project, I heard you must first create stubs files for the haxe compiler so I did that, I also compiled the playerio library to a .swc and extracted the .swf inside. I think I must pass the argument -swf-lib thelibrary.swf to the compiler but I'm using FlashDevelop with a haxe/nme project and I can't find anywhere to put it that actually work.

At runtime I'm getting "[Fault] exception, information=VerifyError: Error #1014: Class package::Class could not be found."
So I'm pretty sure I didn't put the argument at the right place but I tried many place with my IDE (falshdevelop) and can't find where to put it.

EDIT: Figured it out now I can link and use the library. But it seems it has some error with haxe.

Example if I try to connect to my development server while its down normally it would say something like it cant find any server. But with haxe it cause some error:

"ReferenceError: Error #1056: Cannot create property playerio:PlayerIOError::_type on bridge.generated.PlayerIOError.
at bridge.generated::PlayerIOError()
at Function/<anonymous>()
at Function/<anonymous>()
Posts: 1
Joined: March 18th, 2012, 8:39 pm

Re: playerio with haxe problem

Postby Benjaminsen » May 1st, 2012, 12:45 pm

Player.IO uses some flash specific trigger to load the actual API code externally. Sadly the way HAXE is hooked up this code fails .
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: playerio with haxe problem

Postby justlost » August 27th, 2012, 12:33 am

Hi, I know this post is a bit old...

But for anyone else seeing this problem with HaXe, all you have to do is delete the PlayerIOError and PlayerIORegistrationError classes from the provided PlayerIO client classes.

Then on the PlayerIO class replace those referenced types(about 3 or 4) with dynamic class types (* on AS3), and flash.error.Error class calls.

Lastly, compile this to an SWC and include the library.swf on your haxe project. If you use flashdevelop, also generate your stub haxe lib files so you have intellisence on the ide.

And that's it, you got a working playerio client lib working on haxe.
Posts: 2
Joined: July 19th, 2010, 2:24 am

Return to General