Skip to main content
Inspiring
October 13, 2010
Question

[HTC Desire, android 2.2., FP10.1.95.2] TransformGestureEvent.GESTURE_SWIPE not working

  • October 13, 2010
  • 1 reply
  • 773 views

Hi,

I am reviewing new features of the player and I've made few examples from documentation, latter is about TransformGestureEvent.GESTURE_SWIPE, but I can't get it to work on my HTC desire. Question is does those features are not working in the browser?

http://greladesign.com/battlefield/fp10.1_transformgestureevent_swipe/

above example doesn't work:(

package
{
     import flash.display.Sprite;
     import flash.events.Event;
     import flash.events.TransformGestureEvent;
     import flash.text.TextField;
     import flash.ui.Multitouch;
     import flash.ui.MultitouchInputMode;
     
     /**
      * ...
      * @author Lukasz 'Severiaan' Grela
      */
     public class Main extends Sprite
     {
          protected var mySprite:Sprite;
          protected var myTextField:TextField;
          
          public function Main():void
          {
               if (stage) init();
               else addEventListener(Event.ADDED_TO_STAGE, init);
          }
          
          private function init(e:Event = null):void
          {
               removeEventListener(Event.ADDED_TO_STAGE, init);
               // entry point
               Multitouch.inputMode = MultitouchInputMode.GESTURE;

               mySprite = new Sprite();
               mySprite.addEventListener(TransformGestureEvent.GESTURE_SWIPE , onSwipe);
               mySprite.graphics.beginFill(0x336699);
               mySprite.graphics.drawRect(0, 0, 300, 200);
               myTextField = new TextField();
               myTextField.y = 200;
               myTextField.border = true;
               addChild(myTextField);
               addChild(mySprite);
          }
          
          protected function onSwipe(evt:TransformGestureEvent):void
          {

               if (evt.offsetX == 1 )
               {
                    myTextField.text = "right";
               }
               if (evt.offsetY == -1)
               {
                    myTextField.text = "up";
               }
               myTextField.text = evt.phase;

          }
          
     }
     
}

the same issue is with rotate gesture

http://greladesign.com/battlefield/fp10.1_gesture_phase_01/

best regards

    This topic has been closed for replies.

    1 reply

    Inspiring
    October 14, 2010

    Hi,

    Multitouch.supportsGestureEvents returns false but documentation doesn't mention about FP limitation for browser,

    there is only this:

    Note: The Multitouch feature is not supported for SWF files embedded in HTML running on Mac OS.

    My htc is not a mac so I expect to have it working