How to close a plugin (image) if NOT clicked...

  • Say I click on an image and it opens a floorplan - on the floorplan there are several transparent images that will loadscene if clicked... however, what if the user doesn't want to click on anything inf the floorplan and wants to go back to whatever they were doing before they clicked the floorplan... say they just click on the pano and try to move it again...

    I'd like to close the floorplan and go back to whatever was happening before I ever clicked it in the first place.

    Somewhat of a similar action to when you open the thumbnails - if you open the thumbnails and opt not to click on any, and just try moving the pano, the thumbnails collapse back to their stack...

    Any ideas on how that sort of behavior is accomplished?

  • Thanks for the help! That solution kind of works... but if I just move my mouse off the floorplan it goes away (even with a delayedcall). I was hoping to find a way to open the floorplan, and have the floorplan close only if the user moves the pano... (i.e. opts not to click anything on the floorplan).

  • The main problem is "when the floorplan should be closed" (in which situation). There can be several such situations - and you should support all of them eg.

    1. If user opens floorplan, points any rooom and then move mouse cusor out of flooplan - if you want to hide floorplan in this situation you can do something like this:

    Code
    <plugin name="flooplan" ... onout="set(plugin[floorplan].visible, false)" />

    2. If user clisk panorama after opening floorplan you can hide it by setting global onclick event:


    Code
    <events        ...        onclick="set(plugin[floorplan].visible, false)"       ...
            />


    But maybe you should think of another situation in which floorplan should be close eg. making "close button" on floorplan.

  • Really? Make a test...

    i almost certain of it. but not 100% ill test tomorrow at work. the vtour dropket creates a global onclick event to close the thumbnails after they are opened. i had a map in my tour and they closed even if the map was clicked. i ended up changing that so i cant just go look but i am curious. ill add a static jped image to the default vtour.xml and will test.

    i agree with you on the onviewchange. usually when i use that event i will set it null after it had detected what i needed it to. i would not want that action being run constantly when it would not be needed.

    for this instance you could add set(events.onviewchange, closemap()); to the action that opens the map. and inside the action that closes the map make the last line set(events.onviewchange, null); then each time you open the map the pano will wait for the stage to move in order to close the map. when it closes it will set the event null so it is not wasting away when not needed. then when the map opens again it will start detecting pano movement until it does, then stop again. i am at a pc i cannot test with but i think it should work.

  • I tried:

    <events onclick="closemap"/>

    An action group that puts away the floorplan and "undoes" what was done with "openmap"

    It works perfectly in Flash - precisely as I was hoping - thanks for your help! However, it doesn't work on the iPad, argh! On the iPad it will close the floorplan if I move the pano, but if I can no longer use the floorplan to move to a new pano... any click will close the floorplan and void the loading of a different pano...

    (FWIW - I would have though onviewchange would be the solution, but it did not work as I would have hoped...)

Participate now!

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