The iframe object can display another web page, or a string of some HTML content, in your project. It is named after the <iframe> element, which is what the object uses.
This object can also be used to show embedded content, such as YouTube videos. For example if you choose to share a YouTube video and select the "embed" option, it provides some HTML code for an iframe element. The
src attribute is the embed URL for the video, e.g. https://www.youtube.com/embed/pWiC5Ln_0yA. This can be used in the URL property of Construct's iframe object to show the video in your game.
- The URL of a web page to load inside the iframe.
- HTML content
- A string of HTML content to display inside the iframe. This loads the HTML locally and does not request a separate web page. This is only used if the URL property is left empty.
- Initially visible
- Whether the object is initially visible at runtime.
- An optional
- An optional feature policy string to set in the iframe's
allow attribute, which specifies what the displayed page is allowed to do. The default is designed to allow embedded video playback on services like YouTube, granting the video permission to enter fullscreen, autoplay, and use encrypted media.
- Enable sandbox
- Check Enable sandbox to add the
sandbox attribute on the iframe element, providing enhanced security. The Sandbox property is then the string to use in the
The iframe object does not have any of its own conditions. See common conditions for features shared between form control objects.
See common actions for features shared between form control objects.
- Display HTML string
- Load a string of HTML content in the iframe. This is similar to using the HTML content property. If the iframe was previously displaying a URL, it will switch to the HTML content instead.
- Navigate to URL
- Load a new URL in the iframe. If the iframe was previously displaying a string of HTML, it will switch to loading this URL instead.
The iframe object does not have any of its own expressions.