Timer to disable button after clicked

Q&A about the latest versions
Post Reply
CKallas
Posts: 14
Joined: Tue Oct 23, 2018 10:45 pm

Hey Everyone,

I tried to do a quick little search but couldn't really find what I was looking for. And once I see code, I freak out and click the X as fast as I can... probably not a good habit right?

But what I am doing is using the skin editor to play a series of animations for almost like a tour of a product. So basically click a button, it plays the animation, then it loads and hides 2 new buttons for "Next" and "Back". I got all of that figured out... basically just using the click command and hiding and hiding videos and buttons. I got it working really well actually, everything goes back and forward and plays the correct animations(transitioning form one part to the next).

But what I am trying to do now is have it so the user can't keep pounding the next button or back button while the animations are playing. I made it somewhat easier by making all of the animations 3 seconds (30 fps if that matters). I tried playing with the timer, but can't find a way to access a timer by mouse click? I could only get the timer to like start right when the first animation loads...

Hope that makes sense, I have a few more questions lined up but need to approach this one at a time... Is it weird that I am using this program, only for the skin and not anything to do with the panos too?

Thanks!
User avatar
Hopki
Gnome
Posts: 13028
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi,
For a Pano2Vr 6 pro project.
If you're using the video element or seek bar for that matter you can do this with variables and action filters.
Example if you add the a variable and give it the name such as "button_lock", make it a true/false variable and set it to false.


All actions can have an action filter that can only be activated if the filter is true.
So in this example the action filter will us ether variable, button lock and false.

The video element can have the action, activate set variable value "button lock" to true.
Then deactivate set variable value to false.

So when the video is playing and the variable is true the buttons will be inactive due to the action filter.
When the video ends the variable will return back to false allowing the buttons to work again.

Regards,
Hopki
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
CKallas
Posts: 14
Joined: Tue Oct 23, 2018 10:45 pm

Alright, I got the trial of V6.

I created the variable for true/false like you said, and set the 2 actions for the video element. But I can't figure out how to get it to disable the button. I understand what is going on, I created a variable and when the video element is active, the value goes to true and when the video element is deactive it sets the value to false.

But what I am missing is telling what that variable actually does (hiding a button). Because it doesnt know what "lock_button" is... So I am guessing that is done with an action on the actual button element. Like deactive if that "lock_button" value is true and activate if that "lock_button" value is false. But I just can't figure out what that is.... Going to keep trying, but hopefully you can steer me in the right direction. I apologize, I am really new to this. I am actually a 3d designer mostly so I am way more visual..
User avatar
Hopki
Gnome
Posts: 13028
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi,
I have attached a simple project.

This does not hide the buttons but deactivates the actions in the buttons while the video is playing.


The project has two nodes.
The skin has the variable: button_lock, True/False, false

It also uses the Next/Previous Silhouette component and the Video Popup Silhouette (File) component.
I have made the video component smaller so you can access the buttons.

In the Next and Previous buttons that have the actions to move to next pano you will see I have added an action filter to the mouse click as denoted by * which shows there is an active filter.

The filter stats that if the variable button_lock = false then the action will work.

The video element popup_video_file, has the actions:
Activate, Set Variable Value Set(=) / true, button_lock)
Deactivate, Set Variable Value Set(=) / false, button_lock)

So what happens is when the video is playing the variable is set to true.
When the variable is true the Next and Previous buttons, action filters, will not allow the action to work until the video has stopped and the variable is false.

If however you simply wanted to hide the buttons then don't worry about the action filters.
Instead in the element button_silhouette_next_previous container set a visible logic block:
*button_lock, =, true, Visible: false

Regards,
Hopki
Attachments
lock_button_with_media.zip
(3.16 MiB) Downloaded 140 times
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
Post Reply