This is the final and probably most important part of the making of any native extension. You need to be able to step through both your ActionScript, as well as native code, in this case C++. See how to do that below. At the end of this part you will have: Ran and stepped through the native code of your ANE in Visual C++. And you will have completed this tutorial. Time 15-20 minutes Share on: WhatsApp Read More
By this part you have already packaged a Native Extension for Windows or have one at hand from elsewhere. In this article we will see how to include it in an app and use it. At the end of this part you will have: An Adobe AIR Native Extension (ANE) ready to be used on Windows. Time 12-15 minutes Share on: WhatsApp Read More
At the end of this part you will have: An AIR library, ready to be packaged in an AIR Native Extension for Windows. Time 10-15 minutes Share on: WhatsApp Read More
At the end of this part you will have: A Windows DLL, ready to communicate with ActionScript and to be packaged in an ANE. Time 10-15 miutes Share on: WhatsApp Read More
At the end of this part you will have: A C/C++ project which you have set up to use the Adobe AIR C API. Note that, although the steps here are done with Microsoft Visual C++, you don’t necessarily need to stick with it. Any IDE or command-line compiler that builds C/C++ code will do, for example GCC. The most important steps in this part of the tutorial are making sure that your C/C++ code can see FlashRuntimeExtensions.h and link with FlashRuntimeExtensions.lib from the Adobe AIR SDK. Time 8-10 miutes Share on: WhatsApp Read More
So you already know that, in order to make calls from your AIR app into native code, you need an Extension Context. One of the Extension Context roles is to tell AIR what native functionality is available for calling from ActionScript and this happens during the Extension Context initialization. This post will show you how this is done in C - you can use that in your C, C++ or Objective-C code. Read More
When you make a native extension using the AIR C API, your native code tends to have two parts:
- one that's concerned with exposing functionality in a way that AIR can call, in other words, dependent on the AIR C API;
- functional part, which deals with the platform-specific stuff. This part of your code doesn't (and shouldn't) care about whether it's used in an AIR native extension, a purely native app or something else.
Ideally you want to keep the dependency between these two parts one-directional: the AIR-concerned part should depend on the functional part, but the functional part should not know about and depend on AIR. If you decide to reuse your, say camera or speech recognition functionality, in another project that's not AIR-related , you don't want to force that to include the AIR C API.
So, what happens if you need to dispatch an event from the functional part of your code? Say, the camera refused to start or the speech processor is ready with results and you want you alert AIR to this... Read More
Do you remember the three ways that native code can send data back to ActionScript? Here they are for a quick revision:
- Returning a FREResult object from a call to FREFunction.
- Using output parameters in a FREFunction.
- Sending an event to ActionScript.
The Extension Initializer and Finalizer are the entry and exit points to your native extension. They are also two of the ingredients that make your extension known to the world and make it distinguishable from other extensions in an app. This is why they need to have unique names. Their signatures however need to be exactly as prescribed by AIR. Today we look at what these are in the AIR C API. Read More
If you've ended up on this page, you are probably already familiar with what goes into an ANE for iOS and an ANE for Mac OS. You also know that one of the main ingredients for these is the AIR SDK and its interface for these two platforms: the AIR C API.
Now, when you try to include that in your iOS or Mac OS native library, Xcode helpfully asks you whether you want the API's header file, FlashRuntimeExtensions.h, copied into your project. What should you do?