onresize scene change problem

  • Hi all,

    It's been a while since I posted but I have a bit of a problem that I hope someone can help with.
    I have a tour with multiple scenes and I want to run an action on the onresize event.
    However, when the user clicks a hotspot and the scene changes it appears that my onresize action is executed.

    Is it that the onresize event runs automatically when a new scene is loaded?

    If so has anyone found a way to get round it so that my action only runs when the pano is actually resized?

    Thanks for your help.

    T12

    Liverpool based panoramic photography, virtual tour and
    web media organisation specialising in high quality web experiences.

  • Hi VN2009,

    Thanks for your response.
    I don't have a link available at the moment but I will have by the end of the week.

    I will post it as soon as I have it and hope your offer to assist is still open.

    Thanks.

    T12

    Liverpool based panoramic photography, virtual tour and
    web media organisation specialising in high quality web experiences.

  • Tangent I can confirm this result also. i added this to my onresize event. onresize=" set(plugin[openfs].visible, false);" if that is set when the pano opens it removes the fs button. if i add it after the pano loads set(events.onresize, set(plugin[openfs].visible, false)); and then load a new xml or a new scene the button disappears. it seems that it is detecting a loadpano or loadscene as a resize event. it must be a bug.

  • Tangent I can confirm this result also. i added this to my onresize event. onresize=" set(plugin[openfs].visible, false);" if that is set when the pano opens it removes the fs button. if i add it after the pano loads set(events.onresize, set(plugin[openfs].visible, false)); and then load a new xml or a new scene the button disappears. it seems that it is detecting a loadpano or loadscene as a resize event. it must be a bug.

    Like VN2009, just I've tested the same and I confirm : onresize event after each load*.

  • Hi Klaus,

    Thanks for the clarification.
    If the onresize is called when a new pano loads is there any way I can call an action when the pano is resized that does not use the onresize event?

    Thanks for your help.

    T12

    PS. Thanks to VN2009 and jpdeglet69 for their confirmations.

    Liverpool based panoramic photography, virtual tour and
    web media organisation specialising in high quality web experiences.

  • Hi,

    you could check if that stage sizes has changed and then call your action/code:

    Code
    set(sizehaschanged,false);
    if(laststagewidth  != stagewidth,  set(sizehaschanged,true));
    if(laststageheight != stageheight, set(sizehaschanged,true));
    copy(laststagewidth,stagewidth);
    copy(laststageheight,stageheight);
    if(sizehaschanged, your_resize_action() );

    best regards,
    Klaus

Participate now!

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