Package | feathers.utils.touch |
Class | public class TapToEvent |
Inheritance | TapToEvent Object |
Subclasses | TapToTrigger |
Product Version : | Feathers 3.4.0 |
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
Property | Defined 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 |
Method | Defined By | ||
---|---|---|---|
TapToEvent(target:DisplayObject = null, eventType:String = null)
Constructor. | TapToEvent |
customHitTest | property |
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.
public function get customHitTest():Function
public function set customHitTest(value:Function):void
eventType | property |
eventType:String
The event type that will be dispatched when tapped.
public function get eventType():String
public function set eventType(value:String):void
isEnabled | property |
isEnabled:Boolean
May be set to false
to disable the event dispatching
temporarily until set back to true
.
public function get isEnabled():Boolean
public function set isEnabled(value:Boolean):void
tapCount | property |
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.
public function get tapCount():int
public function set tapCount(value:int):void
target | property |
target:DisplayObject
The target component that should dispatch the eventType
when tapped.
public function get target():DisplayObject
public function set target(value:DisplayObject):void
TapToEvent | () | Constructor |
public function TapToEvent(target:DisplayObject = null, eventType:String = null)
Constructor.
Parameterstarget:DisplayObject (default = null )
| |
eventType:String (default = null )
|