Packagefeathers.utils.touch
Classpublic class TapToEvent
InheritanceTapToEvent Inheritance Object
Subclasses TapToTrigger

Product Version : Feathers 3.4.0

Dispatches an event from the target when the target is tapped/clicked. Conveniently handles all TouchEvent listeners automatically.

In the following example, a custom item renderer will be triggered when tapped:

public class CustomItemRenderer extends LayoutGroupListItemRenderer
{
    public function CustomItemRenderer()
    {
        super();
        this._tapToEvent = new TapToEvent(this, Event.TRIGGERED);
    }
    
    private var _tapToEvent:TapToEvent;
}

See also

feathers.utils.touch.TapToTrigger
feathers.utils.touch.TapToSelect
feathers.utils.touch.LongPress


Public Properties
 PropertyDefined By
  customHitTest : Function
In addition to a normal call to hitTest(), a custom function may impose additional rules that determine if the target should be dispatch an event.
TapToEvent
  eventType : String
The event type that will be dispatched when tapped.
TapToEvent
  isEnabled : Boolean
May be set to false to disable the event dispatching temporarily until set back to true.
TapToEvent
  tapCount : int
The number of times a component must be tapped before the event will be dispatched.
TapToEvent
  target : DisplayObject
The target component that should dispatch the eventType when tapped.
TapToEvent
Public Methods
 MethodDefined By
  
TapToEvent(target:DisplayObject = null, eventType:String = null)
Constructor.
TapToEvent
Property Detail
customHitTestproperty
customHitTest:Function

In addition to a normal call to hitTest(), a custom function may impose additional rules that determine if the target should be dispatch an event. Called on TouchPhase.BEGAN.

The function must have the following signature:

function(localPosition:Point):Boolean;

The function should return true if the target should dispatch an event, and false if it should not dispatch.


Implementation
    public function get customHitTest():Function
    public function set customHitTest(value:Function):void
eventTypeproperty 
eventType:String

The event type that will be dispatched when tapped.


Implementation
    public function get eventType():String
    public function set eventType(value:String):void
isEnabledproperty 
isEnabled:Boolean

May be set to false to disable the event dispatching temporarily until set back to true.


Implementation
    public function get isEnabled():Boolean
    public function set isEnabled(value:Boolean):void
tapCountproperty 
tapCount:int

The number of times a component must be tapped before the event will be dispatched. If the value of tapCount is -1, the event will be dispatched for every tap.


Implementation
    public function get tapCount():int
    public function set tapCount(value:int):void
targetproperty 
target:DisplayObject

The target component that should dispatch the eventType when tapped.


Implementation
    public function get target():DisplayObject
    public function set target(value:DisplayObject):void
Constructor Detail
TapToEvent()Constructor
public function TapToEvent(target:DisplayObject = null, eventType:String = null)

Constructor.

Parameters
target:DisplayObject (default = null)
 
eventType:String (default = null)