What function to reveal a button?

Hello

I would like to reveal a button after a certain amount of time. For this I would like to use the Z.after(…) script.

I am a beginner and have no idea how to formulate the functioni, which reveals my button and where to put it.

I added a screenprint of my “show” script. I suppose it has to go in there…?

Please help
Thanks
Jakob

image

You could trigger it from a timeline label?

Add the label in a timeline, drag the label into your script area (like your screenshot) and then place your reveal code within the timeline label script.

(The reveal code could be from a state (under “CONTROLLERS”) that reveals and hides your button)

1 Like

Hope this helps.

Enjoy
Steve

Function After Button Help.zpp (3.3 KB)

2 Likes

Hello

Thanks for the help?
I did something like that:

var display_shown = symbol.controllers.display.elements.shown;
var display_hidden = symbol.controllers.display.elements.hidden;
var Greenscreen_KLeiner_LogoKleiner_Alphakanal_mp4 = symbol.nodes.Greenscreen_KLeiner_LogoKleiner_Alphakanal_mp4;

var UI_Group = symbol.nodes.UI_Group;

function ShowButtonFunction(){
//a function to call
UI_Group.visible(true).enabled(true);
}

parent.on(“show”, () => {

// Make sure we start from fully hidden
display_hidden.reset();

// Move to the shown state
display_shown.activate();


//call the funtion myFunction after 1000ms (1 second)
Z.after(3000, ShowButtonFunction);


// STart the video
Greenscreen_KLeiner_LogoKleiner_Alphakanal_mp4.start();

});

I placed the button function before the “Start the video” command.

The buttons are not revealed…they are visible from the start.

WHat am I doing wrong?

Thanks a lot
Jakob

image

Ok if you can see the button at the start you forgot to change the properties of the UI group.
Click on the UI Group in the Hierarchy and in the properties un check the Visible and Enabled boxes.

Also I’m sure you know in your photo you have an error on one of them you need to fix first.

Steve

Thanks a lot!

1 Like