Thanks to this forum and the extremely helpful people around here I’m able to swap and control a widget from outside that widget.
If you look at the attached sample and open the ‘control_parent_through_iframe_widget_01.html’ file in a browser you can see just that. control_parent.zip (1.0 MB)
Button 1 and 2 load one of the included “test.html” files. And with a second click the timeline inside those “test” files (loaded widget) reactivates so they nicely fade out and the user can choose a new button to click without having a “pats-boom” transition.
The third button shows my problem. I need to remove the button bar that controls the widgets to get a full view of this particular widget scene, but would like to have the button bar reappear after the user clicks a button in the widget.
Is there something similar on these forums that helps me figure out how to control the ‘parent’ from within the childs iFrame? I looked but it’s, as far as I can see the other way around .
Your text in this button states that it should start a timeline in the Parent. It does not appear to do anything else. Is there a reason why this button needs to be inside the widget?
@JimScott Hi Jim The reason I think I need this button inside the widget is because of the user-flow. User clicks a button in the “button-gallery”, which subsequently moves off screen, while the widget takes the front stage.
It seems more ‘natural’ to me to have a user (or timeline) action inside the widget to get the “button-gallery” back up from there then to have an ‘slide-up/slide-down’ button-gallery function on the parent. I can’t see an other way around this. Is there something I missed?
@MarkHunte I just wish there was a cafe around the corner where we all could meet and I could treat you all on a crate of beer or soda, or whatever your poison is.
I can’t thank you enough for this. But thank you, thank you!
Placing the "Close" button (as used in this example) inside the widget takes more code to be functional. It seems so straightforward to place it in the main Hype project... which requires just a timeline in the project. The actual interface & scripting could of course follow the dictates of your particular needs.
Sorry took me a while to reply, I was buried in Hype.
This, your approach, would normally work and one I’d use.
But in this case I’m (trying to) tell a story (under each button a different one) over a few scenes with totally different environments, like under “button 3” we have a hatch, the room behind that hatch, a computer screen with data inside that room behind that hatch, which leads into a space scene with an escape pod bursting away diving into a planets atmosphere.
Having a ‘close’ button just hanging there all the time over the scenes is a bit jarring and gives the user an option to escape my story before it’s finished, which is an option I don’t want to give the user until I’m done telling my story.
You see, in “my” movie theater everybody gets strapped down in their chair and aren’t released until the end credits have rolled.
Still thank you for thinking along. Very much appreciated!
The “close” button does not have to be “just hanging there” - that was a demo without a clear idea of what You were doing. It could be scripted to show up at the time desired - unless there is specific user interaction in the Widget that terminates~alters the timing - in that case “postMessage” is definitely the way to go!
In any event best wishes for your production - and maybe we’ll get to see it" (strapped down or not )