How to Make Classes


#1

Is there a way to create JS functions in Tumult without them being directly called by some user action? (i.e. that are called by other functions instead)

At the moment I’m specifically interested in making my own classes/constructors. Is this possible in Tumult?


(Mark Hunte) #2

use a normal hype function to construct it and access it using the hypeDocument.functions(). API

Plenty of examples on site showithe API


#3

How do I create a normal hype function that is not tied to a specific action? The only way I have found to make java script functions is by using the ‘actions’ for clicking a button, scrolling, etc. Is there a way to make a function outside of this?


(Mark Hunte) #4

Open the Resource Inspector, click the + button

37


But even if you did it the hard way as you detail. You can still late remove the action but keep the function.

The ability to create and call a function from within the action selection is just a convenience .


(Jonathan Deutsch) #5

Note that you can also add a <script> tag to the head HTML (accessible in the Document Inspector) or drag in .js files that contain functions. In these cases, you do not need to access via the hypeDocument.functions() call since they would be global.


#6

Is there a way to change the function’s parameters?


(Mark Hunte) #7

Do you mean like this