loadpano & loadscene

  • Hi all!

    Thanks in advance for helping.

    I have following folder structure:

    - A folder called 'panos' contains files 'pano01.xml', 'pano02.xml', 'pano03,xml', etc..
    - Each file looks like this:

    Code
    <krpano version="1.0.8" onstart="action(set_hotspots);">
    <include url="../global.xml"/>
    <include url="../plugins.xml"/>
    <view/>
    <preview/>
    <image></image>
    <action name="set_hotspots"></action>
    
    
    </krpano>

    - global.xml contains diplay, autorotate, progress and control settings.
    - plugin.xml contains plugins, actions, etc..

    - What I would like to achieve to have all the 'set_hotspots' actions in a single file called brilliantly 'hotspots.xml'

    I've tried using the following in 'pano01.xml'

    Code
    <krpano version="1.0.8" onxmlcomplete="loadscene(scene01,null,MERGE,BLEND(1));">
    <include url="../global.xml"/>
    <include url="../plugins.xml"/>
    <include url="../hotspots.xml"/>
    <view/>
    <preview/>
    <image></image>
    </krpano>

    And this is 'hotspots.xml'

    Code
    <scene name="scene01" onstart=" action(set_hotspots);">
    
    
    <action name="set_hotspots">
    action(one_line, up, pano02, Entrance, -82, 9, -87, -6);
    </action>
    
    
    </scene


    This doesn't work.
    It ignores view parameters and it loads only the preview, not the tiles.
    I've also tried with onstart instead of onxmlcompleted. And both, onxmlcomplete="loadscene(scene01); and onstart="loadscene(scene01);

    The hotspos action works properly so far.

    What am I missing?

    Thanks!!!

  • Solved! *smile*

    EXAMPLE

    pano.xml
    pano01.xml
    scenes.xml

    First, I load 'pano.xml', which includes 'scenes.xml' and loads a scene.
    In the scenes, I have included 'pano01.xml' and other setings such view, data, and my action to create hotspots.

    Now, I have to find out the way to load a random scene. I remember I read something about a 'random command' in the documentation...

    Now the bad news: the coordinates finder doesn't work. Specifically the double click feature.

    According to Firebug 'numclick is not defined'. This error only happens when I use this scene structure. I am not sure how to solve this. I will send a message to Michel, he is the genius behind that code!

    Cheers

  • I am trying to do the same thing. Not really trying coz of a big lack of time by now...

    But here is the answer of Klaus for the random function :


    when you use the krpano.swf from the 1.0.8 beta 9 tools package - there is already a global "random" variable,
    it returns a random value between 0.0 and 1.0,

    e.g. to get a random value between 0 and 10 use the 'mul' action and then the 'roundval' action to remove any decimal places:


    Source code

    1. mul(randomvalue, random, 10);
    2. roundval(randomvalue,0);
    3. trace('randomvalue=', randomvalue);

    best regards,
    Klaus


    I hope it could be helpfull for you.
    I would be pleased to see it working.

    David

  • Hi Michel,

    Thanks for asking. The double click feature works. It's Firebug that doesn't look very happy with numclick not defined. So I turned it off *rolleyes*
    If you are really intrigued about what's going on, you can see the warning yourself installing the Firebug extension for Firefox.
    But if you have better things to do, don't spend your time and talent investigating furthermore *wink*

    Cheers

    Rafa

Jetzt mitmachen!

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