problems with parent="stage"

  • Hi! I'm having problems with parent="stage" in my plugin.
    When I use parent=stage I receive a lot of error due to trying to access nulling objects.
    It works fine without parent=stage.
    The problem is really strange
    I have a method registered for XML access:

    Code
    plugininterface.actualizarradar  = interface_actualizarradar;


    that method is called inside xmlcomplete when I use loadpano:

    Code
    <events onxmlcomplete="action(xmlcomplete);" />
         	<action name="xmlcomplete">
    				plugin[mapa].actualizarradar();
    	 	</action>


    but when that method is called, I get a null reference inside it:

    Code
    public function interface_actualizarradar():void
       	{
    			if(krpano!=null)
    				krpano.trace(1, "actualizarradar");
           	//krpano and plugininterface are null here !!
    		}

    and that's really strange because if the method is called is because it was registered with plugininterface before, so, why plugininterface is null later?
    and again, it works fine without parent=stage, so I'm losing something there I guess...

    Does somebody know where is the problem?

    Thanks !!

  • Please Klaus (or someone), I really need help with this.
    I think this is an internal functionality of Krpano.
    Maybe Krpano is adding two times the plugin when we use parent=stage, or something like that.
    Because the PLUGINEVENT_REGISTER is fired, I get the krpano interface, also the plugininterface, and I can register a custom function for XML usage, but then when the function is called from the loaded XML I get a null reference to krpano interface and plugin interface, and that is happening only when I use parent=stage...

    It's really strange...

  • Hi Job, I can't use krpano.trace because krpano is null !
    And I don't know why, because krpano has the interface when the plugin starts, because PLUGINEVENT_REGISTER is fired, because plugininterface is obtained, because my AS3 method is registered for XML usage, because the method is called from my XML with sucess, but then, inside my method, krpano is null !
    And is null only if I use parent=stage.
    So I think krpano is doing something different with parent=stage that makes krpano null after register the plugin.

    Do you know if we must code something different when we use a make a plugin with parent=stage?

    Also, I'm using googlemaps... my own plugin (not krpano googlemaps), I'm mentioning it because I found that googlemaps plugin from krpano was not working in previous versions with parent=stage.

    Edited once, last by enridp (February 12, 2011 at 5:50 PM).

  • Hi,

    do you have ADDED_TO_STAGE and REMOVED_FROM_STAGE events in your page?

    if yes, this can be the problem, because when the plugin will be moved from a displayobject to another one (that happens when changing the parent), then this events will be called,

    e.g. do the plugin start/stop functions in that way:

    best regards,
    Klaus

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!