I’d like to use setVisibility on certain icons, but know absolutely Nothing about scripting. Can anyone help?

I’d like to use setVisibility on certain icons, but know absolutely Nothing about scripting. Can anyone help?

]]>

13 Commentsto I’d like to use setVisibility on certain icons, but know absolutely Nothing about scripting. Can anyone help?

  1. Anonymous says:

    < ![CDATA[

    If you want to set the visibility/transparency of an item staticly, there’s no need for scripting. Just long-tap, “Customize Item”, “More…”, “+” tab, change value of “Transparency”.

    ]]>

  2. Anonymous says:

    < ![CDATA[

    Just explain what is you are looking to obtain.


    Is it as simple as swipe to hide/show? Something more complex?

    ]]>

  3. Anonymous says:

    < ![CDATA[

    Swipe or tap to hide/show.

    ]]>

  4. Anonymous says:

    < ![CDATA[

    If you want to swipe or to tap an item to hide another you need to know the label of the item you want to hide. Say you want to hide/show an item named Silvia using swipe in the same container/desktop.


    Set a swipe event to Run a script and copy this into the script editor:



    var itemLabel = “Silvia”;


    // getting item from container


    var e = LL.getEvent().getContainer().getItemByLabel(itemLabel);


    if (!e)


    e = LL.getCurrentDesktop().getItemByLabel(itemLabel);


    // toggle visibility


    if ( e.isVisible() )


    e.setVisibility(false);


    else


    e.setVisibility(true);



    Now close the script editor and try it out.


    If item Silvia is in a different desktop or container then you need to know the name or ID of the container, and replace the code after // getting item from container with something else.

    ]]>

  5. Anonymous says:

    < ![CDATA[

    I get a reference error itemName is not defined.

    ]]>

  6. Anonymous says:

    < ![CDATA[

    Sorry, replace itemName with itemLabel


    Updated my previous post to repair my mistake.

    ]]>

  7. Anonymous says:

    < ![CDATA[

    Yay! Thank you!

    ]]>

  8. Anonymous says:

    < ![CDATA[

    Ok, now what if I want to toggle show one while hiding another?

    ]]>

  9. Anonymous says:

    < ![CDATA[

    var item1 = “Silvia”;


    var item2 = “TBog”;



    function _getItem(name)


    {


    var e = LL.getEvent().getContainer().getItemByLabel(name);


    if (!e)


    e = LL.getCurrentDesktop().getItemByLabel(name);


    return e;


    }



    var e1 = _getItem(item1);


    var e2 = _getItem(item2);


    if ( e1.isVisible() )


    {


    e1.setVisibility(false);


    e2.setVisibility(true);


    }


    else


    {


    e1.setVisibility(true);


    e2.setVisibility(false);


    }

    ]]>

  10. Anonymous says:

    < ![CDATA[

    Thank you very very much!

    ]]>

  11. Anonymous says:

    < ![CDATA[

    Ok, now since the update I’m having a problem with the second one. It comes back with cannot call method isvisible for null.?

    ]]>

  12. Anonymous says:

    < ![CDATA[

    What type of item is item2? Has the name changed? I don’t see what Pierre Hébert could have changed.

    ]]>

  13. Anonymous says:

    < ![CDATA[

    Lol, nm. I had one of my names wrong. I had blueapps and it should’ve been blueapps2. 😉

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *