Poor Flex tap response on iOS -


we have several item renderers in our app, , we've noticed responsiveness of these ui elements taps can vary greatly.

example:

    private function setupclickhandling():void     {         //this.addeventlistener(touchevent.touch_tap, clickhandler);         this.addeventlistener(mouseevent.click, clickhandler);     }      protected function clickhandler(e:object):void     {         var event:itemclickevent =                          new itemclickevent(itemclickevent.item_click, true);         event.item = data;         event.index = itemindex;         dispatchevent(event);     } 

when using mouseevent.click, tap not register actual click, even though control spends bit of time in "down" state. frustrating because user believes control has been triggered, nothing happens other grey background flash because click event not fired.

when using touchevent.touch_tap, taps become too responsive, , list item triggered while list being drag scrolled. think tap interface register tap no matter how brief duration long centerpoint not move appreciably, , enough movement detected tap not registered. instead, appears happen tap event registered on down portion of event, not up.

so, there way either increase sensitivity of click, or decrease sensitivity of tap?

or ideally, register tap actual tap?

you can roll own tap gesture. here how did it..

public function baseitemrenderer()     {         super();         multitouch.inputmode = multitouchinputmode.touch_point;         this.addeventlistener(touchevent.touch_begin, ontouchbegin);         this.addeventlistener(touchevent.touch_move, ontouchmove);         this.addeventlistener(touchevent.touch_end, ontouchend);     }      protected var touching:boolean;     protected var touchstarttime:int;     protected var touchstartx:number;     protected var touchstarty:number;      private function ontouchbegin(e:touchevent):void     {         trace("ontouchbegin");         touching = true;         touchstarttime = gettimer();         touchstartx = e.stagex;         touchstarty = e.stagey;     }      private function ontouchmove(e:touchevent):void     {         //     }      protected static const tap_min_duration:int = 0;     protected static const tap_max_duration:int = 1000;     protected static const tap_min_distance:number = 0;     protected static const tap_max_distance:number = 40;      private function ontouchend(e:touchevent):void     {          if(touching)         {             touching = false;             var duration:int = gettimer()-touchstarttime;             var distancex:number = e.stagex - touchstartx;             var distancey:number = e.stagey - touchstarty;             var distance:number = math.sqrt(math.pow(distancex, 2) + math.pow(distancey, 2));             trace("ontouchend duration:" + duration + " distance:" + distance);              if(duration >= tap_min_duration &&                 duration <= tap_max_duration &&                 distance >= tap_min_distance &&                 distance <= tap_max_distance)             {                 ontap(e.target);             }         }      } 

Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -