Develop Plugins with subnodes

  • I'm trying to develop a plugin, which has subnodes in its definition in krpano XML, for example it will be defined like this:
    (
    <plugin name= "PluginName" url="PluginURL.swf"
    <!--some attributes-->
    >
    <point name="PointName1" <!--some attributes-->/>
    <point name="PointName1" <!--some attributes-->/>
    </plugin>
    )
    But I don't know how to get the childnodes in the ActionScript when the plugin is registered and REGISTEREVENT is triggered.
    Thanks In Advance.

  • Hi,

    when you have the got plugin object in the REGISTER EVENT you can directly access the child nodes, either via the krpano get function or directly,

    here an example for direct access:

    best regards,
    Klaus

  • Hi Klaus!
    How to access attribute "name"?
    I get "undefined"
    Thank you!

    Code
    <plugin name="parent" >
        <child    name="test"  />
        <children names="test" />
    </plugin>
    
    
    <javascript>
        alert(plugin.child.name);     // undefined
        alert(plugin.children.names); // test
    </javascript>


    UPD.
    One can thus:

    Code
    alert(krpano.get("plugin[parent].child[0].name"));// test


    But it is not dynamic...

    UPD.
    I found the solution: *smile*

    Code
    alert(plugin.child.getItem(0).name); // test

    2 Mal editiert, zuletzt von nosferatu (30. September 2013 um 09:25)

Jetzt mitmachen!

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