Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

1

Freitag, 28. Juni 2019, 13:42

Custom Plugin Action not called

Dear Krpano Team,
I seem to have made an error in my custom plugin, but could also not find a working example elsewhere in the internet. I suppose the mistake is obvious and hope one of you could point me to it with a few lines:
https://stackoverflow.com/questions/5680…nown-registered
In a nutshell:
I use

Quellcode

1
2
3
4
5
6
7
8
9
10
11
local.registerplugin = function(krpanointerface, pluginpath, pluginobject) {
        // get the krpano interface and the plugin object
        krpano = krpanointerface;
        plugin = pluginobject;

        // first - say hello
        krpano.trace(1, "Bridge Plugin loaded: [" + plugin.name + "]");

        // add plugin action (the attribute needs to be lowercase!)
        plugin.jsbmodal = action_jsbmodal;
    };

And try to call it via hotspot onclick

Quellcode

1
2
3
4
5
<hotspot  name="hotspot_171" style="link_hs_sm"  url="%CURRENTXML%/add_hotspot/picture/icon-text.png" distorted="true" alpha="1" capture="true" depth="1000" flying="0" handcursor="true" zorder="5" zoom="false"
            ath="160.8416" atv="-37.4461" width="50" height="prop" rx="0" ry="0" rz="0" ox="0" oy="0" rotate="0" scale="1" edge="center"
            install_onclick="3" name_hs="hotspot_171" scene_EL="scene_8" info_Ah="add_hotspot/text/leipzig-test.html" fov_EL="140" enabled2="true" visible2="true" drag_hs="true"
            onclick="jsbmodal('om')"
        />

But only get: WARNING: Unknown action: jsbmodal

Thx a lot for some insight on this!
Maybe also the documentation could be updated a bit to make more clear, how the "dosomething" example action is used lateron in the xml?
Thx a lot!
Andreas

light_line

Fortgeschrittener

Beiträge: 169

Beruf: krpano freelancer || creating ideas & coding them || krpano developer

  • Nachricht senden

2

Samstag, 29. Juni 2019, 15:44

try this :
onclick="plugin[YOUR_PLUGIN_NAME].jsbmodal('om')"

3

Samstag, 29. Juni 2019, 17:40

instead of (or additional to) plugin.jsbmodal = action_jsbmodal;
you can use krpano.actions.jsbmodal = action_jsbmodal;

then you can call jsbmodal() directly from action code

4

Dienstag, 2. Juli 2019, 00:25

Gentlemen, thx a lot! This is it :D