Action to switch interface on/off depending on the starting state

  • Hi,

    I'm trying to make an action to switch on/off the whole interface. The problem is that some elements of the interface (only "banner", in this case) can already be either on or off and I want to keep them in an "off" state when switching everything on/off or to switch them on/off along with all the elements when they start in an "on" state.
    "nadirlogo", "panobar", "controlbar" are not a problem because they all start in the same state, that is "visible,true".

    Is this possible?
    So I started from here but obviously it's only partially working:

    Code
    <plugin name="switch" keep="true" zorder="1" align="bottomleft" x="20"  y="20" style="options"  crop=  "0|0|20|20" onovercrop=  "0|20|20|20" ondowncrop=  "0|40|20|20" onhover="showtext(get(Switch));" onclick="action(switchoff);" />

    Regards,
    Marco

  • I already tried using the IF statements but wasn't successful because the problem is not "whether the plugin is already visible or not", rather "whether the plugin was already visible or not" before changing the state.

    I mean, if the banner plugin starts in "off" state, I don't want it to turn on/off when switching all the elements already "on". I just want to keep it "off" in this case.
    While, if the banner plugin starts in "on" state, I want it to turn on/off along with all the elements.

    And, when I say starts in "on" or "off" state it is not necessarily after loading the pano for the first time.

    Is this possible?
    *confused*
    Regards,
    Marco

  • Hi,

    you could add any custom attributes to the <plugin> tags and then check for them or change them as you want,

    e.g. here a custom attribute "state":

    Code
    <plugin ... state="on" ... />
    ...
    if(plugin[...].state == on, set(plugin[...].state,off); ... );

    best regards,
    Klaus

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!