Button that is inside a persistent element to perform an action on a timeline outside of it


(Gustavo) #1

Is it possible for a button that is inside a persistent element to perform an action on a timeline outside of it?

Example:

I have a button that is inside a persistent element and needs it to perform a “continue timeline” action on a timeline outside this element …

Can someone help me?


#2

You can do this with custom behaviors:

  1. Outside of the Symbol (make sure you exit it), create a new Custom Behavior (at the bottom of the Scene Inspector).
  2. Inside of your persistent element (I think you mean persistent symbol?) you can then create a mouse click > Trigger custom behavior action. In the dropdown, select your custom behavior.

The Scene where you originally created your custom behavior needs to be shown. You could also of course create custom behaviors across persistent symbols if you want the action to work on any scene where those two objects are present.


(Gustavo) #3

The problem is that I do not know how to do this custom behaviors … I do not know much about javascript. Are there any examples that I can see?


(Mark Hunte) #4

It is not Javascript.

Follow @Daniel 's instructions.

Select to Add a new Custom Behaviour. Name it and give it the continue timeline…

Scene Inspector

Then in the symbol, give the button a on click action and choose Custom Behaviour. Then either type the name you gave or choose it from the selection.

Inside Symbol Actions Inspector - for button

CustomBehaviourFoo.hype.zip (14.3 KB)

That should be it.


(Gustavo) #5

I’ll try! Thank you!


(Mark Hunte) #6

Added, images and example above…


(Gustavo) #7

All right! Worked perfectly. One more learning. Thank you Daniel and MarkHunte.


#8

an image is worth a thousand words! :smiley: