How to create your own ANE for iOS using Adobe Air

Adobe Air gives us the amazing opportunity to access the device capabilities using extensions, also named ANE (Adobe Native Extensions). Creating an ANE is pretty simple, although it requires a laborious process which is not always easy to remember. Adobe has some tutorials about it, but I find them a little confusing and not straight to the point. This is a step by step guide with the very basic knowledge to know to build a simple ANE for iOS. The ANE we will build doesn’t really have any use, it will simply return a String from iOS that says “Hello World!”. Although this is a kick start to create any other Native extension. Soon I will post some more examples to generate more complex behaviors. Tools First thing, you need a Mac,… [Read more »]

Adobe Air ANE

How to apply a 9-Slice scaling on a Bitmap

If you are trying to apply a 9-Slice scaling on a Bitmap, by now you have already found out that is a big pain in the butt. If you don’t know yet, a 9-Slice scaling can be activated by going in the properties of your symbol and check the proper button as showed in this image: If you do this you are pretty much telling Flash that you only want to scale the inside part of your MovieClip, this trick though only works for vectors (not even that good sometimes). So what to do in case you want to scale a Bitmap? You can use this approach, what I am doing here is very simple, I am dividing the image in 9 parts where the corners are always the same, and… [Read more »]


Build an App for iPhone or iPad with FlashDevelop

This guide contains the essential steps to build an App for iOS using FlashDevelop and Windows, I will not stop trying to explain what I am doing or why I am doing it, sometimes it gets so obscure that I don’t even know, just do it and it will work…. hopefully. Of course before you even start reading this make sure to pay the $99 fee to the Apple bloodsuckers to become an iOS developer. Let’s Start Install OpenSSL for Windows. Create a new project with FlashDevelop selecting AIR Mobile AS3 App Open CMD (Start, serach program cmd) and execute the following commands: cd C:\OpenSSL-Win32\bin (or wherever path you installed OpenSSL) set OPENSSL_CONF=c:\OpenSSL-Win32\bin\openssl.cfg set RANDFILE=.rnd openssl genrsa -passout pass:fd -out mykey.key 2048 openssl req -new -key mykey.key -out CertificateSigningRequest.certSigningRequest -subj “/, CN=Your… [Read more »]


How to rotate many MovieClips on the same external point using Matrix in AS3

We will use Matrix for this, it is a little bit more code to write, but the result is the best you can get. This way you can create an array of objects you want to rotate around a point, also you need to create an array of matrix transforms every time you start the rotation, this way you wont have any error. In this exampe I have 5 objects (a,b,c,d,e), and i want to rotate all of them on the given point p.-break here-

And this is the result:

Air for Android – Blitting test on Motorola Xoom and Galaxy S 2

I have been trying different Android devices with Air for Android 3.1 and Blitting, I noticed the performance is very different on each of them, on my Galaxy S 2 it runs smooth but on Motorola Xoom lags very bad. I went on the Android Market and downloaded AirBench, it is an app that runs some tests on your phone and tells you the results. Some unrelated tests that stand out were these: Parse 145 KB XML file: Galaxy S 2 – 70ms Xoom – 150ms Allocate 8192 KB of Memory: Galaxy S 2 – 21ms Xoom – 36ms Write read and delete a 1024KB file: Galaxy S 2 – 64ms Xoom – 83ms   In my experiment I was running 30/30 FPS on GS2 and 16/30 FPS on Xoom, an impressive… [Read more »]

Motorola Xoom Android

Compress a String into Base64

This compression method is very helpful If you have a long string or any kind of byte array that you want to compress and then be able to put in a database or, for example, if you have a game with a level editor and you want to allow people to share levels with a code that you provide, hiding the actual variables you are using in that code and at the same time compressing it. Last year I have stumbled upon a SWC named Blooddy Crypto, it contains a wide variety of compressor and serialization, but most important, it’s fast as hell!  Download it and add it to your project. An example of code that show how to compress and uncompress:

It actually works better for longer strings, for example in this… [Read more »]