Laan's steps..

Feed Rss

Flash Player 10.1 multi-touch FAQ

01.14.2010, flash, by .

All content from:

As you can tell I have been having tons of fun lately playing with the new multi-touch and gesture APIs in Flash Player 10.1 and AIR 2.0. Based on my videos and examples there have been a ton of questions that have come up, many of which I didn’t know the answers to. There are still many things to test and I will pick Danny Dura’s brain while we are sunning ourselves this week in Brasil. Danny has done a lot of work with these APIs and will be doing a session on them at Flash Camp Brasil. Below are some answers to the most asked questions that have come up.

How many touch points can the Flash Player respond to?
There is no limit to the number of touch points you can have. You are only limited by the number of touch points the device you are using has. The HP TouchSmart has a maximum of two touch points and the iPhone has five. All depends on the device you are touching.

The gestures are nice but what about the raw touch data?
The examples I showed used the built-in gestures that we provide. These will be good for most applications. But there is also a raw multi-touch API as well that lets you track the raw point data.

Can I create my own custom gestures?
Absolutely you can. You would listen for the raw touch events rather than the high level gestures. You can track this raw data until you determine the custom gesture has happened and then fire your own event.

Does every device support all of the gestures in Flash Player 10.1?
Nope. Again you are at the mercy of whatever device you are using. We do have an API that allows you to find out which are supported on the device at runtime so you can do something else. Christian Cantrell has a great article on the developer center that lists which devices support what. This article also has some nice code snippets too.

Does the multi-touch stuff work in the browser too?
All of the multi-touch and gesture APIs work in the browser on Windows but do not work in the browser on the Mac. I don’t have any idea about Linux but I will try to find that out.

Why don’t they work in the browser on the Mac?
I anticipated this one of course. Jakub Plichta, who is the Flash Player engineer responsible for multi-touch, sent me the following detailed information about what we need from Apple to make it happen. Both Firefox and Safari use the same API to interface with the plugin. What we need is for Apple to add gesture and raw touch data to the NPCocoaEvent class defined in npapi.h in the webkit framework. There is nothing we can do until this happens. Big thanks to Jakub for giving us the nitty gritty details.

Wait but WebKit is open source. Can’t you do this yourself?
You really won’t leave this alone will you? WebKit is open source but the plugin interfaces for Safari and Firefox are written by Apple.

Will multi-touch work in the HTML component in an Adobe AIR 2.0 application?
In this case we have control over the WebKit implementation but because of time constraints we won’t be able to include that in the initial launch of AIR 2.0. But since it works perfectly with Flash-based AIR content I don’t think it will cause too many issues.

Do these APIs work on the iPhone when publishing from Flash CS5?
I’m assuming you saw my last post with the video but just in case, I thought I would put the question here. Yes they work on the iPhone too.

I have Windows 7 but no touch monitor. Can I use a Wacom Bamboo to do the multi-touch stuff?
Unfortunately not. Wacom has there own driver which doesn’t generate true native gestures. If you bought one I hope you saved your receipt :) . The general rule is: if the device generates raw, native multi-touch events then they will work in Flash.


电子邮件地址不会被公开。 必填项已用 * 标注


您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>