Combobox and Scenes Help

  • Hi all
    I currently have a pano with several scenes and a combobox which navigates between scenes.
    The combobox 'knows' which scene it is on by using the code;

    Code
    <scene name="scene1" onstart="action(startscene01);">
    <action name="startscene01">
    		plugin[combobox].selectitem('Filey Brigg');
    </action>


    The pano knows which scene to start on by using the code;

    Code
    <krpano version="1.0.8" onstart="loadscene(scene1,null,MERGE,BLEND(1));" >

    This all works perfectly fine. However, when I change the code so that the pano starts with a scene other than scene1 the combobox doesn't change to the correct description.
    For example, if I change the code at the top of the xml to

    Code
    <krpano version="1.0.8" onstart="loadscene(scene5,null,MERGE,BLEND(1));" >


    Then the pano loads with scene5 first but the text in the combobox is still scene1.

    Any help would be appreciated, thanks.

  • Hi designsubway,

    Zitat

    Then the pano loads with scene5 first but the text in the combobox is still scene1.

    I think this is because the combobox is not ready yet....
    Press the O key to see what the debuger says:

    Code
    INFO: krpano 1.0.8 beta 9 DEV (build 2009-10-29)
    INFO: Flashplayer WIN 10,0,32,18 PlugIn
    WARNING: unknown action command: plugin[combobox].selectitem


    Instead of using <scene onstart="action(startscene01);" , try to use <events onloadcomplete="action(startscene01);"

    Code
    <scene name="scene3" onstart="">
    	
    	<events onloadcomplete="action(startscene03);" />
    		
    	<action name="startscene03">
    		plugin[combobox].selectitem('Item 3');
    	</action>
    ....


    I have tried this way, and for me it works.

    SAlut.

  • Hi,

    yes, the reason for this error was, that the selectitem() function was called before the combobox plugin was loaded,

    but there is a way to force loading the combobox plugin before the pano and before any action code can be executed,
    just add - preload="true" - to the plugin,

    e.g.

    Code
    <plugin ... url="combobox.swf ... preload="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!