Forum General HaXe example?

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

HaXe example?

Postby cog » November 18th, 2012, 5:16 pm


I just stumbled over this contest a few days ago. I'm probably a bit late in the run, but I may nevertheless give it a shot.

By the way, I was wondering, is there a haxe/playerio example out there?
Having a zipped sample project working out-of-the-box would really be great. It would boost how quick you can start instead of loosing time wondering how to combine these. Actually, I still didn't figured out how to use playerio in HaXe yet, nor did I find any example.

Does anyone have that or could provide it?

Posts: 74
Joined: November 17th, 2012, 1:40 pm

Re: HaXe example?

Postby jahooma » January 3rd, 2013, 2:27 pm

Just thought I would second Arnaud's request: a simple starter example using Haxe and PlayerIO would be helpful--extra points if it's a FlashDevelop project.

Posts: 1
Joined: August 9th, 2011, 7:24 pm

Re: HaXe example?

Postby cog » January 3rd, 2013, 2:37 pm

I tried it quite a bit and lost some time with it without managing to have it properly working, it was pretty frustrating. It isn't that easy and requires some expertise in HaXe/flash compatibility stuff. So I ended up the flash route ...although I would have preferred the HaXe way though.
Posts: 74
Joined: November 17th, 2012, 1:40 pm

Re: HaXe example?

Postby yangamedev » July 20th, 2013, 6:16 pm

Don't know if this is a solved problem but I just got it working in Haxe (for Flash builds only of course).

To build a PlayerIO swf in FlashDevelop create a blank project, import the playerio code, then create a basic Document class that "uses all the PlayerIO objects". Run it you've got your .swf. You can open it up in FD's Project View to make sure you have all the PlayerIO objects exposed inside.

Had no idea what "uses all the PlayerIO objects" meant until I realized "uses" meant "instantiate so they'll be public in the swf":

Code: Select all
    import flash.display.Sprite;
    import playerio.BigDB;
    import playerio.Client;
    import playerio.Connection;
    import playerio.PlayerIO;
    public class LibraryPlayerIO extends Sprite
        public function LibraryPlayerIO()
            var pio:PlayerIO;           
            var bigdb:BigDB;
            var client:Client;
            var connection:Connection;


Copy the built PlayerIO .swf to your Haxe project.

To get working with the .swf, this post helped big time:

In your Haxe code you can create callbacks as normal, just use Dynamic instead of any specific PlayerIO types. It connects for me so far, and when I tried to create a room it knew I didn't have any servers setup, a good sign. If I experience any hiccups getting that running I'll report back here.


Posts: 3
Joined: July 20th, 2013, 5:02 am

Return to General