|
Post by runes on Jul 4, 2013 11:13:51 GMT
Is there an easy way to make function calls to the timeline in a Hippo export? For instance can I implement my animation in an iframe and call "GotoAndPlay(10);" from my main site?
|
|
|
Post by Hippani on Jul 4, 2013 12:40:11 GMT
I think somebody asked this before. I think it's possible, first you have to make sure any functions you want to call are included in the export even if they are never called, so GotoAndPlay function needs to be somewhere.
Then note that the movie runs within a further iframe with id="Movie", so iframe within an iframe.
Something like this maybe, you might need to test it.
var iframe = document.getElementById("iframeId"); var Movieiframe = iframe.contentWindow.getElementById("Movie"); Movieiframe.contentWindow.GotoAndPlay(10);
|
|
|
Post by Hippani on Jul 4, 2013 12:41:30 GMT
It might be contentDocument rather than contentWindow, I'm not sure.
|
|
|
Post by runes on Jul 16, 2013 19:36:10 GMT
Well this is interesting. I usually work with Construct 2 from Scirra.com. If you don't know it, try it. It really is quite brilliant. But it has no features whatsoever to make timeline animations. So I figured if I could get Hippo Animator and Construct 2, to work together I'd have the coolest developer tools in the world. And whaddaya know. It works!
If I add an iFrame with my Hippo animation into Construct 2 and use the following jsCall: "document.getElementById('my_iframe').contentWindow.Movie.PlayClip(start,end);" I can play any part of the animation I wish.
I really think that is awesome.
It works flawlessly in Chrome, IE and IOS Browser. For some reason it's not working in Firefox. It might be an error in the iframe plugin for Construct 2, but if anyone have any idea as to why, please give me a hint:)
|
|
|
Post by Hippani on Jul 17, 2013 5:02:58 GMT
I'll get someone to look into it. Firefox is a pain for compatibility.
|
|
|
Post by Hippani on Jul 17, 2013 8:49:00 GMT
OK this is how to do this (looks like there is some missing features in firefox so this is a workaround).
document.getElementById('my_iframe').contentWindow.frames[0].PlayClip(start,end);
Some browsers like chrome require the web pages to be on localhost or a server for this to work. You must include the PlayClip function or even just the text in the movie somewhere.
This works... In general script add the comment:
//PlayClip
The HTML export will spot the function name and include it in the HTML.
|
|
|
Post by runes on Oct 31, 2013 20:05:37 GMT
This has worked great for me. But since version 3 of Hippo, The features I used in Construct 2 has been added. So I have a strong desire to get Construct 2 out of my production and do everything in Hippo.
But I can't really get this to work.
Could you make a short tutorial on how to control a hippo animation in a webpage-object within another hippo animation?
|
|
|
Post by Hippani on Oct 31, 2013 20:24:07 GMT
So hippo animation within a hippo animation. Now that's tricky. I'll look into it.
|
|
|
Post by runes on Nov 12, 2013 8:43:56 GMT
Any news on this? Not possible?
|
|
|
Post by Hippani on Nov 12, 2013 9:32:19 GMT
Ah we did look into it, it's very tricky and got blocked by a lot of browsers due to security issues. I'll see if I can get an update for you.
|
|
|
Post by runes on Nov 12, 2013 9:38:30 GMT
Thumbs up
|
|
|
Post by Hippani on Nov 12, 2013 10:06:25 GMT
OK, download the latest version and look for a function called "PageExecute". It's not the greatest most powerful thing but you should be able to run some basic functions in a web page object. The page has to be the same domain as the page calling the function or it will get blocked by browser security. There may be a way to get your server to allow cross domain scripting if you need it, but i'm not sure how.
|
|
|
Post by runes on Nov 12, 2013 13:00:27 GMT
This is exactly what I was looking for. Confirmed working
|
|