Complete the code to start the prototype presentation from the current frame.
figma.showUI(__html__);
figma.ui.postMessage({ type: '[1]' });The message type start-prototype tells Figma to begin the prototype presentation from the current frame.
Complete the code to exit the prototype presentation mode.
figma.notify('[1]'); figma.closePlugin();
The notification Prototype ended informs the user that the prototype presentation mode has been exited.
Fix the error in the code to correctly toggle the prototype presentation mode.
if (figma.currentPage.selection.length > 0) { figma.showUI(__html__); figma.ui.postMessage({ type: '[1]' }); } else { figma.notify('Select a frame to start prototype'); }
The correct message type to start the prototype is start-prototype. Using 'toggle-prototype' or others will cause errors.
Fill both blanks to send a message that navigates to the next frame in prototype mode and notifies the user.
figma.ui.postMessage({ type: '[1]' });
figma.notify('[2]');The message type next-frame moves the prototype to the next frame, and the notification Navigated to next frame informs the user.
Fill all three blanks to create a function that starts the prototype, waits 2 seconds, then notifies the user.
async function startPrototype() {
figma.showUI(__html__);
figma.ui.postMessage({ type: '[1]' });
await new Promise(resolve => setTimeout(resolve, [2]));
figma.notify('[3]');
}The function sends the start-prototype message, waits 2000 milliseconds (2 seconds), then notifies the user with Prototype started.