Events
Overview
In simple terms, Events are the "brains" or the "logic" of your experiment. They are the rules you set up that tell your study what to do and when to do it.
Think of them as simple "If-Then" statements or cause-and-effect rules that bring your experiment to life.
- IF this happens... (This is the Trigger)
- THEN do that. (This is the Action)
Every interactive element, every piece of dynamic timing, and every conditional change in your Labvanced study is controlled by an Event.
The Two Core Components of an Event
When you create an event in Labvanced, you will always work with these two parts:
1. Trigger (The "When")
The Trigger is the specific condition that causes the event to fire. Think of it as a 'listener' that is being sought out. The trigger is like the "cause" in a cause-and-effect relationship.
For a full list of available Triggers, see here.
Common Triggers include:
- User Input Triggers:
Mouse Move,On Key Press,Joystick. - Physiological Signal Triggers:
Eye Tracking Gaze(e.g., for when looking at a particular image),Head Tracking - Trial and Frame Triggers:
On Trial Start,On Frame Start. - Variable Change:
Variable (Value Change)(e.g., when the 'score' variable increases). - Media Object Triggers:
Playback Started,Playback Ended.
2. Action (The "What")
The Action is what the experiment actually does once the Trigger has occurred. It's the "effect" and subsequent outcome for when a specific trigger has occured.
For a full list of available Actions, see here.
Common Actions include:
- Jump Actions:
Jump to Frame,Jump to Next Trial. - Object Actions:
Set Object Property(e.g., make an image invisible) - Variable Actions:
Set/Record Variable(e.g., add 1 to the 'score', specify a reaction time recording) - API Actions:
Send to WebSocket,Send to OpenAI.
Practical Examples of Events
Here are some common scenarios in psychology experiments and how they are built with Events:
Scenario 1: Clicking a "Next" button to proceed.
- Trigger:
On Mouse Click(on the button object) - Action:
Jump to Next Frame
Scenario 2: A simple Reaction Time Task (press 'J' when you see a circle).
- Trigger:
On Key Press - Action 1:
Set/Record Variable(Variable for recording the keypress ) - Action 2:
Set/Record Variable(Variable for time since Frame Start (for example), for reaction time ) - Action 3:
Jump to Next Trial
You can have multiple actions for one trigger.
Scenario 3: Showing text for exactly 500ms.
- Event 1:
- Trigger:
On Frame Start - Action:
Control Actionspecifically theDelayed Actionoption set to 500ms, specify Action Sequence toSet Object Propertyof the text object to have aVisibilityproperty of0.
- Trigger:
Why are Events So Important?
Without events, a Labvanced study would just be static . Events are what make your experiment:
- Interactive: They allow the study to respond to participant actions.
- Dynamic: The flow of the experiment can change based on performance (e.g., in adaptive tasks).
- Precisely Timed: They give you millisecond-level control over when stimuli appear and disappear.
- Data-Rich: They are the mechanism for recording critical data points like reaction times, choices, and accuracy at the exact moment they occur.
In summary, Events are the building blocks you use to program the entire logic and flow of your experiment in Labvanced's visual, no-code interface. Mastering them is the key to creating sophisticated and professional studies for both online and in-lab experiments and psychology research.
Helpful Pages