Working tutorial to install AIR native extensions in Flash Develop 4

Installing a native extension in Flash Develop 4 on a Windows Desktop project is a pain in the ass, and the worst part is that the best tutorial you can get searching in google about this is incomplete and innacurate. I have a lot of experience working with native extensions so I decided to create my own tutorials on how to install them for Windows and for Mobile projects.

For a Windows and Mobile app:

1) Create a folder named “lib” in your root Flash Develop project and copy the .ane file into the lib folder created.
2) Without leaving the lib folder make a second copy of the .ane file, rename it with .zip extension, unzip it and then delete the zip (You must end up with an .ane file and a folder with the contents of the .ane file).
3) Inside the unziped folder open the following file: META-INF\ANE\extension.xml
4) Copy the content of the <id> tag, for example: “com.myBuisness.myApp.air.SuperLibrary”
5) Rename the unzipped folder with the tag content we copied before and add the .ane extension to it like it was a file and not a folder, so the folder name must be something like this: “com.myBuisness.myApp.air.SuperLibrary.ane
6) Go to Flash Develop and do right click on the ane file and then click on “add to library”
7) The Air project was created with some .bat files, you must modify them like this:

Packager.bat: replace the line that starts with “call adt” for:

call adt -package %OPTIONS% %SIGNING_OPTIONS% -target native %AIR_TARGET% %APP_XML% %FILE_OR_DIR% -extdir lib/

Run.bat: replace the line that starts with “adl “%APP_XML%” for:

adl “%APP_XML%” “%APP_DIR%” -extdir lib/

PackageApp.bat: only if your target is Windows replace the line “set AIR_TARGET=” for:

set AIR_TARGET=air/Setup.exe

8) Add the following to the application.xml:

<extensionID>PASTE HERE</extensionID>

9) Where it says PASTE HERE you must paste the content of the tag you copied in the step 4, so must look like this: <extensionID>com.myBuisness.myApp.air.SuperLibrary</extensionID>

10) If your target is Windows, without leaving application.xml modify (or add if doens’t exist) the  supportedProfiles tag with only extendedDesktop value like this:
Only extendedDesktop alone is supported, “extendedDesktop Desktop” doesn’t work.

And thats it, the painfull process is finished, the extension must work and when you execute PackageApp.bat you get a .exe, .apk or .ipa file with the native extension working. .air files cannot be created when using native extensions.
On Android target you must create a captative runtime version with the option 3 of the PackageApp.bat menu.

The other tutorials dind’t help very much to create the .exe file or where to get the ID of the app to rename the folder, so this is the best one for the moment.

mrdoob’s performance monitor ported to NME

If you come from AS3 you probably know what is this:

A performance monitor for FPS and virtual memory (MEM) now ported to Haxe + NME.
Download from here.


stage.addChild(new Stats());

Console class for AS3 or Haxe

I made a very usefull console class. There is an AS3 version and a Haxe + NME version. Is simple to use and has interesting features you can’t find in other console tools.

The visual representation is similar to consoles that you find in games, such as Quake.


  • Write debug messages and errors to the console. Those messages will be easy to find, and nicely hidden away from regular users. This can speed up the development process.
  • Change the state of your application at runtime, by adding commands to the console.
  • Add “live fields” when you want to display information with a very high time frequency without adding a new line of text on every update, for example when you want to display a number on every frame.
  • Measure the execution time of a piece of code very easily. Results get displayed on the console as a “live field” or as a new text line.
  • Browse the history of previous commands using “up” and “down” cursor keys (like on the OS consoles). The history remains even if you close your application and compile a new version.
  • When you trace an Array, Object/Hash and XML you can see the content, for example: If you write Console.trace(myArray), or trace(myArray) on Haxe, instead of showing “array” it will display the content of the array.
  • All the methods of the class are static, so it’s easy and clean to acess the console anywhere on your code.
    In Haxe the console overrides the native trace method, so you don’t need to import the Console class everywhere if you only need to use the trace.

There are other small features not listed here and new ones comming, you can check the updaets and fixes list here.

How to use it:

  • Starting:





By default “Ctrl + 1” will dislpay the console, you can change that with the parameters of the create() method. If you want to show it by default call show() after the creation:


  • Writing something:


trace(“Hello planet!”);


Console.trace(“Hello planet!”);

  • Creating a command:

Console.addCommand(“sayhello”, callback);


Console.addCommand("sayhello", function(parameters:String):void
    trace("hello! parameters of the command: "+ parameters);

The “patameters” string contains all the user writes after the command, for example if the user write “sayhello hey ho” the string will be “hey ho”. If you write only “sayhello” the string will be null. Use that string to change your application at runtime.

  • Creating a live field:

Console.setLiveDataField(“my data”, myData);


var frameNum:int = 0;
stage.addEventListener(Event.ENTER_FRAME, function(e:Event):void
    Console.setLiveDataField("frames rendered", frameNum);

The first parameter (“my data” in the first example) works as an ID of the live data field.  Creates a live data field if never was created and updates if already exists.
You can create as many live fields as yo want, until you get aut of screen space.

  • Measuring code execution time:

Console.measureTime(“my loop time”);


Console.measureTime("my loop time");
for (element in myObject)
   var createThis:String = "hello";
Console.measureTime("my loop time");

Note the measureTime method is called 2 times, the first time starts measuring time and the second time stops and displays the time elapsed.
The parameter works as an ID, you get the results when you set the same string in both calls.
You can repeat this process with the same ID or a different one on the same runtime.


IMPORTANT FOR HAXE: Version 3.3.2 (or superior) of NME is required, previous versions doesn’t work properly on C++ platform. HTML5 platform is not supported for the moment due to the NME/jeash problem with textField.maxScrollV on HTML5.

This is part of a pack of tools I’m publishing called “fermmmtools”, you can find this class on the “debug” package:

Direct links:

As3 version
Haxe version

HaXe: Multitarget Dictionary class

Sometimes there are things so powerfull that thay have problems just for being powerfull, that’s what happens with HaXe sometimes.
There is not a Dictionary class officialy supported by HaXe, the TypedDictionary class only works on the Flash target.
The reason is because HaXe creates native code, and there is not a generic way in all the native platforms to get an identifier of an object.
But that doesn’t mean we can’t have a a Dictionary class so here it is my version of it, called ObjectHash.
Works good and fast like the flash class, at least on the targets I have tested it: flash, windows/C++ and html5 . If you tested it in another target let me know, I’ll update this.

Download ObjectHash from here.

How to use it:

It has the same syntax of  TypedDictionary. If you need to know how to use the class, learn TypedDitionary.

Differences with NME’s ObjectHash:

  • The NME’s class is more efficient with virtual memory.
  • This class supports more targets than NME’s one.
  • This class works like TypedDictionary or like Dictionary in AS3, when you make a loop you get the keys. NME’s ObjectHash behaves in consistency with HaXe’s Hash, when you make a loop you get values so you need to make a loop using objectHash.keys() to get the keys.

If you are targeting only the NME platforms I recommend you to use that class.

There are some small limitations:

String, Float, Int and Bool types can be set as values but not as keys. Example: myObjectHash.set(myInt, myMovieClip) doesn’t work and myObjectHash.set(myMovieClip, myInt) works. I think is not a big problem since using those basic data types as keys in a object hash is a rare case, I never needed to do that in my years of AS3 development. NME’s version of the class has the same limitation for the moment.

SwfSpriteSheet 1.7 – Sprite sheets from Flash

I made an open source application to generate a PNG spritesheet file from a SWF.

In other words the application creates a PNG file that shows an image sequence, every image of this sequence is one frame of the swf.

This is usefull to allow pixel based game engines to run animations made with Flash.

Supports any kind of timeline structure or actionscript animation.



Screenshot 2



Download From Here


  • Are actionscript animations supported?
    • Yes
  • Supports 3D animation made with an engine that uses Stage3D?
    • Oh Yes!
  • The background of the generated PNG will be transparent?
    • Yes. The application converts  the backround color of the SWF into transparent pixels.
  • If I load a swf with big dimentions the application fails, why? why???????.
    • Because Flash doesn’t support big bitmaps. Anyway, if you need a sprite sheet so big, you are probably doing something wrong with your project.
  • What happens if I have only one frame in the main timeline and lot of movieClips with animation inside them?
    • No problem, the application handles that situation perfectly.
  • I need to synchronize my swf changes and send them to the png file automaticly.
    • There is not a feature to do that for the moment, will be included in future versions….. may be…

Version 1.7 new features:

  • Stage3D supported (not tested).
  • Dynamic resize, now you can see more of the preview area without the need of scrolling.


This is a PNG made with swf  spritesheet creator as an image editor show it:

Source code:

If you want to report a bug, request a feature, send your source code to be uploaded or anything, leave me a reply.