Plugins and getting JSON

  • Hi,

    I've created a plugin that makes a url request that returns some JSON. I've parsed the JSON into an object. I then invoke an action with krpano.call("dataloaded") which attempts to update the data in the layers.


    However, I'm unable to read the data from this JSON object from the xml scripting file. I've tried registering attributes and functions on the plugin. What's the easiest way to do this? I want to do something like the following:

    set(layer[title_layer].html, plugin[custom_plugin].data[0].title); <-- this doesn't seem to work, though data is public and is set on the plugin in the actionscript

  • Hi,

    this is wrong:

    set(layer[title_layer].html, plugin[custom_plugin].data[0].title); <-- this doesn't seem to work,

    to set/copy the content, either use:
    set(layer[title_layer].html, get(plugin[custom_plugin].data[0].title) );

    or:
    copy(layer[title_layer].html, plugin[custom_plugin].data[0].title);

    Best regards,
    Klaus

Jetzt mitmachen!

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