Kinect + Stage3D + Away3D + AIR = pure gold!
Check. This. Out!
Wouter Verweirder (lector at HOWEST in Kortrijk, Belgium, Adobe Education Leader and wizard owner of/consultant at Happy Banana) recently released an extension for AIR that allows you to use Microsoft’s Kinect sensordata in your AIR applications. To showcase the power of this he just released this video where he’s actually controlling a 3D model (rendered with Away3D on Stage3D in AIR) with his own movements. Pure gold! Can you imagine the possibilities?
AIR 2.7 now available for desktop, Android, iOS and Blackberry Tablet OS.
When I think about the new features in AIR 2.7 I can’t help but think about this Daft Punk song… Harder, Better, Faster, Stronger. That’s exactly what this release is all about… Well… You know what I mean ;-)
On mobile my favorite new feature is the improved rendering on iOS. With this release AIR apps for iOS render up to 4x faster in CPU mode. This change will improve the performance of many AIR for iOS apps, including those built with the Flex framework.
But don’t believe our words for it… Try it out yourself! There are already some really cool AIR apps in the appstore today. Try the Rossignol app for instance.
Or try one of Terry Paton’s games like Meteor Storm or Mazeball!
Another one of my favorite new features is probably the most requested feature for AIR for Android. You can now install or move the AIR runtime onto the SD cards within your Android devices!
An update for Flash Builder will be released soon but you can already grab the AIR SDK today and start building your apps!
Displaying ads in your mobile AIR application
I’ve seen a few Tweets from people who were asking about adding ads to their mobile AIR applications… Well… There’s actually a hidden gem in the AIR documentation… But… As most of you probably never read any docs ;-) I thought I’d highlight it here.
The trick is simple… Use the StageWebView class. You set the StageWebView object viewport to cover the area in your application in which you want to display the ad. Then you load an HTML page that contains the code for requesting and displaying ads. And tadaaaa… You have ads in your mobile AIR application.
Here’s an example of an HTML page that loads an ad from AdMob.
<html>
<head>
<title>Ad jig</title>
<script type="text/javascript">
var admob_vars = {
pubid: 'admob_pubID', // change to your publisher id
bgcolor: 'ffffff', // background color (hex)
text: '000000', // font-color (hex)
test: true, // test mode, set to false if non-test mode
manual_mode: true
};
function showAd()
{
_admob.fetchAd(document.getElementById('adspace'));
}
</script>
<script type="text/javascript" src="http://mm.admob.com/static/iphone/iadmob.js"></script>
<style type="text/css">
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
</style>
</head>
<body onload="showAd()">
<div id="adspace"></div>
</body>
</html>
The following ActionScript code will display the ad page in your mobile AIR application.
//Set up web view object
var webView:StageWebView = new StageWebView();
webView.stage = this.stage;
var adViewPort = new Rectangle( 0, 0, this.stage.stageWidth, 60 );
webView.viewPort = adViewPort;
webView.addEventListener(ErrorEvent.ERROR, onWebViewError );
webView.addEventListener(LocationChangeEvent.LOCATION_CHANGING, onWebViewLocChanging );
webView.addEventListener(LocationChangeEvent.LOCATION_CHANGE, onWebViewLocChange );
//Copy the html file outside the app directory
var templateFile:File = File.applicationDirectory.resolvePath( "adview.html" );
var workingFile:File = File.createTempFile();
templateFile.copyTo( workingFile, true );
try
{
webView.loadURL( workingFile.url );
}
catch (e:Error)
{
trace( e );
}
function onWebViewLocChange( event:LocationChangeEvent ):void
{
trace( "Change to" + event.location );
if( event.location != workingFile.url )
{
//Reset location back to our ad display page
navigateToURL( new URLRequest( event.location ) );
try
{
webView.loadURL( workingFile.url );
}
catch (e:Error)
{
trace( e );
}
}
}
function onWebViewLocChanging( event:LocationChangeEvent ):void
{
trace( "Changing " + event.location );
event.preventDefault();
navigateToURL( new URLRequest( event.location ) );
}
function onWebViewError( error:ErrorEvent ):void
{
trace( error );
}
But what if you want to use the mobile Flex framework? Well… Sönke Rohde actually wrote a wrapper around the StageWebView class so you can use it as a Flex component. By using this wrapper it becomes as easy as adding this one line of code to your app.
<components:WebView source="adview.html" width="300" height="50"/>
Note: This approach will most likely also work with other ad networks. Also not that this only works on mobile AIR applications. The example does not work in desktop applications, or when testing mobile applications on the desktop, due to local-versus-remote sandbox restrictions.
Kudos to Adobe’s learning resources team for putting this example together and to Sönke for creating the StageWebView UIComponent.
Now go make some money ;-)
AIR 2.7 + Flash Player 10.3 Beta 2 on Labs
The runtime teams are on a roll! Flash Player 10.2 was only released to the general public just last month and the first beta of Flash Player 10.3 was already on Adobe Labs just a few weeks after that. Today the second beta of Flash Player 10.3 is available on Labs.
Flash Player 10.3 introduces new developer features and enhanced user privacy protection, such as:
- Media measurement
- Acoustic echo cancellation
- Integration with browser privacy control for local storage
- Native control panel
- Auto-update notification for Mac OS
We’ve also just released AIR 2.7 on Labs. AIR 2.7 also has the media measurement and acoustic echo cancellation features from Flash Player 10.3 as well as an enhanced HTMLLoader API.
These new beta runtimes are available so that you can test your existing content and start playing around with the new APIs. If you find an issue make sure you tell us about it!
The future of Flash brighter than ever
Yesterday at the Flash Gaming Summit in San Francisco Adobe launched the Adobe AIR and Flash Player Incubator program. The Incubator is a technology preview program for more adventurous developers who are willing to experiment with Flash Platform runtime features that are in early development stages.
One of those features is the Molehill API for 3D. Molehill is a new set of low-level, GPU-accelerated 3D APIs that enable advanced 3D experiences across devices through the Flash Platform runtimes. Adobe worked closely with the most popular ActionScript 3D frameworks so that not only advanced 3D developers can take advantage of these new APIs. These 3D frameworks already have Molehill enabled versions available today:
But Molehill does not just offer high performance 3D APIs but can also be used for 2D graphics! Flash Player Product Manager Thibault Imbert has more information and an example on his blog.
Unity added the cherry on top of yesterday’s news. They announced that an upcoming version of Unity (the very popular game development tool) will allow developers to target Flash Player. I can’t wait to play around with it!
These are very exciting times for Flash developers! Check out Tinic Uro’s blog to see how you can start playing with Molehill today!
Flash on!






