I’ve been banging my head against the wall for 4 days now, trying to get SteamWorks integration into Monster Loves You. Long story short, the SteamWorks API is only available in C++; someone made an unofficial SWC/ANE in AS3 that helps link it up; I’m trying to import that into Haxe; it only runs wrapped in an Adobe AIR runtime.
I feel like some kind of evil wizard, trying to smash together Haxe, AS3, a C++ Library, and AIR. Noxious fumes arise from my boiling cauldron.
I’ve almost got it all working now, and thanks to some help in IRC and such, but now I’m stuck. Maybe someone out there can help?
I’ve unzipped the .SWF from the .SWC file and have it code-completing in FlashDevelop, and compiling without error. Code is executing.
In one of the .SWF classes, there is an Adobe AIR function call; the app no longer works unless I wrap it in Adobe AIR (ADL.exe works great for this). Haxe/NME doesn’t include AIR references, but I worked around that by using Jan Flanders “Air3″ haxelib. That hurdle overcome.
Line 24 of this class, though, throws a null error.
Line 23 is the AIR call to instantiate the extension. This function returns null if it’s unable to find the reference to the extension in the AIR XML. “Oh,” I think. “I know this one! If I add:
to my application.xml, it should work!” (brackets changed for HTML sanity) So add it I did. But this is where my problem lies: upon execution AIR attempts to import all the listed extensions and include them in the binary. This is an unnecessary step, since Haxe already compiled the library into the .SWF. If I don’t list the extension, I get the null error listed above. If I include the extension, I get this error when ADL tries to run:
Error: The extension com.amanitadesign.steam.FRESteamWorks has either a namespac
e version or library.swf with a version that is incompatible with the applicatio
ns namespace or root SWF.
So my question then is: Is it possible to get AIR to register an extensionID that is already included, and not attempt to include it itself?
- or –
Is it possible for Haxe to externally include the .SWF (not internally) so AIR can grab it and do it’s thing?
- or –
Am I making some grievous error that is making this more complicated than it should be?
I’ll owe you a beer if you can help.