Post your Hype code snippets here in the following format:
Button To Text
function buttonToText(hypeDocument,element,event){
var name = element.innerHTML;
if (name){
hypeDocument.getElementById('text').innerHTML = name;
hypeDocument.startTimelineNamed('Main Timeline');}
}
Description
This code sets an element with the id of text to the text of the button/element that calls this function and additionally plays a timeline.
Good Idea. However, may I suggest a “use case scenario”. RE your example, I’m not sure how helpful it would be. Also a bit more info on “plug and play”. You have supplied a document, export and template. Maybe a little overkill. I would suggest maybe packaging up in a symbol that way when added to a project it would inject the functions into it on import.
P.S I’ll delete this post once looked at so as not to cloud the topic.
Yes. The first example was a bit much. The second is only the hype document. Good idea with the symbol too. Use case can be added under the description section.