Actions that trigger other actions?

Actions are things one does with respect to an event.

I am wondering if there is a way to have an action trigger another SPECIFIC EVENT in another specific element.

ex: have the mouse over event for a rectangle specifically force the On Mouse Click event for another (named) element.

Naturally, this sets up the possibility of an infinite loop... so a little dangerous... but potentially useful!

Thank you!

R

It sounds like custom behaviors might help you...

custom-behaviors

Instead of trying to trick the behavior in the web browser, what you're really trying to do is reuse an action. If you link both events... a mouse over on one element is the same as a click on another element... then just a custom behavior for both actions in Hype.

Thank you... I was looking at that earlier, but I didn't come away with the idea that I could do what you are suggesting...

How do you "link" events?

All I see custom behaviors doing is allowing you the same options as you would in a normal action... with no direct access to any other events.

Normally I would think that, for example, On Mouse Down might have an action called Trigger Event... where you would select the element, and then the event of that element, to be triggered.

In other environments, events automatically expose the function that is run (normally nothing). One simply adds code to that event function... which might be calling another function (and also, for this example, direct access to a property)

Public PowerButton.click()
Light1.click
Light2.click
Light3.click
Text1.visible = 0
Image5.opaqe = 0.5
End

I'm looking for the same level of functionality as in the example above.
These aren't shared behaviors (in that they go in both directions... clicking on a light does not fire the PowerButton.click event).

If a Custom Behavior works for your idea, this is how to set it up.

In the Scene pane, create a "Custom" behavior. (In the screenshots, it's called "Custom".)

scene-pane-custom-behavior

If there are two different elements that trigger the same event... such as starting a scene... then just add the "Custom" behavior to the element in the "Actions" pane.

Here's "On Mouse Click"...

action-pane-custom-behavior-on-click

...and here's another element with the "On Mouse Over" action...

action-pane-custom-behavior-mouse-over

A timeline can be used to change the visibility or opacity of elements. (You might need to read up on "Relative" timelines, as to no prevent collisions.)

1 Like

for any logic you'll need custom scripting. custom behaviours can be of some help here as they work as a broadcastingsystem within hype. To understand its power investigate in the documentation a forum search and Event-driven programming as to understand this genral approach.

this has been an idea to bring in some logic without scripting:
https://www2.aachener-zeitung.de/zva/karlo/test/Parental_gate

but in the end it won't be the solution to EVERYTHING, just'll given some basic logic decision possibilities

///////

have you discovered the extension-section in the forum so far? @MaxZieb did a great job here Extension Project - Tumult Forums

2 Likes