Triggers
Updated over a week ago

Triggers are events that cause an action to fire. Together, triggers and actions create interactions in Play.

There are two types of triggers: instant and continuous. Instant triggers fire their actions once, immediately. Continuous triggers will fire their actions continuously as a user pans, drags, or scrolls - up to sixty times per second. The actions will interpolate the property's value based on the distance/length of the gesture.

Below are Play’s triggers and the circumstances that will cause each trigger to fire.

Tap

A Tap trigger fires when the user taps an object.

Toggle Tap

A Toggle Tap trigger fires one set of actions when the user first taps an object, and another set of actions when the user taps the object a second time.

Multi Tap

A Multi Tap trigger fires when the user taps an object more than once, with one or more fingers.

  • Number of Taps: Choose between a single or double tap (Ex. event triggers when a user taps an object X number of times)

  • Tap With: Select up to five fingers (Ex. event triggers when a user taps an object with X number of fingers)

Touch Up & Touch Down

Touch Down and Touch Up triggers fire when the user’s finger first touches an object (touch down) or when a user removes their finger from the object (touch up).

Scroll Started

A Scroll Starter trigger fires when the user begins scrolling an object with scrollable content.

  • Direction: Select the scroll direction (Ex. event triggers when a user begins scrolling right)

While Scrolling

A While Scrolling trigger fires continuously as the user scrolls an object with scrollable content from one position to another.

  • Direction: Choose to register a vertical or horizontal scroll (Ex. event triggers when a user scrolls horizontally)

  • Unit: Choose between points or percentages

  • From Position & To Position: Enter the scrolled values for the beginning and end of the trigger’s firing range (Ex. event begins being triggered at position X and finishes triggering at position Y)

Scroll Ended

A Scroll Ended trigger fires when the user finishes scrolling an object with scrollable content and lifts their finger.

  • Direction: Select the scroll direction (Ex. event triggers when user begins scrolling right)

  • Trigger On Stop: Choose if the trigger should fire when the scroll comes to a stop instead of when the user lifts their finger.

Scrolled To

A Scrolled To trigger fires when an object’s scrollable content has been scrolled to a selected range.

  • Direction: Choose to register a vertical or horizontal scroll (Ex. event triggers when a user scrolls horizontally)

  • Unit: Choose between points or percentages

  • From Position & To Position: Enter the scrolled values for the beginning and end of the trigger’s firing range (Ex. event triggers when a user scrolls through range X-Y. Event triggers at position X when a user scrolls down, and event triggers at position Y when a user scrolls up)

  • Trigger Once: Choose if the trigger should fire once or every time a user scrolls within the range

Pan Started

A Pan Started trigger fires when the user begins panning on an object.

  • Edge Pan: Turn the edge pan on or off. When the edge pan is enabled, a new property will appear allowing you to select the edge to begin the pan (Ex. event triggers when a user begins their pan at the edge of the screen)

  • Pan Direction: Choose the pan direction that will trigger the event; options are left, right, down, up, or any (Ex. event triggers when a user begins panning towards the right)

While Panning

A While Panning trigger fires while the user pans their finger across an object.

  • Edge Pan: Turn the edge pan property on or off (Ex. event triggers as a user pans from the edge of the screen)

  • Pan Direction: Choose the pan direction that will trigger the event; options are left, right, down, up, or any direction (Ex. event triggers as a user pans towards the right)

  • Pan Boundary: Choose from the selected object (self), the parent, the screen, a custom boundary in points, or none for the pan boundary (Ex. event triggers while the user is panning the length of the selected object)

  • Optimize for Dragging: Turn the optimize for dragging property on or off. If it is on, the object will follow the user’s finger instead of auto-finishing

Pan Ended

A Pan Ended trigger fires after the user stops panning on an object and lifts their finger.

  • Edge Pan: Turn the edge pan on or off. When the edge pan is enabled, a new property will appear allowing you to select the edge to begin the pan (Ex. event triggers when a user lifts their finger after beginning their pan at the edge of the screen)

  • Pan Direction: Choose the pan direction that will trigger the event; options are left, right, down, up, or any (Ex. event triggers when a user lifts their finger after beginning to pan towards the right)

Pan To

A Pan To trigger fires when the user pans their finger to or away from a selected region.

  • Follow Touch: Turn the Follow Touch property on or off. If it is on, the object will follow the user’s finger

  • Type: Choose the type of Pan To trigger (right now, the only type is Parent Boundary)

  • Direction: Choose to register a vertical or horizontal pan (Ex. event triggers when a user pans horizontally)

  • Unit: Choose between points or percentages

  • Min & Max: Enter the values for the max and min positions where the trigger will fire (Ex. event triggers when a user enters (or exits) the range X-Y. Event triggers when a user passes position X when panning right, and event triggers when a user passes position Y when panning left)

  • Trigger When: Choose if the event should trigger when the user enters the range, exits the range, or releases their finger within the range (Ex. event triggers when a user pans into the specified range and lifts their finger)

  • Trigger Once: Choose if the trigger should fire once or every time a user pans within the range

Long Press

A Long Press trigger fires when the user presses an object for an extended time.

  • Duration: Set the duration of the long press before it triggers; by default, the duration is 0.5 seconds (Ex. event triggers when a user presses an object for X number of seconds)

Page Enter & Page Exit

Page Enter and Page Exit triggers fire when the user opens/navigates to a page (enter) or closes/navigates from a page (exit). These triggers can only be applied at the page level.

  • Delay: Set the number of seconds that the trigger should wait before firing (Ex. action will occur X seconds after the trigger fires)

  • Trigger Once: Choose if the trigger should only fire the first time a user enters the specific page or every time

Gyroscope

A Gyroscope trigger fires continuously when a user tilts their phone along an axis of rotation.

  • Axis: Choose the axis of rotation that will trigger the gyroscope; options are X, Y, Z, or any axis (Ex. event triggers as a user tilts their phone to the left and right along the Z axis)

  • Min & Max: Enter the max and min rotation values that the trigger will fire (Ex. event triggers as a user tilts/rotates their phone across the range between the min and max values)

  • Offset: Offset the starting orientation. An offset of "0, 0, 0" is equal to placing a device on a flat surface. You can only edit the offset of the chosen axis of rotation.

Event Listener

An Event Listener trigger listens for an event to occur, then fires.

  • Trigger When: Select the event that the trigger should listen for; you can also create a new event

  • Trigger Only Once: Choose if the trigger should fire once or every time the event occurs

Native Element Triggers

Some native elements have their own triggers that take advantage of that native element's functionality.

Map

Pin Is Selected

A Pin Is Selected trigger fires when the user selects a pin on the map.

  • Pin: Choose if the trigger should fire when any pin is selected or when a specific pin is selected (Ex. event triggers when the user selects pin #1)

Pin Is Unselected

A Pin Is Unselected trigger fires when the user unselects a pin on the map, either by selecting a different pin or another object on the screen.

Switch

Switched On

A Switched On trigger fires when the user toggles the switch into the on position.

Switched Off

A Switched On trigger fires when the user toggles the switch into the off position.

Stepper

Value Changes

A Value Changes trigger fires when the user changes the stepper value.

  • Value: Choose if the trigger should fire when the value increases, decreases, or has any change (Ex. event triggers when the user taps the + side of the stepper)

Text Field

Focus Begins

A Focus Begins trigger fires when the user opens a text field and the keyboard appears.

Focus Ends

A Focus Ends trigger fires when the user finishes editing the value in the text field, and the keyboard is dismissed.

Clear Pressed

A Clear Pressed trigger fires when the user taps the X button on the text field to clear the current value.

Segmented Control

Segment Selected

A Segment Selected trigger fires when the user selects a segment other than the one currently selected.

  • Segment: Choose if the trigger fires on any change in the selection or only when a specific segment is selected (Ex. event triggers only when the user taps the third segment)

Slider

Slide Begins

A Slide Begins trigger fires when the user touches the slider knob, even if they do not move it.

Slide Ends

A Slide Ends trigger fires when the user releases the slider knob.

Picker

Value Selected

A Value Selected trigger fires when the user scrolls the picker to any value, even the current selection, and then lifts their finger from the screen.

Date Picker

Date Changes

A Date Changes trigger fires when the user selects any date/time that is different than the current selection.

Did this answer your question?