Control a timeline in the parent of a widget?

have a look at this post

Either mine or jonathans should solve this.

Example of postMessage with yours.

Would be add this to the head of control_parent_through_iframe_widget_01

	    <script type="text/javascript"> function myCallback(hypeDocument, element, event){ 
 
    window.addEventListener('message', function(theEvent) {
    if(theEvent.data[0] !== 'reload'){
    return;
    };
        hypeDocument.startTimelineNamed('Main Timeline')
        
       hypeDocument.goToTimeInTimelineNamed(0, '1stbttn_blocker')
     	hypeDocument.goToTimeInTimelineNamed(0, '2ndbttn_blocker') 
     	hypeDocument.goToTimeInTimelineNamed(0, '3thbttn_blocker') 
     	
     	hypeDocument.goToTimeInTimelineNamed(0, '1st_bttn')
     	hypeDocument.goToTimeInTimelineNamed(0, '2nd_bttn') 
     	hypeDocument.goToTimeInTimelineNamed(0, '3th_bttn') 
     	
     	var  htmlWidget = hypeDocument.getElementById("mainFrame").children[0];
	  	htmlWidget.setAttribute("src", "");
        
    }, false);
  
  
  } 

if("HYPE_eventListeners" in window === false) {
window.HYPE_eventListeners = Array();
}


window.HYPE_eventListeners.push({"type":"HypeDocumentLoad", "callback":myCallback});
</script> 

And this as a new function when the button is clicked in each button widget. (test1,test2,test3)

window.parent.postMessage(['reload'], '*');

2 Likes