Copy link to clipboard
Copied
Hi guys, trying to create 2 simple buttons to make a components video visible or not visible. The visible button works but once the video is visible, my button to make it invisible is not working ? Anyone have experience with this?
Site:
https://cryptomemes.fun/vidTrial/
Code :
this.vidTrial.visible=false;
this.visible.addEventListener("click", makeVIS.bind(this));
function makeVIS()
{
this.vidTrial.visible=true;
}
this.invisible.addEventListener("click", makeINVIS.bind(this));
function makeINVIS()
{
this.vidTrial.visible=false;
}
Copy link to clipboard
Copied
$("#video").css('visibility','hidden');
Copy link to clipboard
Copied
Thanks for the reply. I took what little you said there and tried to make something of it.
I found this video - https://www.youtube.com/watch?v=CxTo1RUdJYM
So I dragged a CSS component to the desktop, named it, created a CSS file and attached it to the CSS component.
I then pasted the code you gave me into the CSS file, after changing the name to my movie component instance name.
But, I have no idea how to run that CSS code when I press my button?
Copy link to clipboard
Copied
Before I saw kglad's response, I found a work around. I made an invisible movie clip, put the movie player component inside this invisible clip on frame 1 and called it's instance name with the buttons. Movie player appears and disappears perfectly. I want to wait a bit to see if this is the best way.
Copy link to clipboard
Copied
if you're happy with the results, leave it.