Skip to main content
Inspiring
December 16, 2024
Question

components video --> visible.true button works, visible.false button doesn't?

  • December 16, 2024
  • 2 replies
  • 273 views

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;
}

    This topic has been closed for replies.

    2 replies

    Inspiring
    December 16, 2024

    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.

    kglad
    Community Expert
    Community Expert
    December 17, 2024

    if you're happy with the results, leave it.

    kglad
    Community Expert
    Community Expert
    December 16, 2024

     $("#video").css('visibility','hidden');  

    Inspiring
    December 16, 2024

    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?