Asserting your way in ActionScript and Objective-C

We often get asked “what’s with all those assert statements in your code”? This concept was hammered in my head when I was a junior programmer, so I feel kind of old every time I am asked to explain it. But hey… An assert is usually defined as a “debug-only macro that aborts execution if its argument is false”. (See Steve Maguire’s Writing Solid Code) In other languages, like ActionScript, where you don’t have macros, you can use other techniques to achieve the same effect. The idea is that you use an assert as a diagnostic tool to help you Read More

Categories: AIR Native Extensions and Tutorials.

How ActionScript data is represented in C

Welcome to the first tutorial of the Translating between ActionScript and Objective-C series. Before we get on with data conversion, we need to have a word about how the ActionScript types are represented in the AIR C API, which is what you use when you make iOS Native Extensions for AIR. Most of the data you will be passing around will be either an argument of a function you call or a result of a function you call. Share on: WhatsApp Read More

Categories: AIR Native Extensions.

Translating between ActionScript and Objective-C

… and how to keep your cool while doing it. So you took the cross-language rout of programming. It’s fun, it provides variety and it often feels as if you are a tour guide for families visiting each other’s countries. Done that in real life, trust me. You have several people tugging at your sleeve and asking things like “So what’s that in Canadian dollars?” or “I don’t speak ounces. Why won’t they use the metric system?!” Usually all at the same time, as everyone knows it isn’t impolite if you interrupt in a foreign language.   Share on: WhatsApp Read More

Categories: AIR Native Extensions and Tutorials.

How to add event handlers to the AppDelegate in Objective-C

When you are working on a Native Extension for iOS, as a rule, you don’t have direct access to your app’s AppDelegate class, which is how you control UIApplication. Suppose you want to intercept events in your app either before they get to the ActionScrip (AIR) side or because they won’t get there in the first place. This tutorial will show you how to do it. Share on: WhatsApp Read More

Categories: AIR Native Extensions and Tutorials.

Record off-screen video in Starling

It’s been a while since we last talked about recording your screen on iOS. You may remember our tutorial on how to capture the Starling stage in a video file. In that tutorial you see how to record the whole screen or a DisplayObject that is attached to the scene and is visible. In a recent conversation with Amos Laber a question came up: can one record a video of Starling content that is not attached to the stage at all, while the screen is showing something else? As you can imagine throwing a developer an innocent question like this Read More

Categories: AIR Native Extensions and Tutorials.