Send Message to Iframes
What it does
Sends one plain-text message from a task to every iframe overlay that is currently open. Configure the sender in Interactive Studio; the webpage inside each iframe must already be prepared to receive and use the message.
Use it to update an open overlay with the current player's name, a score, or another value from the space.
Before you start
- Open the target overlay with Iframe before this effect runs.
- This effect broadcasts to all active iframe overlays. It cannot select one by URL or name.
- Keep the message format predictable so the embedded page can interpret it.
Setup
- Add Send Message to Iframes to the task state that should send the update.
- Enter the text in the Message field.
- Put a supported placeholder in the message anywhere you want Portals to insert a current value.
- Test with an iframe already open and with the task transition that sends the message.
Message placeholders
Keep the vertical bars around a placeholder exactly as shown:
|username|inserts the current player's displayed name. Portals wraps that name in quotes in the sent message.|value-label|inserts the current numeric or string value whose label isvalue-label.|player-value-label|inserts the currently available player names and values for that player-specific label.
For example, Welcome, |username|! You have |gems| gems. becomes a greeting with the active player's name and the current gems value. Label spelling must match the value label in your space exactly.
If Portals cannot find a label, it leaves that placeholder unchanged. That makes a label mismatch easy to spot while testing.
Tiny example
A player collects a gem, which updates the gems value. The same task sends Gems: |gems| to an already-open progress overlay.
Test and troubleshoot
- Open the iframe first. No message is sent to an overlay that is not active.
- Match a value label exactly, including capitalization and spaces.
- Start with a plain message, then add one placeholder at a time.
- This page covers the no-code sender. Set up the receiving behavior in the embedded page separately.
