This demonstrates using AIR native extensions (ANE). To build with an ANE, place it in your project's libs/ directory. You can also stick .swc and .swf files in there for pure AS3 libraries.
This demo uses these extensions:
-
Flurry for analytics. Requires adding a couple permissions to the Android manifest.
-
Burstly for showing interstitial ads. See flambe.yaml for required Android manifest settings.
-
Vibration. Make sure to add the Android VIBRATE permission.
Try it out on Android.
When working with libraries written in AS3, you may run into package names that are capitilized, which is not allowed in Haxe. One way around this is to generate externs from the .swc/.ane, then edit them and use @:native. For example:
-
haxe --gen-hx-classes -swf-lib libs/AirBurstly.ane -swf out.swf --no-output
-
Copy the generated
hxclasses/com/freshplanet/ane/AirBurstly/
tosrc/com/freshplanet/airBurstly/
. -
Edit the new files in src/ to the lower-cased package, and add @:native to each class to point to the original, capitalized package.
The Burstly ANE uses a capitalized package, and this demo contains the result of these three steps.