11
Aug

It’s not often you see updates to the ActionScript 3 class APIs these days, so I was pleasantly surprised to see that the AIR 19 beta introduces two new methods to the Vector and Array class:

  • insertAt()
  • removeAt()

They are intended as a replacement for the splice() method when you only want to add or remove a single element. So why use them over the splice() method? Well both methods make a change directly to the array or vector rather than creating and returning an altered version. They’ve been implemented with performance in mind and will perform better than the existing splice() methods.

To show the new APIs in action, here are two quick examples.

In the first example I add a score of 800 to the 2nd element of a vector of high scores:

var topScores :Vector.<int> = new <int>[1000, 500, 250, 100, 50];
topScores.insertAt(1, 800);
trace(topScores); // [1000, 800, 500, 250, 100, 50]

And in the second example I remove the lowest score from the array and trace it:

var topScores :Vector.<int> = new <int>[1000, 500, 250, 100, 50];
var lowest :int = topScores.removeAt(topScores.length - 1);
trace("The lowest score of " + lowest + " was removed.");

You can download the AIR 19 beta from Adobe Labs.

30
Jul
stored in: AIR, Flash, iOS and tagged: , , ,

The beta release of Adobe AIR 19 has landed and the big news is that we finally have the AS3 Workers API for iOS.

So what are Workers? Well put simply, Workers lets us create multi-threaded AIR and Flash Player applications. This is significant because you can finally relegate CPU intensive tasks to a background worker thread while your main application thread continues to do its own thing. So for example, you could write code to perform some heavy image processing in the background without your app’s UI being blocked. In fact, this is one of the primary reasons for using workers: to ensure your app’s user interface and animation stay as smooth as possible even when there’s a lot of processor intensive code being run.

You can find the API documentation for the Worker class on Adobe’s official AS3 Language Reference site. There’s also the Introducing Concurrency on iOS article on the Adobe Developer Connection website, which will help you get started.

And if you want a more detailed introduction to workers then take a look at Shawn Blais’s excellent tutorial on the subject. Part three is particularly interesting as Shawn shows the Nape physics engine running in a separate thread to guarantee a silky smooth 60 frames-per-second simulation.

You can download the AIR 19 beta from Adobe Labs.

The video from my Introduction to Flash Professional’s WebGL Runtime API webinar is now available.

The encoding for the video unfortunately looks a bit wonky in places but I’ve provided the slides from the presentation below so you should be able to follow along with the audio.

In addition, the FLA and source code from the presentation is available on GitHub. You’ll find the original JavaScript version of the code that I ran through during the webinar and there’s also a bonus TypeScript implementation in there too. Oh and a big thanks to Robert Penner for the improvements to my TypeScript code.

Finally, here’s a link to the running version of the actual WebGL content that I produced during the webinar.

Thanks once again to everyone who attended!

I’ve placed the example source code from yesterday’s webinar on GitHub. You’ll find the original FLA file complete with the JavaScript source code (it’s inside bunny.html). As an added bonus I’ve also included a TypeScript version of the example.

You can find the repository here: https://github.com/ccaleb/flash-webgl-intro

And here’s a link to a running version of the code.

Thanks to everyone who attended today’s webinar about Flash Professional’s WebGL Runtime API. Here are the slides from today.

Unfortunately I ran out of time and had to quickly skip over most of my content on ECMAScript 6 and TypeScript. If you’d like to know more though then please visit the links listed at the end of the presentation.

On June 17th (8:00AM PST) I’ll be presenting a one hour webinar on Flash Professional’s WebGL Runtime API. If you’d like to find out how to create interactive Flash content that will run on both desktop and mobile browsers then it might be worth dropping by.

I’ll be walking through the steps required to build an interactive Flash animation, covering the basics of Flash’s WebGL Runtime API and also showing how visual content is constructed and exported. During the session I’ll be jumping between JavaScript coding and some good ol’ timeline work, so whether you’re a developer or designer, there should be something that piques your interest.

You can find out more details and check your local time from Adobe’s Flash Professional Team Blog.

Colin Holgate from Funny Garbage recently presented his experience of creating HTML5 games using Flash Professional.

As Colin demonstrates, anyone wanting to target HTML5 while using the familiar Flash workflow can easily do that using Flash’s HTML5 Canvas document type. And as you can see from the video, the end results are quite impressive.

30
Apr

If you’ve been uploading builds to TestFlight you’ll no doubt have noticed that you need to increment your app’s version number each time you want to deploy a new build. Annoyingly Adobe AIR’s <versionNumber> tag has always populated both the CFBundleShortVersionString and CFBundleVersion keys in the iOS info.plist file, meaning there was no way to simply update the build number while keeping the app’s version number the same.

Thankfully the recently released AIR 18 beta SDK fixes this issue by providing you with a <versionNumber> and a <versionLabel> tag. The <versionNumber> tag is used to update the build number, while <versionLabel> is used for the app’s actual version number. So if you’re only making a minor update to your app you can now simply update its build number rather than the version number.

You can download the AIR 18 Beta from Adobe Labs. The release notes are available from here.

28
Apr

PixiJS has got to be my favourite JavaScript 2D rendering engine. It’s awesome! So I was pretty damn pleased to find out that a new major version has just been released by Mat Groves.

pixiv3-logo

A lot has changed including a new modular architecture and increased focus on WebGL rendering. With WebGL now available across a wide range of mobile devices it’s great to see Pixi being architected in such a way to ensure that the WebGL side of things is as efficient as possible. Also, for those targeting multiple screen resolutions (who isn’t these days), PixiJS v3 has a new resolution manager making it easier to work across different resolutions and pixel densities.

A new version of the official site will be coming soon along with documentation and example code. In the meantime you can find out more on Mat’s blog and grab the latest version from GitHub. In fact, there are some impressive demos on Mat’s blog showing off just what v3 is capable of.

If you’ve been using the TestFlight website to upload and distribute test builds of your Adobe AIR apps then you’ll probably be aware that the service has moved. Apple acquired TestFlight in February and have now integrated it within iTunes Connect. So here are a few useful tips for uploading your app for TestFlight beta testing within iTunesConnect.

Download Adobe AIR 16+

Apple now insist that all apps submitted to the App Store must include 64-bit support. This restriction also applies to any builds you upload to iTunes Connect for beta testing.

Thankfully Adobe AIR 16 introduced support for 32-bit and 64-bit iOS platforms. The AIR 17 beta SDK has improvements over AIR 16, allowing it to compile for both platforms in parallel, cutting packaging times by fifty percent.

I’ve actually been using AIR 16 for a current project and its builds can be uploaded for beta testing without any problems. But you might as well take advantage of the improved compilation times provided by the AIR 17 beta SDK.

Distribution Certificate and Provisioning Profile

The TestFlight website let you upload apps that had been built with a development certificate. However, in order to submit a beta build via iTunesConnect you’ll need to generate and use a distribution certificate. This can be done by generating an App Store and Ad Hoc production certificate from the iOS Dev Center.

You’ll also need to create a Distribution Provisioning Profile and associated your distribution certificate and your app’s App ID with it.

Update your App Version Number

Before making a build and submitting it, you’ll need to update your app’s version number. This can be done by editing your application descriptor file (-app.xml). Simply increment the value of its versionNumber tag:

<versionNumber>0.0.3</versionNumber>

You’ll need to increment this value every time you submit a new build for beta testing. If you don’t, then the submission will be rejected for having a version number identical to an existing build.

Beta Entitlements

Staying within your application descriptor file, you’ll also need to set the correct beta entitlements. Add the following XML:

<Entitlements>
  <![CDATA[
    <key>get-task-allow</key>
    <false/>
    <key>beta-reports-active</key>
    <true/>
  ]]>
</Entitlements>

It’s important you remember to do this. If you submit your build to iTunes Connect without these entitlements, it will be accepted, but testers won’t be able to gain access to it. Worse still, you can’t delete builds from iTunes Connect, leaving you with no choice but to increment your app’s version number and submit a brand new build. Remember, once a build has been successfully submitted you can’t upload another build that has the same version number.

NOTE: If you’re making a build for yourself using a development certification and development provisioning profile then you’ll need to remove the entitlements XML from your application descriptor file. This is a nuisance but the easiest way to deal with it is simply to comment-out your entitlements XML when you don’t need it, and then remove the comments when you’re creating a beta build for upload to iTunes Connect.

Here’s how your application descriptor file should look after commenting out the entitlements:

<!--<Entitlements>
  <![CDATA[
    <key>get-task-allow</key>
    <false/>
    <key>beta-reports-active</key>
    <true/>
  ]]>
</Entitlements>-->

Upload using Application Loader

The final step is to upload your builds. If you’ve been using the TestFlight website you’ll be used to simply dragging and dropping your files onto a web page. To submit your content to iTunes Connect you’ll need to use the latest version of Application Loader. You can download Application Loader from the iTunes Connect website.

I hope all that was of some help to you guys.