rocis
New Member
Posts: 16
|
Post by rocis on Jun 6, 2017 17:06:44 GMT
Hi
I need to open the Hippo page from two different normal html pages. Based on which page is calling the Hippo page, I need to jump to a certain timeline frame.
Example: I have an html page named sun.html, another page named moon.html and a page home.html containing the Hippo project: - Pressing a button in page sun.html I need to open home.html and soon jump to frame 50 in the Hippo timeline. - Pressing a button in page moon.html I need to open the same home.html but to jump to frame 100 in the Hippo timeline.
I guess I have to use in the button a code like "<a href="home.html & desiredFrame = 50">FRAME 50</a>" adding a variable with its value (desiredFrame = 50) after the link "home.html".
Please is this the right mode to send the command to Hippo? How can I get this value within Hippo?
Thank you, best regards!
Rocis
|
|
|
Post by Hippani on Jun 6, 2017 20:01:28 GMT
I suggest you look at the query string options.
<a href="home.html?desiredFrame=50">FRAME 50</a>
Then in general you could add:
var desiredFrame=GetQueryString("desiredFrame"); if(desiredFrame&&desiredFrame.length>0){ GotoAndStop(parseInt(desiredFrame)); }
|
|
rocis
New Member
Posts: 16
|
Post by rocis on Jun 7, 2017 8:55:20 GMT
Hi Thank you!! I tested your nice code and it work perfectly. Now I have one more problem. My Hippo project is contained in an html page. For example let's say it is like your "TestPage.html" Obviously, if I call the "TestPage.html" using my usual link "TestPage.html?desiredFrame=50", I can no longer read in hippo the variable I sent. Probably I should have a small javascript in the "TestPage.html" page that read the variable received and then "repeat" it to the Hippo project contained therein. Please how can I do? I've been looking for solutions on StackOverflow, but I've found some cumbersome scripts based on "window.location.search.substr(1)" that I can not handle Thank you, best regards! Rocis
|
|