Complete the code to create a simple interaction that navigates to the next frame on click.
figma.currentPage.selection[0].onClick = () => [1];
The correct method to navigate to the next frame on click is figma.goToNextFrame().
Complete the code to add a hover interaction that changes the opacity of a selected object.
figma.currentPage.selection[0].onHover = () => { figma.currentPage.selection[0].opacity = [1]; };
Opacity values must be between 0 and 1. Setting it to 0.5 makes the object semi-transparent on hover.
Fix the error in the code to correctly trigger a complex interaction sequence on click.
figma.currentPage.selection[0].onClick = async () => { await [1](); figma.notify('Interaction complete'); };
The correct function to run the complex interaction flow is runComplexFlow(), which is asynchronous and returns a promise.
Fill both blanks to set up an advanced interaction that triggers on drag and updates the position.
figma.currentPage.selection[0].on[1] = (event) => { figma.currentPage.selection[0].[2] = event.position; };
The interaction event is onDrag and the property to update is position to reflect the new location.
Fill all three blanks to create a conditional interaction that triggers only if the selected object is visible and enabled.
if (figma.currentPage.selection[0].[1] && figma.currentPage.selection[0].[2]) { figma.currentPage.selection[0].onClick = () => [3]; }
The code checks if the object is visible and enabled, then assigns the startInteraction() function to the click event.