Error with loadpano

  • I built a simple plugin that registers a click on a box and calls krpano.call("action(load2)"). If the function in the action is loadpano(pano2.xml), I get this:

    Code
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    	at krpano::krpano_plugin/event_click()


    when it loads the new pano even though when this action is called by a hotspot I don't get the error. If I change the function in the load2 action to delayedcall(0,loadpano(pano2.xml)) I don't get an error. Any idea as to what might be going on? I am baffled.
    Thanks

    2 Mal editiert, zuletzt von marcbn (18. November 2008 um 21:45)

  • Here is the event listener, I tried both; I thought maybe I should be using the addPluginEventListener instead:

    Code
    button.addEventListener(MouseEvent.CLICK,pluginClick);
    //krpano.addPluginEventListener(button,MouseEvent.CLICK,pluginClick);


    and the pluginClick function:

    Code
    function pluginClick(e:Event) {
    	krpano.call("action(load2)");
    }


    and the XML:

  • this code is okay:

    Code
    button.addEventListener(MouseEvent.CLICK,pluginClick);


    addPluginEventListener is only for special plugin events (REGISTER,RESIZE,UPDATE)

    this code is okay too:

    Code
    function pluginClick(e:Event) {
    krpano.call("action(load2)");
    }

    normally it should work...

    one question - was the "krpano" interface already set?

    Code
    krpano = krpano_as3_interface.getInstance();

    EDIT - once more - does this error appear only on the second click?
    please try to set the "keep" attribute of your plugin to "true" to be sure that the plugin is not unloaded when loading a other pano,

    Code
    <plugin name="testPlugin" url="testPlugin.swf" keep="true" />

    best regards,
    Klaus

Jetzt mitmachen!

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