Loading swf (or image I suppose) only once a hotspot is clicked

  • Hi Guys,

    It seems that all plugings, images, etc etc are all loaded up and are invisible) A bit like FPP

    I would like to only load a swf when the user clicks on a certain hotspot - with its own preloader etc.

    I am sure this is possible...... isn`t it...?

    Thanks in advance

  • I haven't tried... but it sounds like "addplugin" might do something like this...

    setup something like...

    onclick="action(load_my_plugin);"


    action name="load_my_plugin"
    addplugin(plugin_name)
    set...
    set...
    /action

    http://www.krpano.com/docu/actions/#addplugin

    If that works then you might also be able to replace all of the sets with an includeurl item if you want to keep your main xml page clean.

    All of this is speculation though since I've not tried it.

  • Hi,

    yes, you can, use the addplugin() or addhotspot() action to create a new plugin/hotspot,
    or just leave the "url" attribute empty, and set it later on demand,

    the file/image will be loaded when the "url" was set/changed

    e.g.

    Code
    <plugin name="image" url="" align="center" />
    
    
    ... onclick="set(plugin[image].url, image.jpg);"

    or completely dynamic via addplugin():

    Code
    ... onclick="addplugin(image);
                 set(plugin[image].align,center);
                 set(plugin[image].url, image.jpg);"

    best regards,
    Klaus

  • Thanks Guys,

    Next question - could I unload swfs like "hide images"

    just I have over 40 plugins and I want to keep it smooth!!

    cheers

    JB

    EDIT - I READ THE DOCS!! _

    removeplugin(name)


    removes a plugin object


    parameters:

    • name

      name of the plugin be to removed


    example:


    removeplugin(button);

    *wink*

  • OK I`m nearly there!!!

    However I have a button that should remove all plugins (a bit like hide all images) - however if some plugins have not yet been loaded it brings up an error:

    ERROR: remove - unknown array item - pluginname

    ??

    cheers

  • Thanks Klaus -

    Imagine opening plugins like opening images (like your example)

    <action name="hideallplugins">
    removeplugin(lot1);
    removeplugin(lot2);
    removeplugin(lot3);

    action(hideimage,hidebutton);
    </action>

    Now - this works - however, if one of the plugins (e.g. lot2) has not yet been opened - it calls the above error.

    I could make them invisible but would rather remove them...

    Cheers

    John

  • Thanks Klaus....

    I`m sure you are very busy - apreciate your swift replys.

    This is the reason I switched from FPP - and now, after playing with KRpano for a while now. I realise the xml is sooooo much more ordered.

    It was a bit weird to start but its great after a while

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!