So many ideas, so little time.

Admob OpenFL Extension

February 25th, 2015

As I moved from Flash (Adobe Air) to OpenFL, the same I’m doing with extensions.
First extension, Admob OpenFL Extension could be installed with haxelib:

haxelib install admob-openfl

Full source code and usage instructions could be found on GitHub:
Admob OpenFL Extension

Unfortunately, extension supports only Android, so if anyone wants to add iOS support, please let me know!

ะท.ั‹.: Amazon Ads extension is coming soon… ๐Ÿ™‚

Loading assets from .swf with OpenFL + font embedding

August 26th, 2014

A small tutorial on how to load assets from .swf file with OpenFL.

First, make sure you have the latest version of Haxe and OpenFL.
You can also execute the following command to update your libs to the latest versions:

haxelib upgrade

Second, make sure you have SWF Library, execute:

haxelib install swf

Now, we need to create our SWF library with all the assets.
You can do it with any version Adobe Flash or any other software of your choice.
Creat new flash project, import your assets to the library and make sure that every asset, you want to use, has AS Linkage.

In my example, I have one image with “button” class name:
You should remember class names for all the assets, you will load.
Build .swf file.

Ok, start coding.
Create new Haxe/OpenFL project with FlashDevelop (or whatever you use).
Put your .swf file into assets folder.

Open application.xml file and add the following lines:
1. our SWF Library, so we can use it:

<haxelib name=”swf” />

2. Link to our .swf file:

<library path=”assets/graphics.swf” type=”swf” />

In my case, I have graphics.swf file.
You should remember its name, as you will use it late.

Now we need to load our assets, open your .hx file, where you will load your assets (in my example, it’s Main.hx) and add the following code:

Assets.loadLibrary("graphics", onSwfLoaded); //we load our .swf file by its name "graphics"

After .swf file successfully loaded, we can start using our assets:

private function onSwfLoaded(lib:AssetLibrary):Void
	var bmpd:BitmapData = null;
	bmpd = Assets.getBitmapData("graphics:button"); //syntax is [SWF_FILE_NAME]:[ASSETS_CLASS_NAME]
	var bmp:Bitmap = new Bitmap(bmpd, PixelSnapping.AUTO);
	bmp.x = 200;
	bmp.y = 100;

The same should work for MovieClips and Sounds.
Worth mentioning, SWF Library doesn’t work for HTML5 target.

In order to embed font to you project, we need to do the following steps:
1. Put all the font files into the folder within our project, for example, “assets/fonts/“;
2. Add the following line to application.xml:

<assets path=”assets/fonts” rename=”fonts” />

3. Load and use our font:

var font:Font = Assets.getFont("fonts/arial.ttf"); //load font
var format:TextFormat = new TextFormat(font.fontName, 20, 0xffffff); //create new TextFormat with our font
var text:TextField = new TextField();
text.defaultTextFormat = format;
text.embedFonts = true; //make sure we use our loaded font
text.width = 500;
text.text = "That was easy!";
text.x = 300;
text.y = 400;

If you build and run sample project, you will see the following result:

Sample project source code:

Have fun! ๐Ÿ™‚

Amazon Mobile Ads ANE updated

July 30th, 2014

I have updated Amazon Mobile Ads ANE with the latest version.
It now supports caching and showing of interstitial ads.
In August and September Amazon will provide “a Guaranteed $6 CPM on Interstitial Ads”.
More details here:

ANE, including source code, could be found on GitHub:
Amazon Mobile Ads ANE

Good luck!

Rainbow Lines and etc.

April 23rd, 2014

Some news…

* I have released Rainbow Lines on Google Play.
I have decide to make two separate versions of the game: with HD graphics and without, otherwise game file size is too big.

* Updated AdMob ANE to comply with the latest AdMob/Google Mobile Ads/Google Play/AdSense changes. New ANE is much heavier and throws numerous warnings, but seems to work fine. ๐Ÿ™‚
Old version is deprecated and “Google Play will stop accepting new or updated apps that use the old standalone Google Mobile Ads SDK v6.4.1 or lower. You must upgrade to the Google Play version of the Mobile Ads SDK by then.”
As usual, it is available on GitHub:

* Match Jong is somewhat in freezed state at the moment, but I have a playable demo, and my artist is ready to start preparing graphics. Going to start working on the game soon. ๐Ÿ™‚

* Little by little, I’m releasing free version of All-in-One Mahjong 2 with updated AdMob ANE, of course.
All-in-One Mahjong 2 FREE is already available on Google Play.

Amazon Mobile Ads ANE

November 12th, 2013

As I’m going to release free versions of Solitaire and Mahjong games on Amazon AppStore, I’ve decided to use Amazon Mobile Ads (+ AdMob of course, Amazon Mobile Ads only work in USA, I guess).
And, as these games are made with Adobe Air, I had made another ANE…
Here it is: Amazon Mobile Ads ANE, available on Github along with source code.


September 2nd, 2013

I have found one AdMob ANE, it works ok and supports both Android and iOS, but it has bugs and lack some functionality:

So, had no choice but create my own AdMob ANE.
Extension along with all the source code is available on GitHub:

Application Licensing ANE

May 4th, 2013

I have published paid app on Google Play and Samsung Apps, so I have used there licensing services in order to protect the game from illegal copying (DRM).

In order to use these services with my current AIR apps, I have developed by own ANEs.
The source code along with extensions and some usage examples can be found on Github: ANE License Checker

I’m also going to publish the game on SlideME, so will add support of their licensing service later.

Luckily, Amazon and B&N has built-in protection, that is applied when you publish your app, no need to make extensions for them.

Adobe AIR In-app Purchase native extensions

February 18th, 2013

I have spent some time searching for free extensions for all the possible platforms and would like to share my results.
Also, I made my own in-app purchase extension for Android, as I couldn’t find a good and free one.

1. In-app Purchase for Blackberry Playbook.
There is an extension that comes with BlackBerry SDK for Adobe AIR.
API docs:

2. In-app Purchase for iOS.
In-app purchase extension comes with Adobe Gaming SDK

3. In-app Purchase for Amazon Kindle.
It comes with Amazon SDK:

4. In-app Purchase for Android.
I have found two extensions:
First is free extension from Freshplanet, but it is outdated.
Second is from Milkman for $50.
So, I have decide to make my own. ๐Ÿ™‚
You can find it here: Adobe AIR In-app Purchase native extension for Android

Hope, it will help someone in its mobile app development.
« go inside »