Error: loadscene() not found - HTML5 only

  • I'm working on a tour divided into sections, each sections requiring its own xml file.

    Klaus provided a solution for this a while back but I've since discovered that although it works well in Flash, an error message is thrown up in when viewed on the iPad or HTML5 browser:

    ERROR: loadscene() - "scene_exterior" not found

    "scene_exterior" is the first scene that loads by default.

    This is the case on iPad (ios5), Safari 5.1.7 (using Develop > iPad/iPhone etc options) and Firefox 18.0.1 (all Apple Mac)

    With the setting as html5="always" Google Chrome 24.0.1312.57 doesn't show this error but does display black lines at the cube edges.

    You can see a simplified version of the problem here - just click the hotspot:

    http://pgs-archive.co.uk/tour_test/vtour_exterior/tour.html

    xml files are here:
    http://pgs-archive.co.uk/tour_test/vtour_exterior/tour.xml (start of tour)
    http://pgs-archive.co.uk/tour_test/vtour…n/vtourskin.xml (the second xml file ie next section)

    And this is the code for the hotspot itself:

    <hotspot name="interiorStart" style="skin_hotspotstyle_upNewArea"
    ath="70" atv="6.0"
    handcursor="true"
    onhover="tween(alpha,1);tween(scale,1);showtext(Interior Scene 1 - Day,buttonstyleHotspots);"
    onout="tween(alpha,0.6);tween(scale,0.7)"
    onclick="set(enabled,false);
    set(view.maxpixelzoom,null);
    set(view.fovmin,28);
    tween(alpha,0);
    tween(scale,0);
    looktohotspot(interiorStart, 50, tween(easeOutQuad,1));
    oninterrupt(break);
    loadpano('../vtour_interior/tour.xml', startscene=scene_interior1, IGNOREKEEP, BLEND(1));"
    >
    </hotspot>

    The main tour is here so you can see why I'd need several xml files rather than just the one:

    http://pgs-archive.co.uk/tour_v2/tour.html

    Furthermore, if I load (for instance)
    http://www.pgs-archive.co.uk/tour_v2/tour.h…inEntranceNight as the URL, as similar message appears when trying to access the new xml, ie

    ERROR: loadscene() - "fulfordMainEntranceNight" not found

    (In this tour the arrow with the green border links to a new xml file.)

    So whatever the startscene is, whether specified or not, when going to the new xml it appear that the view is trying to find the original startscene whether it was specified or not.

    Any ideas?

    Thanks.

  • I think I may have solved it myself although I'm not sure it's the "correct" thing to do. I'd be grateful if someone could verify that this isn't "bad coding".

    In the first xml file, the one that contains all the info at the start of the tour, I had

    <krpano version="1.0.8.15" title="" onstart="startup();">

    and the default action as set up by the pano tour droplet.


    <action name="startup">
    if(startscene === null, copy(startscene,scene[0].name));
    loadscene(get(startscene), null, MERGE);
    </action>

    I changed the first line to

    <krpano version="1.0.8.15" title="" onstart="loadscene(horseshoe_1);">
    where "horseshoe_1" is the first scene,


    and removed the action completely.

    This seems to work and isn't throwing up any errors anywhere (Flash or html5) but a concern is that what I've done isn't strictly correct and may have to be rectified for future versions of krpano.

    Again, if someone could kindly cast an eye over this I'd appreciate it. And if is correct, hopefully it helps others.

    Thanks.

  • Klaus kindly answered this for me elsewhere:


    add a: Source code
    1

    delete(startscene);


    to remove the already set startscene variable,
    e.g. directly in the 'startup' action after using it or directly before the loadpano() call


    This works perfectly, so thanks, Klaus.


    (Apologies for posting this here as well as a follow up to a previous old thread but I wasn't sure the old one would be seen and there is also a bit of pressure on the job in terms of time. However, it did seem relevant to this section as well so I hope I haven't annoyed anyone.)

Participate now!

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