• Tutorials
  • Blog
  • About
  • Contact
  • Multitouch isn’t Cross Platform on Adobe Air 2 and Flash 10.1

    2010 - 01.13

    IMG_2291Last night I went to a really cool presentation by Mike Downey formally of Adobe and currently at Microsoft.  One interesting point that Mike made was the importance (and focus) of the Flash and Silverlight runtimes working cross platform.  He noted how important is was to Adobe and how Silverlight was also committed to both mac and p.c.  He also mentioned that each platform was inevitably going to venture away from their cross platform mantra.

    One point brought up by the crowd was that the new multitouch capabilities in Air 2 was cross platform, which actually isn’t really true.  And I think there might be some confusion here.

    Lee Brimelow recently posted a video with an application where he manipulates an image of his cat using some of the new events in the Flash platform.  He demonstrates a nice smooth zoom and rotation effect by using two fingers.  He shows the application working on both the mac trackpad and the HP touch smart.

    The Flash BlogThe confusion lies with the fact that Lee isn’t using actually using multiple touch events to zoom and rotate the image of his cat.  Lee is actually using the TransformGestureEvent which is available on both Windows 7 and OSX (Snow Leopard with the unibody trackpad) .

    Adobe Air 2 (and later Flash player 10.1) can only access touch events on Windows 7.  So why even bother?  With touch events you can handle the zoom and rotate in a much more natural way.  For example, when one rotates an image using TransformGestures you’ll often see the rotation origin just set to the center of the image.  This seems to work fine but the rotation origin should actually be the mid point between the two touch events.  (sorry for my crude sketch)

    transformGestureIssues_dark

    With the new Air 2 sdk it’s trivial to check the users multitouch capabilities and add a switch statement to best handle the differing multitouch capable devices (Lee might be doing something like this in his example,  I have no idea):

    ?View Code ACTIONSCRIPT
    if(Multitouch.supportsTouchEvents)
    {
    	// rotate by calculating the rotation origin
    }
    else if(Multitouch.supportsGestureEvents)
    {
    	//rotate by rotating around the center point of the object.
    }

    And while I feel it’s important to keep the cross platform goal a primary focus for Adobe Air (and Silverlight out of browser), I’m glad that it’s not forcing them to exclude valuable new features from the platform.

    What do you guys think?  Where do we draw the line on keeping the runtime cross platform but still allowing for advancement of features on differentiating devices and OS specific capabilities?

    Update: Lee Brimelow clears up some of the confusion with a multitouch FAQ post.

    [Update for clarification: OSX does give you access to handle gesture events created by using multiple touches on the trackpad.  You just don't have access to the raw touch event which means you can't calculate the x/y of each finger.  And the 'why bother' wasn't intended to dissuade people from using touch events but rather encourage people to consider it as an option vs the transform gesture events because it provides the developer with additional information]

    4 Responses to “Multitouch isn’t Cross Platform on Adobe Air 2 and Flash 10.1”

    1. [...] This post was mentioned on Twitter by HowDo.us and CT, Multitouchup.com. Multitouchup.com said: Multitouch isn’t Cross Platform on Adobe Air 2 and Flash 10.1. http://multitouchup.com/?p=261 (windows 7 = touch = mo better then gestures) [...]

    2. JohnO says:

      I think with FP 10.1 being both a desktop and mobile player, full cross platform capability would be a horrible move and would only serve to handicap the Flash platform. As developers, we just have to be more conscious of the capability differences between Mac and Windows, but also the various mobile platforms. I’d rather have Adobe keep innovating the Flash platform to maximize the capabilities of the native OS, but they will also need to provide guidance on the “gotchas” that we may encounter across the various platforms. 2010 is going to be a fun year. :)

    3. Lee Brimelow says:

      “Adobe Air 2 (and later Flash player 10.1) can only access touch events on Windows 7. So why even bother?”

      That is simply not true. You can respond to multi-touch events in AIR 2.0 on the Mac. Not sure where you got your information from.

    4. admin says:

      Lee, Your right that came off sounding like one shouldn’t bother to use touch events when I intended it to provoke the question of why, and then go on to answer why one should use touch events.

      However the statement remains true. Air 2 on the Mac doesn’t respond to touch events or multiple touch events. Air 2 on the Mac responds to gestures. Big difference. There is a lot can do with touch events that you simply can’t do with gestures. I think there is still a lot of confusion on this topic and that was partially the reason for the post.

      Maybe I should update that bit for clarification.

    Your Reply