Plugin with a close button

  • I've made a simple plugin, that needs a close button. But I can't seem to make a call to the plugin itself. I can hide all other plugins/hotspots within the plugin, but can't hide itself.

    The close button:

    The closing function

    Code
    function CloseStill(evt:MouseEvent)
    {
    		//krpano.set("still_helmi.visible,false"); //I tried setting it
    		//krpano.set("plugin[still_helmi].visible, false"); //I've tried to hide the whole plugin
    		krpano.call("action(hideallimages)"); //Ive tried to let Krpano hide it from itself by calling an action that closes it
    
    
    }

    No luck at all. I remember something about a Flash limitation of removing itself, but I could be mistaken. Alsoo Instead of removing it, im hiding it, could this lead to performance issues? And if so, what would be a correct solution?

  • Hi,

    the set visible false code should work,

    but the syntax is a little bit wrong:
    you give the set function only one string as parameter,
    the correct syntax is - set(variablename, value);

    wrong:
    krpano.set("plugin[still_helmi].visible, false");
    correct:
    krpano.set("plugin[still_helmi].visible", false);
    (see the red marked notes)

    if visible of the plugin is set to false and there are not timers running the plugin it shouldn't take any peformance,
    but if you want you can also remove the plugin with a removeplugin call,
    e.g. - call from the plugin itself

    Code
    krpano.call("removeplugin(still_helmi);");


    but note - if the plugin adds elements to the "stage" it must remove it by it's own!

    best regards,
    Klaus

Participate now!

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